SPARQL: Querying the Default Graph

918 views Asked by At

With the RDF query language SPARQL, I'm trying to find a way to do a boolean query (or any other query) for anything not in a Named Graph.

ASK { GRAPH null { ?s ?p ?o } }

Can't find really any documentation on searching specifically within an empty Named Graph. Also tried replacing null with <>, empty, and (nothing).

1

There are 1 answers

0
AndyS On BEST ANSWER

This query will look for triples in the default graph, then remove ones that are also in a named graph:

SELECT ?s ?p ?o {
   ?s ?p ?o 
   FILTER NOT EXISTS { GRAPH ?g { ?s ?p ?o } }
}