NOT EXISTS
and MINUS
, which you should be able to run against any SPARQL 1.1 endpoint.NOT EXISTS
and MINUS
offer flexible ways to check for the absence of a given pattern, or to exclude possible solutions from the result set.Here are some examples showcasing Virtuoso's support for this functionality:
SELECT COUNT(*) WHERE { ?s ?p "Novosibirsk" FILTER NOT EXISTS { ?s ?p "???????????" } }
SELECT COUNT(*) WHERE { { ?s ?p "Novosibirsk" } MINUS { ?s ?p "???????????" } }