Last active
May 10, 2016 01:19
-
-
Save sbma44/b6f1c25a074ece5757349b413c78162c to your computer and use it in GitHub Desktop.
wikidata SPARQL queries, both for the USA (Q30)
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
PREFIX wd: <http://www.wikidata.org/entity/> | |
PREFIX wdt: <http://www.wikidata.org/prop/direct/> | |
SELECT ?flag ?seal ?coatofarms ?population ?website ?anthem ?article | |
WHERE { | |
OPTIONAL { ?location wdt:P1082 ?population . } | |
OPTIONAL { ?location wdt:P41 ?flag . } | |
OPTIONAL { ?location wdt:P94 ?coatofarms . } | |
OPTIONAL { ?location wdt:P158 ?seal . } | |
OPTIONAL { ?location wdt:P856 ?website } | |
OPTIONAL { ?location wdt:P85 ?anthem . } | |
{ | |
?article schema:about ?location . | |
?article schema:inLanguage "en" . | |
FILTER (SUBSTR(str(?article), 1, 25) = "https://en.wikipedia.org/") | |
} | |
FILTER (?location IN (wd:Q30)) . | |
} |
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
PREFIX wd: <http://www.wikidata.org/entity/> | |
PREFIX wdt: <http://www.wikidata.org/prop/direct/> | |
SELECT ?movie ?movieLabel ?netflix ?imdb | |
WHERE { | |
?movie wdt:P840 ?location . | |
?movie wdt:P345 ?imdb . | |
?movie wdt:P31 wd:Q11424 . | |
OPTIONAL { | |
?movie wdt:P1874 ?netflix . | |
} | |
FILTER (?location IN (wd:Q30)) . | |
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" } | |
} | |
ORDER BY DESC(?imdb) ASC(?movieLabel) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment