query-49183731b52fb248995630be7a160bf4

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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?place ?placeLabel ?placeDescription ?location ?locationLabel ?dist WHERE {
  ?place wdt:P17 wd:Q38;
         wdt:P625 ?coord;
         wdt:P131 ?location .
  ?location p:P31/ps:P31/wdt:P279* wd:Q515;
            wdt:P625 ?locationCoord .
  BIND( geof:distance(?coord, ?locationCoord) AS ?dist ) .
  FILTER( ?dist > 50 ) .
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "en" . 
  } .
} ORDER BY DESC(?dist)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?coord") v6("?dist"):::projected v4("?location"):::projected v5("?locationCoord") v2("?place"):::projected a1((" ")) a2((" ")) c13(["en"]):::literal c3(["wd:Q38"]):::iri c11(["bd:serviceParam"]):::iri c9(["wd:Q515"]):::iri f0[["?dist > '50^^xsd:integer'"]] f0 --> v6 v2 --"p:direct/P17"--> c3 v2 --"p:direct/P625"--> v3 v2 --"p:direct/P131"--> v4 v4 --"p:P31"--> a1 a1 --"p:statement/P31"--> a2 a2 --"p:direct/P279"--> c9 v4 --"p:direct/P625"--> v5 bind1[/"http://www.opengis.net/def/function/geosparql/distance(?coord,?locationCoord)"/] v3 --o bind1 v5 --o bind1 bind1 --as--o v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end