1

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

Neil Graham
  • 593
  • 1
  • 5
  • 17

1 Answers1

2

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 } }
}
AndyS
  • 16,345
  • 17
  • 21