query-285f896480ec6378618e718b2842caa6
Endpoints of cycling routes that run through Saxony-Anhalt grouped into map layers
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map
SELECT ?coord (CONCAT(IF(BOUND(?d),?d,""),
IF(BOUND(?s),CONCAT(" ",?s),""),
IF(BOUND(?c),CONCAT(" ",?c),"")) AS ?desc1Label)
?desc2 ?desc2Label ?layer ?layerLabel ?pic
WHERE {
BIND(?l AS ?layer).
{ SELECT ?l WHERE { ?l wdt:P31/wdt:P279* wd:Q353027. } } ?l wdt:P131+ wd:Q1206.
OPTIONAL { ?l (p:P559|p:P609) [ ?ps1 ?desc2; pq:P625 ?coord ]. [] wikibase:statementProperty ?ps1. }.
OPTIONAL { ?l ?__ [ ?ps2 ?desc1; pq:P131 ?desc2 ]. [] wikibase:statementProperty ?ps2. }.
OPTIONAL { ?l ?__ [ ?ps2 ?desc1; ?_pq ?pqv ]. [] wikibase:statementProperty ?ps2.
FILTER(?_pq != pq:P131). ?pq wikibase:qualifier ?_pq. }.
OPTIONAL { ?l wdt:P625 ?coord. }.
OPTIONAL { ?l wdt:P18 ?pic. }.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de".
?desc1 rdfs:label ?d. ?pq rdfs:label ?s. ?pqv rdfs:label ?c.
?desc2 rdfs:label ?desc2Label. ?layer rdfs:label ?layerLabel.
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v9("?__")
v1("?_pq")
v15("?c"):::projected
v6("?coord"):::projected
v13("?d"):::projected
v8("?desc1")
v18("?desc1Label")
v5("?desc2"):::projected
v16("?desc2Label"):::projected
v3("?l")
v2("?layer"):::projected
v17("?layerLabel"):::projected
v12("?pic"):::projected
v11("?pq")
v10("?pqv")
v4("?ps1")
v7("?ps2")
v14("?s"):::projected
a3((" "))
a5((" "))
a1((" "))
a2((" "))
a4((" "))
a6((" "))
a7((" "))
c6(["wd:Q1206"]):::iri
c4(["wd:Q353027"]):::iri
c15(["bd:serviceParam"]):::iri
c17(["#91;AUTO_LANGUAGE#93;,en,de"]):::literal
bind0[/"?l"/]
v3 --o bind0
bind0 --as--o v2
v3 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c4
v3 --"p:direct/P131"--> c6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
a2 -->v4--> v5
a2 -."p:qualifier/P625".-> v6
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v3 --"p:P609"--> a2
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"p:P559"--> a2
end
union0r <== or ==> union0l
end
a3 --"wikibase:statementProperty"--> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
a4 -->v7--> v8
a4 -."p:qualifier/P131".-> v5
v3 -->v9--> a4
a5 --"wikibase:statementProperty"--> v7
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
a6 -->v7--> v8
a6 -->v1--> v10
v3 -->v9--> a6
a7 -."wikibase:statementProperty".-> v7
v11 --"wikibase:qualifier"--> v1
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:direct/P625".-> v6
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v3 -."p:direct/P18".-> v12
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c15 --"wikibase:language"--> c17
v8 --"rdfs:label"--> v13
v11 --"rdfs:label"--> v14
v10 --"rdfs:label"--> v15
v5 --"rdfs:label"--> v16
v2 --"rdfs:label"--> v17
end
bind1[/"concat(if(bound(?d),?d,''),if(bound(?s),concat(' ',?s),''),if(bound(?c),concat(' ',?c),''))"/]
v13 --o bind1
v14 --o bind1
v15 --o bind1
bind1 --as--o v18