a) In Java you should be able to modify URIs, right? And that's what you get from the endpoint. b) I meant to add triple patterns for your ?rightAnswer and ?wrongAnswer resources such that you get the rdfs:label of those.

On 26.02.2016 23:29, kumar rohit wrote:
Thank you for your response.
I could not understand, kindly if you can explain it briefly.

Best regards

On Fri, Feb 26, 2016 at 4:58 PM, Lorenz buehmann <
buehm...@informatik.uni-leipzig.de> wrote:

among others, two options:

1) simply use the last part of the URI in your Java code
2) ask for the rdfs:label for each ?s in the query

Lorenz


On 26.02.2016 16:37, kumar rohit wrote:

I want to ask a question from dbpedia using Jena code. There is a GUI
button in eclipse "Solve question" when clicked JEna code is executed and
SPARQL query runs against dbpedia.
The question is what is capital city of Germany and have four options. My
query is like this:

select distinct ?rightAnswer ?wrongAnswer where {
    dbr:Germany dbo:capital ?rightAnswer .   ?s dbo:capital ?wrongAnswer .
    filter ( ?s != dbr:Germany && ?wrongAnswer != ?rightAnswer )} limit 4

It gives me answer like shown in table below: I want answer in format
like this so that user can select one name:

.Berlin

.Padeborn

.Budapest

.Stanley

How can I achieve this?

rightAnswerwrongAnswer
http://dbpedia.org/resource/Berlin http://dbpedia.org/resource/Apia
http://dbpedia.org/resource/Berlin http://dbpedia.org/resource/Paderborn
http://dbpedia.org/resource/Berlin
http://dbpedia.org/resource/Stanley,_Falkland_Islands
http://dbpedia.org/resource/Berlin http://dbpedia.org/resource/Budapest



Reply via email to