Created
April 1, 2022 08:30
-
-
Save loretoparisi/e2ccf211c4a723e83944b8a8819146e3 to your computer and use it in GitHub Desktop.
Wikidata Entity Properties Sparql query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT ?wdLabel ?ooLabel | |
WHERE { | |
VALUES (?s) {(wd:%@)} | |
?s ?wdt ?o . | |
?wd wikibase:directClaim ?wdt . | |
?wd rdfs:label ?wdLabel . | |
OPTIONAL { | |
?o rdfs:label ?oLabel . | |
FILTER (lang(?oLabel) = "en") | |
} | |
FILTER (lang(?wdLabel) = "en") | |
BIND (COALESCE(?oLabel, ?o) AS ?ooLabel) | |
} ORDER BY xsd:integer(STRAFTER(STR(?wd), "http://www.wikidata.org/entity/P")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment