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.

-Saul

asked 26 Nov '12, 17:36

SaulTocsin's gravatar image

SaulTocsin
13615
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

http://live.dbpedia.org/sparql

-Saul

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

All,

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.

-Saul

permanent link

answered 26 Nov '12, 17:59

SaulTocsin's gravatar image

SaulTocsin
13615
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

By RSS:

Answers

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

Question tags:

×1,302
×32

question asked: 26 Nov '12, 17:36

question was seen: 876 times

last updated: 26 Nov '12, 17:59