query-9c41e7fd8214f8ba1df3b2e31d6766ba

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 ?item ?itemLabel ?location1 ?location2 ?distance WHERE {
  ?item wdt:P31/wdt:P279* wd:Q3887;
    wdt:P625 ?location1, ?location2.
  BIND(geof:distance(?location1, ?location2) AS ?distance)
  FILTER(((geof:longitude(?location1)) < (geof:longitude(?location2))) || (((geof:longitude(?location1)) = (geof:longitude(?location2))) && ((geof:latitude(?location1)) < (geof:latitude(?location2)))))
  FILTER(?distance > 100 )
 SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}order by desc(?distance)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?distance"):::projected v4("?item"):::projected v2("?location1"):::projected v3("?location2"):::projected a1((" ")) c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal c4(["wd:Q3887"]):::iri f0[["?distance > '100^^xsd:integer'"]] f0 --> v5 f1[["(http://www.opengis.net/def/function/geosparql/longitude(?location1) < http://www.opengis.net/def/function/geosparql/longitude(?location2) || http://www.opengis.net/def/function/geosparql/longitude(?location1) = http://www.opengis.net/def/function/geosparql/longitude(?location2)http://www.opengis.net/def/function/geosparql/latitude(?location1) < http://www.opengis.net/def/function/geosparql/latitude(?location2))"]] f1 --> v2 f1 --> v3 v4 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c4 v4 --"wdt:P625"--> v2 v4 --"wdt:P625"--> v3 bind2[/"http://www.opengis.net/def/function/geosparql/distance(?location1,?location2)"/] v2 --o bind2 v3 --o bind2 bind2 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end