query-935b7c71f5275a14752e5a2bebc1dbcc

rq turtle/ttl

Forts claimed to be different, by distance apart

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 ?fort1 ?fort1Label ?fort2 ?fort2Label ?location1 ?location2 ?distance
WHERE 
{
  ?fort1 wdt:P31/wdt:P279* wd:Q1785071.
  ?fort1 wdt:P625 ?location1.
  ?fort1 wdt:P1889 ?fort2.
  #?fort1 wdt:P1889 ?fort2.
  ?fort2 wdt:P31/wdt:P279* wd:Q1785071.
  ?fort2 wdt:P625 ?location2.
  BIND(geof:distance(?location1, ?location2) as ?distance). 
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul". }
} ORDER BY ?distance

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?distance"):::projected v2("?fort1"):::projected v4("?fort2"):::projected v3("?location1"):::projected v5("?location2"):::projected a1((" ")) a2((" ")) c9(["en-gb,en,mul"]):::literal c3(["wd:Q1785071"]):::iri c7(["bd:serviceParam"]):::iri v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 v2 --"wdt:P625"--> v3 v2 --"wdt:P1889"--> v4 v4 --"wdt:P31"--> a2 a2 --"wdt:P279"--> c3 v4 --"wdt:P625"--> v5 bind0[/"http://www.opengis.net/def/function/geosparql/distance(?location1,?location2)"/] v3 --o bind0 v5 --o bind0 bind0 --as--o v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end