Search code examples
sparqlrdffuseki

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.


Solution

  • 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.