query-d76ab3fe4011e0753f8e54e2808d3e42

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?place ?placeLabel ?location ?population ?distance WHERE {
  wd:Q60 wdt:P625 ?NYLoc .
  ?place wdt:P625 ?location; wdt:P17 wd:Q30 .
  BIND( geof:distance( ?NYLoc, ?location ) AS ?distance ) .
  FILTER( ?distance < 30 ) .
  ?place wdt:P1082 ?population; wdt:P31/wdt:P279* wd:Q486972 .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr,en" } .
} ORDER BY ?distance

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?NYLoc") v5("?distance"):::projected v4("?location"):::projected v3("?place"):::projected v5("?population"):::projected a1((" ")) c2(["wd:Q60"]):::iri c5(["wd:Q30"]):::iri c9(["wd:Q486972"]):::iri c11(["bd:serviceParam"]):::iri c13(["fr,en"]):::literal f0[["?distance < '30^^xsd:integer'"]] f0 --> v5 c2 --"wdt:P625"--> v2 v3 --"wdt:P625"--> v4 v3 --"wdt:P17"--> c5 bind1[/"http://www.opengis.net/def/function/geosparql/distance(?NYLoc,?location)"/] v2 --o bind1 v4 --o bind1 bind1 --as--o v5 v3 --"wdt:P1082"--> v5 v3 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c9 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end