Skip to content

Instantly share code, notes, and snippets.

@tommorris
Created January 26, 2017 13:56
Show Gist options
  • Save tommorris/0db9e256373fd1bbb61e5b9a710efc02 to your computer and use it in GitHub Desktop.
Save tommorris/0db9e256373fd1bbb61e5b9a710efc02 to your computer and use it in GitHub Desktop.
# query that finds people who have a sexual orientation set
# but for which there is no source.
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX wikibase: <http://wikiba.se/ontology#>
SELECT DISTINCT ?item ?itemLabel ?statement WHERE {
?item wdt:P31 wd:Q5 .
?item wdt:P91 ?propValue .
?item p:P91 ?statement .
OPTIONAL {
?statement prov:wasDerivedFrom ?derivedFrom .
}
FILTER (!BOUND(?derivedFrom))
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
LIMIT 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment