query-1f64b9b246fc434be17df1a6d2bb3e04
Rechts- und Linksverkehr
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 bd: <http://www.bigdata.com/rdf#>
#defaultView:Map{"hide":["?shape", "?rgb"]}
SELECT ?pLabel ?sideLabel ?shape ?rgb WHERE {
OPTIONAL { ?p wdt:P1622 ?side } # driving side
OPTIONAL { ?p wdt:P3896 ?shape } # geoshape
BIND ( COALESCE(
IF(?side = wd:Q14565199, "0066B4", 1/0), # blue
IF(?side = wd:Q13196750, "F5831A", 1/0), # orange
"000000"
) AS ?rgb )
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;
v1("?p")
v4("?rgb"):::projected
v3("?shape"):::projected
v2("?side")
c4(["bd:serviceParam"]):::iri
c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P1622".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P3896".-> v3
end
bind0[/"if(?side = 'wd:Q14565199','0066B4','1^^xsd:integer' / '0^^xsd:integer')if(?side = 'wd:Q13196750','F5831A','1^^xsd:integer' / '0^^xsd:integer')'000000'"/]
v2 --o bind0
bind0 --as--o v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
end