Skip to content

Instantly share code, notes, and snippets.

@hornc
Created July 28, 2017 11:10
Show Gist options
  • Save hornc/b7a7fe969be47cde422854fcf5dc7c75 to your computer and use it in GitHub Desktop.
Save hornc/b7a7fe969be47cde422854fcf5dc7c75 to your computer and use it in GitHub Desktop.
Wikidata SPARQL: People with VIAFs and notable works, without OLIDs
#People with VIAFs and notable works, without OLIDs
SELECT ?author (SAMPLE(?authorLabel) AS ?authorLabel)
(SAMPLE(?dob) AS ?dob) (SAMPLE(?dod) AS ?dod)
(SAMPLE(?viaf) AS ?viaf) (COUNT(?notable) AS ?works) WHERE {
?author wdt:P31 wd:Q5;
wdt:P800 ?notable;
rdfs:label ?authorLabel;
wdt:P214 ?viaf;
wdt:P569 ?dob;
wdt:P570 ?dod.
# wdt:P648 ?olid.
FILTER NOT EXISTS { ?author wdt:P648 ?olid }
FILTER (langMatches( lang(?authorLabel), "EN" ) )
#SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . }
#FILTER regex (?authorLabel, ".").
}
GROUP BY ?author
ORDER BY DESC(?works)
LIMIT 2000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment