query-f81af0bf2cb893b116e8df4ec946c48c
mit Linestrings
Use at
- https://query.wikidata.org/sparql
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#EditCloud for Travel to Vaxholm mit Images und coloring
#defaultView:Map
SELECT DISTINCT ?poi ?poiLabel ?coord ?layer ?line
WHERE
{ BIND(wd:Q127510225 AS ?item) .
?item wdt:P921 ?poi.
?item p:P921 ?statement .
?statement ps:P921 ?poi .
?statement pq:P585 ?layer .
optional {
?statement pq:P156 ?poi2 .
?poi2 p:P625 [psv:P625 [ wikibase:geoLongitude ?lon2; wikibase:geoLatitude ?lat2; ] ] .
}
?poi wdt:P625 ?coord.
?poi p:P625 [psv:P625 [ wikibase:geoLongitude ?lon1; wikibase:geoLatitude ?lat1; ] ] .
BIND(CONCAT('LINESTRING (', STR(?lon1), ' ', STR(?lat1), ',', STR(?lon2), ' ', STR(?lat2),')') AS ?str) .
BIND(STRDT(?str, geo:wktLiteral) AS ?line)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?coord"):::projected
v1("?item")
v10("?lat1")
v7("?lat2")
v4("?layer"):::projected
v12("?line"):::projected
v9("?lon1")
v6("?lon2")
v2("?poi"):::projected
v5("?poi2")
v3("?statement")
v11("?str")
a2((" "))
a1((" "))
a4((" "))
a3((" "))
c12(["bd:serviceParam"]):::iri
c14(["#91;AUTO_LANGUAGE#93;,en"]):::literal
bind0[/"'wd:Q127510225'"/]
bind0 --as--o v1
v1 --"p:direct/P921"--> v2
v1 --"p:P921"--> v3
v3 --"p:statement/P921"--> v2
v3 --"p:qualifier/P585"--> v4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:qualifier/P156".-> v5
a1 --"wikibase:geoLongitude"--> v6
a1 --"wikibase:geoLatitude"--> v7
a2 --"p:statement/value/P625"--> a1
v5 --"p:P625"--> a2
end
v2 --"p:direct/P625"--> v8
a3 --"wikibase:geoLongitude"--> v9
a3 --"wikibase:geoLatitude"--> v10
a4 --"p:statement/value/P625"--> a3
v2 --"p:P625"--> a4
bind1[/"concat('LINESTRING (',str(?lon1),' ',str(?lat1),',',str(?lon2),' ',str(?lat2),')')"/]
v9 --o bind1
v10 --o bind1
v6 --o bind1
v7 --o bind1
bind1 --as--o v11
bind2[/"STRDT(?str,'geo:wktLiteral')"/]
v11 --o bind2
bind2 --as--o v12
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c12 --"wikibase:language"--> c14
end