query-b831a12dd4b5f9caf34626de824610e2

rq turtle/ttl

Query to find latitudes and longitudes for places in Paris

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?a ?aLabel ?lat ?long WHERE {
  ?a wdt:P131+ wd:Q90 .  # administrative territorial entity = Paris
  ?a p:P625 ?statement . # coordinate-location statement
  ?statement psv:P625 ?coordinate_node .
  ?coordinate_node wikibase:geoLatitude ?lat .
  ?coordinate_node wikibase:geoLongitude ?long .

  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" .
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?a"):::projected v3("?coordinate_node") v4("?lat"):::projected v5("?long"):::projected v2("?statement") c2(["wd:Q90"]):::iri c8(["bd:serviceParam"]):::iri c10(["en"]):::literal v1 --"p:direct/P131"--> c2 v1 --"p:P625"--> v2 v2 --"p:statement/value/P625"--> v3 v3 --"wikibase:geoLatitude"--> v4 v3 --"wikibase:geoLongitude"--> v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end