Skip to content

Instantly share code, notes, and snippets.

@mommi84
Last active July 6, 2020 15:06
Show Gist options
  • Save mommi84/8fad588871e3921caae85c7bb1ebc344 to your computer and use it in GitHub Desktop.
Save mommi84/8fad588871e3921caae85c7bb1ebc344 to your computer and use it in GitHub Desktop.
Differences between entities in SPARQL
# list all differences between two entities, filtered by certain properties
SELECT * WHERE {
{
<http://dbpedia.org/resource/Nevada> ?p ?o1
MINUS { <http://dbpedia.org/resource/Lincoln_County,_Nevada> ?p ?o1 }
} UNION {
<http://dbpedia.org/resource/Lincoln_County,_Nevada> ?p ?o2
MINUS { <http://dbpedia.org/resource/Nevada> ?p ?o2 }
}
VALUES(?p) { (rdf:type) (<http://purl.org/linguistics/gold/hypernym>) }
} ORDER BY ?p ?o2 ?o1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment