SPARQL Examples – Negation

Posted on Aug 31, 2017 (last modified May 7, 2021)

Find the person entries in Tim Berners-Lee’s FOAF file that do not contain a URL for the person’s FOAF file. Try this on ARQ.

PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?name FROM <http://www.w3.org/People/Berners-Lee/card> WHERE { ?person a foaf:Person ; foaf:name ?name . MINUS { ?person rdfs:seeAlso ?url } }