Hi,

I am loading data into a TDB as named graphs via command line tdbloader utility 
with unionDefaultGraph flag specified true for example:

        tdbloader —set http://jena.hpl.hp.com/TDB#unionDefaultGraph=true 
—loc=TDBLocation —graph=‘graphName1’ rdfFile.ttl
        tdbloader —set http://jena.hpl.hp.com/TDB#unioncDefaultGraph=true 
—loc=TDBLocation —graph=‘graphName2’ rdfFile2.ttl

Then I can successfully query to get everything from the union graph with the 
following SPARQL:
        “SELECT ?s ?p ?o ?g WHERE{ GRAPH ?g{ ?s ?p ?o} }"

But now I want to query for data from just one of the named graphs. From the 
SPARQL tutorial in Jena documentation I tried:

        “SELECT ?s ?p ?o FROM NAMED <graphName1> WHERE{ GRAPH <graphName1> {?s 
?p ?o} }”

However, it returns 0 results.

I also tried:

        “SELECT ?s ?p ?o FROM NAMED <graphName1> WHERE{ ?s ?p ?o }”

and

        “SELECT ?s ?p ?o WHERE{ GRAPH <graphName1> {?s ?p ?o} }”

and

        “SELECT ?s ?p ?o ?g FROM NAMED <graphName1> WHERE{ GRAPH ?g {?s ?p ?o} 
}”

But none of the queries produce any results. I am wondering if maybe setting 
the flag unionDefaultGraph to true is incorrect for my purpose? I want to be 
able to query all graphs at once, but also be able to query individual named 
graphs.

Thanks,
Brad

Reply via email to