query-0f3eeee56d5d36350fff2869753bdf34
Cantonal Authorities The query returns cantonal authorities which are linked to the respective cantonal government through one or several parental relationships.
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#>
SELECT ?item ?itemLabel ?jurisdictionLabel ?parentLabel ?grandparentLabel WHERE {
?item wdt:P749* ?regionalgov .
?regionalgov wdt:P31/wdt:P279* wd:Q1802419 .
?regionalgov wdt:P17 wd:Q39 .
OPTIONAL { ?item wdt:P749 ?parent. }
OPTIONAL { ?item wdt:P749/wdt:P749 ?grandparent. }
OPTIONAL { ?item wdt:P1001 ?jurisdiction. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "de, fr, it, en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?grandparent")
v1("?item"):::projected
v5("?jurisdiction")
v3("?parent")
v2("?regionalgov")
a1((" "))
a2((" "))
c6(["wd:Q39"]):::iri
c9(["bd:serviceParam"]):::iri
c11(["de, fr, it, en"]):::literal
c4(["wd:Q1802419"]):::iri
v1 --"wdt:P749"--> v2
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c4
v2 --"wdt:P17"--> c6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P749".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P749".-> a2
a2 --"wdt:P749"--> v4
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P1001".-> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end