query-b85a4d471e747e72cd66ef5c6a52128d

rq turtle/ttl

Addition that work in PetScanThe following query works fine:

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
SELECT ?item WHERE {
  VALUES ?inst {wd:Q41176 wd:Q16917 wd:Q24354 wd:Q860861 wd:Q11707 wd:Q721747 wd:Q928830 wd:Q1107656 
                          wd:Q3947 wd:Q12317349 wd:Q111594067 wd:Q27686 wd:Q16970 wd:Q35112127 
                          wd:Q1273818 wd:Q41253 wd:Q111236457 wd:Q50359544 wd:Q200764 wd:Q1088552 
                          wd:Q7075 wd:Q483453 wd:Q1007870}.
  ?item wdt:P31 ?inst.
  ?item wdt:P625 ?coord.
  wd:Q99509385 wdt:P625 ?focus1.
  wd:Q113663833 wdt:P625 ?focus2.
  BIND (geof:distance(?coord, ?focus1)+geof:distance(?coord, ?focus2) as ?d).
  FILTER(?d < 2.54).
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?coord") v7("?d") v5("?focus1") v6("?focus2") v2("?inst") v3("?item"):::projected c4(["wd:Q99509385"]):::iri c5(["wd:Q113663833"]):::iri f0[["?d < '2.54^^xsd:decimal'"]] f0 --> v7 bind1[/VALUES ?inst/] bind1-->v2 bind10(["wd:Q41176"]) bind10 --> bind1 bind11(["wd:Q16917"]) bind11 --> bind1 bind12(["wd:Q24354"]) bind12 --> bind1 bind13(["wd:Q860861"]) bind13 --> bind1 bind14(["wd:Q11707"]) bind14 --> bind1 bind15(["wd:Q721747"]) bind15 --> bind1 bind16(["wd:Q928830"]) bind16 --> bind1 bind17(["wd:Q1107656"]) bind17 --> bind1 bind18(["wd:Q3947"]) bind18 --> bind1 bind19(["wd:Q12317349"]) bind19 --> bind1 bind110(["wd:Q111594067"]) bind110 --> bind1 bind111(["wd:Q27686"]) bind111 --> bind1 bind112(["wd:Q16970"]) bind112 --> bind1 bind113(["wd:Q35112127"]) bind113 --> bind1 bind114(["wd:Q1273818"]) bind114 --> bind1 bind115(["wd:Q41253"]) bind115 --> bind1 bind116(["wd:Q111236457"]) bind116 --> bind1 bind117(["wd:Q50359544"]) bind117 --> bind1 bind118(["wd:Q200764"]) bind118 --> bind1 bind119(["wd:Q1088552"]) bind119 --> bind1 bind120(["wd:Q7075"]) bind120 --> bind1 bind121(["wd:Q483453"]) bind121 --> bind1 bind122(["wd:Q1007870"]) bind122 --> bind1 v3 --"wdt:P31"--> v2 v3 --"wdt:P625"--> v4 c4 --"wdt:P625"--> v5 c5 --"wdt:P625"--> v6 bind2[/"http://www.opengis.net/def/function/geosparql/distance(?coord,?focus1) + http://www.opengis.net/def/function/geosparql/distance(?coord,?focus2)"/] v4 --o bind2 v5 --o bind2 v6 --o bind2 bind2 --as--o v7