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