query-f401a0400b5a0cc7464db37f3e699436
List of airports in a given administrative région (or a wikipedia category ?) I tried this one but not working:20:01, 22 September 2017 (UTC)) talk (BouzinacHello everyone, I'd like to export the coordinates, names and aliases of any airports in a given region or category. For instance Region : Nouvelle-Aquitaine or catégorie on french wikipédia = "Aéroport en Nouvelle-Aquitaine" ? Thank you for the help! --
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
#defaultView:Map
SELECT ?item ?coords_ ?itemLabel WHERE {
?item wdt:P131 wd:Q18678082.
?item (p:P625/psv:P625) ?coords.
?coords wikibase:geoLatitude ?lat.
?coords wikibase:geoLongitude ?lon.
BIND(STRDT(CONCAT("Point(", IF(?lon < 0, STR(?lon + 360), STR(?lon)), " ", STR(?lat), ")"), geo:wktLiteral) AS ?coords_)
?item wdt:P31 wd:Q1248784.
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?coords")
v5("?coords_"):::projected
v1("?item"):::projected
v3("?lat")
v4("?lon")
a1((" "))
c8(["wd:Q1248784"]):::iri
c2(["wd:Q18678082"]):::iri
v1 --"p:direct/P131"--> c2
v1 --"p:P625"--> a1
a1 --"p:statement/value/P625"--> v2
v2 --"wikibase:geoLatitude"--> v3
v2 --"wikibase:geoLongitude"--> v4
bind0[/"STRDT(concat('Point(',if(?lon < '0^^xsd:integer',str(?lon + '360^^xsd:integer'),str(?lon)),' ',str(?lat),')'),'geo:wktLiteral')"/]
v4 --o bind0
v3 --o bind0
bind0 --as--o v5
v1 --"p:direct/P31"--> c8