Hi All,

I've copied the federated query code from here. I changed the serviceEndpoint variable to

    final static String serviceEndpoint = "http://live.dbpedia.org/sparql";

I also used throughout http://live.dbpedia.org/sparql rather than http://dbpedia.org/sparql.

When I run the program, I get an empty result set. But when I try the query in a web browser against http://live.dbpedia.org/sparql it seems to work just fine (I get back a table of Tom Hanks movies).

The Jena jar files are those that come with version 2.7.3 of Jena.

The manual query works, the programmatic one doesn't. What am I doing wrong?

Thanks for your help.


asked 26 Nov '12, 17:36

SaulTocsin's gravatar image

accept rate: 0%

To be entirely accurate, I left the PREFIX statement as

PREFIX dbpedia: <http://dbpedia.org/ontology/>

but I changed the serviceEndpoint variable and the second SERVICE statement to reference



(26 Nov '12, 17:52) SaulTocsin SaulTocsin's gravatar image


I think I figured this out. I was again playing with the manual query at http://live.dbpedia.org/sparql and, on a whim, I removed its "Default Data Set Name (Graph IRI)" value of "http://dbpedia.org". When I then ran the query, I got no result set.

So....I added another FROM statement to the source code, referencing http://dbpedia.org/ and the program now works.

But I'm still not sure why the original program ever worked for any one. I'm clearly not understanding something.



answered 26 Nov '12, 17:59

SaulTocsin's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "Title")
  • image?![alt text](/path/img.jpg "Title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 26 Nov '12, 17:36

Seen: 821 times

Last updated: 26 Nov '12, 17:59