Last active
December 28, 2016 21:56
-
-
Save voigt/38aee0c1fc2368b08047dd7581e1da87 to your computer and use it in GitHub Desktop.
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
# Returns all Churches from Lower Saxony, Germany | |
# including label, article URL, long, lat | |
# JSON: https://query.wikidata.org/bigdata/namespace/wdq/sparql?query=SELECT%20DISTINCT%20%3Fitem%20%3FitemLabel%20%3Flat%20%3Flong%0AWHERE%20%7B%0A%20%20%20%20%3Fitem%20wdt%3AP31%20wd%3AQ16970%20.%0A%20%20%20%20%3Fitem%20wdt%3AP17%20wd%3AQ183%20.%0A%20%20%20%20%3Fitem%20wdt%3AP131*%20wd%3AQ1197%20.%0A%20%20%0A%20%20%20%20SERVICE%20wikibase%3Alabel%20%7B%20bd%3AserviceParam%20wikibase%3Alanguage%20%22de%22%20%7D%0A%7D&format=json | |
SELECT DISTINCT ?item ?itemLabel ?article ?lat ?long | |
WHERE { | |
?item wdt:P31 wd:Q16970 . | |
?item wdt:P17 wd:Q183 . | |
?item wdt:P131* wd:Q1197 . | |
OPTIONAL { | |
?item p:P625 ?statement . # coordinate-location statement | |
?statement psv:P625 ?coordinate_node . | |
?coordinate_node wikibase:geoLatitude ?lat . | |
?coordinate_node wikibase:geoLongitude ?long . | |
} | |
OPTIONAL { | |
?article schema:about ?item . | |
?article schema:inLanguage "de" . | |
?article schema:isPartOf <https://de.wikipedia.org/> . | |
} | |
SERVICE wikibase:label { bd:serviceParam wikibase:language "de" } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment