query-2c9452191d94546ae9475283cff46095

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 ?beach ?beachLabel ?metro ?metroLabel ?dist
WHERE {
  {
    SELECT ?beach ?metro ?dist
    WHERE {
      ?beach wdt:P31/wdt:P279* wd:Q40080;
        wdt:P17 wd:Q142;
        wdt:P625 ?beachLoc .
      ?metro wdt:P31/wdt:P279* wd:Q928830;
        wdt:P17 wd:Q142;
        wdt:P625 ?metroLoc .
      BIND(geof:distance(?beachLoc, ?metroLoc) * 1000 as ?dist)
      FILTER(?dist <= 2000)
    }
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr, en" . }
}
ORDER BY ASC(?dist)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?beach"):::projected v3("?beachLoc") v6("?dist"):::projected v4("?metro"):::projected v5("?metroLoc") a1((" ")) a2((" ")) c8(["wd:Q928830"]):::iri c12(["fr, en"]):::literal c4(["wd:Q40080"]):::iri c10(["bd:serviceParam"]):::iri c6(["wd:Q142"]):::iri f0[["?dist <= '2000^^xsd:integer'"]] f0 --> v6 v2 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c4 v2 --"wdt:P17"--> c6 v2 --"wdt:P625"--> v3 v4 --"wdt:P31"--> a2 a2 --"wdt:P279"--> c8 v4 --"wdt:P17"--> c6 v4 --"wdt:P625"--> v5 bind1[/"http://www.opengis.net/def/function/geosparql/distance(?beachLoc,?metroLoc) * '1000^^xsd:integer'"/] v3 --o bind1 v5 --o bind1 bind1 --as--o v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end