tat
tat

Reputation: 331

SPARQL queries with FROM clause in Fuseki2

In Fuseki2, I am trying to run a simple query to fetch remote RDF data, using the SPARQL FROM clause.

I am running Fuseki2 locally, without any configuration:

./fuseki-server --update --verbose --debug --loc=dataDir /myDataset

Taking this example from DuCharme's Learning SPARQL book:

# filename: ex540.rq

CONSTRUCT 
FROM <http://rdf.freebase.com/rdf/en.joseph_hocking>
WHERE 
{ ?s ?p ?o } 

In the Fuseki2 GUI, if I set the graph content type to Turtle, this is the response I get:

{
  "readyState": 4,
  "responseText": "",
  "status": 200,
  "statusText": "OK"
}

If I change the graph content type to XML, I get:

<rdf:RDF
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
</rdf:RDF>

Shouldn't it be possible to return a graph of triples from the remote data source? Does something need to be configured in Fuseki2 in order to enable queries against remote (static) data sources? I've tried sources other than Freebase (e.g., http://www.worldcat.org/oclc/3052242), but same result.

Upvotes: 1

Views: 320

Answers (2)

AndyS
AndyS

Reputation: 16630

When working inside Fuseki2 (v2.3.1), the FROM clause is resolved by looking in the database for the named graph. It does not go to the web to read it.

You can load the data into Fuseki first and then query it multiple times.

Upvotes: 1

bobdc
bobdc

Reputation: 51

I see neither of the following (stackoverflow wouldn't let me use the actual URIs because I apparently need at least 10 reputation to post more than 2 "links"):

enter code herecurl [hocking URI here] enter code herecurl -H "Accept: text/turtle" [hocking URI here]

get me anything, but

enter code herewget [hocking URI here]

does pull down triples into a turtle file called en.joseph_hocking, so I think it has something to do with the HTTP communication going on. I would check on the Jena mailing list[1] to find out more about how Fuseki is handling that.

Bob

[1] https://jena.apache.org/help_and_support/

Upvotes: 1

Related Questions