query-88b4e26dfec95a04203c33158da8a58a

rq turtle/ttl

MH dont les coordonnées sont à plus de 10 kilomètres des coordonnées de la localisation en P131 SELECT ?MH ?MHLabel ?communeLabel ?deptLabel ?dist ?coordMH ?coordLoc WHERE { ?MH wdt:P380 []; wdt:P131 ?commune ; wdt:P625 ?coordMH . ?commune wdt:P31 wd:Q484170 . #commune de France ?commune wdt:P131 wd:Q3336. #dept ?commune wdt:P131 ?dept. ?dept wdt:P31 wd:Q6465 .

?commune wdt:P625 ?coordLoc.

BIND(geof:distance(?coordLoc, ?coordMH) AS ?dist) FILTER(?dist > 10 ) SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". } } ORDER BY DESC (?dist)

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#>
#MH dont les coordonnées sont à plus de 10 kilomètres des coordonnées de la localisation en P131
SELECT ?MH ?MHLabel ?communeLabel ?deptLabel  ?dist ?coordMH ?coordLoc WHERE {
  ?MH wdt:P380 []; wdt:P131 ?commune ; wdt:P625 ?coordMH .
  ?commune wdt:P31 wd:Q484170 . #commune de France
  ?commune wdt:P131 wd:Q3336. #dept 
  ?commune wdt:P131 ?dept.
  ?dept wdt:P31 wd:Q6465 .

  ?commune wdt:P625  ?coordLoc.  

  BIND(geof:distance(?coordLoc, ?coordMH) AS ?dist)
  FILTER(?dist > 10 )
  SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
} ORDER BY DESC (?dist)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?MH"):::projected v3("?commune") v6("?coordLoc"):::projected v4("?coordMH"):::projected v5("?dept") v7("?dist"):::projected a1((" ")) c10(["bd:serviceParam"]):::iri c8(["wd:Q6465"]):::iri c7(["wd:Q3336"]):::iri c12(["fr"]):::literal c6(["wd:Q484170"]):::iri f0[["?dist > '10^^xsd:integer'"]] f0 --> v7 v2 --"wdt:P380"--> a1 v2 --"wdt:P131"--> v3 v2 --"wdt:P625"--> v4 v3 --"wdt:P31"--> c6 v3 --"wdt:P131"--> c7 v3 --"wdt:P131"--> v5 v5 --"wdt:P31"--> c8 v3 --"wdt:P625"--> v6 bind1[/"http://www.opengis.net/def/function/geosparql/distance(?coordLoc,?coordMH)"/] v6 --o bind1 v4 --o bind1 bind1 --as--o v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end