query-8baa8d0cc34f33ae26e6b2f63a0ca9dc

rq turtle/ttl

Lignes filtrées par grandeur kilométrique

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
#defaultView:Map{"hide":["?coordN", "?coordD", "?line", "?layer"]}
SELECT * WHERE {
  ?person wdt:P27 wd:Q31 ; wdt:P19 ?lieuN ; wdt:P20 ?lieuD .
  BIND ( ?lieuN AS ?layer )
  ?lieuN wdt:P625 ?coordN .
  ?lieuD wdt:P625 ?coordD .
  ?lieuN p:P625/psv:P625/wikibase:geoLatitude ?latN .
  ?lieuN p:P625 / psv:P625 / wikibase:geoLongitude ?lonN .
  ?lieuD p:P625 / psv:P625 / wikibase:geoLatitude ?latD .
  ?lieuD p:P625 / psv:P625 / wikibase:geoLongitude ?lonD .
  BIND(CONCAT('LINESTRING (', STR(?lonN), ' ', STR(?latN), ',', STR(?lonD), ' ', STR(?latD), ')') AS ?str) .
  BIND(STRDT(?str, geo:wktLiteral) AS ?line)
  BIND(geof:distance(?coordN, ?coordD) AS ?dist)
  FILTER ( ?dist > 1000 )
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?coordD"):::projected v6("?coordN"):::projected v14("?dist"):::projected v10("?latD"):::projected v8("?latN"):::projected v5("?layer"):::projected v4("?lieuD"):::projected v3("?lieuN"):::projected v13("?line"):::projected v11("?lonD"):::projected v9("?lonN"):::projected v2("?person"):::projected v12("?str"):::projected a1((" ")) a2((" ")) a3((" ")) a4((" ")) a5((" ")) a6((" ")) a7((" ")) a8((" ")) c3(["wd:Q31"]):::iri f0[["?dist > '1000^^xsd:integer'"]] f0 --> v14 v2 --"p:direct/P27"--> c3 v2 --"p:direct/P19"--> v3 v2 --"p:direct/P20"--> v4 bind1[/"?lieuN"/] v3 --o bind1 bind1 --as--o v5 v3 --"p:direct/P625"--> v6 v4 --"p:direct/P625"--> v7 v3 --"p:P625"--> a1 a1 --"p:statement/value/P625"--> a2 a2 --"wikibase:geoLatitude"--> v8 v3 --"p:P625"--> a3 a3 --"p:statement/value/P625"--> a4 a4 --"wikibase:geoLongitude"--> v9 v4 --"p:P625"--> a5 a5 --"p:statement/value/P625"--> a6 a6 --"wikibase:geoLatitude"--> v10 v4 --"p:P625"--> a7 a7 --"p:statement/value/P625"--> a8 a8 --"wikibase:geoLongitude"--> v11 bind2[/"concat('LINESTRING (',str(?lonN),' ',str(?latN),',',str(?lonD),' ',str(?latD),')')"/] v9 --o bind2 v8 --o bind2 v11 --o bind2 v10 --o bind2 bind2 --as--o v12 bind3[/"STRDT(?str,'geo:wktLiteral')"/] v12 --o bind3 bind3 --as--o v13 bind4[/"http://www.opengis.net/def/function/geosparql/distance(?coordN,?coordD)"/] v6 --o bind4 v7 --o bind4 bind4 --as--o v14