Skip to content

Instantly share code, notes, and snippets.

@tfmorris
Created July 27, 2022 21:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tfmorris/6c2a40bc7c7de9753a1d9c64b5ae2420 to your computer and use it in GitHub Desktop.
Save tfmorris/6c2a40bc7c7de9753a1d9c64b5ae2420 to your computer and use it in GitHub Desktop.
Wikidata SPARQL query for duplicate OpenLibrary author IDs
# Humans with the most non-deprecated OpenLibrary IDs (merge candidates)
SELECT ?item (COUNT(?olid) AS ?olidC)
{
VALUES (?ranks) { ( wikibase:PreferredRank ) ( wikibase:NormalRank ) }
?item p:P648 [ps:P648 ?olid;
wikibase:rank ?ranks;
] ;
wdt:P31 wd:Q5.
# SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?item #?itemLabel
HAVING (?olidC > 2)
ORDER BY DESC (?olidC)
LIMIT 100
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment