query-ec58ed3469dc06bd3e0bbd67bb9aa745
Propertiesinstance of (P31)Swiss municipality code (P771)located in the administrative territorial entity (P131)ISO 3166-2 code (P300)
Use at
- https://query.wikidata.org/sparql
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#>
SELECT ?item ?FSO_code ?canton_ISO_code ?Label_en ?Label_de ?Label_fr ?Label_it WHERE {
{?item wdt:P31 wd:Q70208}.
{?item wdt:P771 ?FSO_code}.
OPTIONAL { ?item rdfs:label ?Label_en . FILTER (lang(?Label_en) = "en") }
OPTIONAL { ?item rdfs:label ?Label_de . FILTER (lang(?Label_de) = "de") }
OPTIONAL { ?item rdfs:label ?Label_fr . FILTER (lang(?Label_fr) = "fr") }
OPTIONAL { ?item rdfs:label ?Label_it . FILTER (lang(?Label_it) = "it") }
OPTIONAL { ?item wdt:P131/wdt:P300 ?canton_ISO_code }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?FSO_code"):::projected
v3("?Label_de"):::projected
v4("?Label_en"):::projected
v2("?Label_fr"):::projected
v1("?Label_it"):::projected
v7("?canton_ISO_code"):::projected
v5("?item"):::projected
a1((" "))
c6(["wd:Q70208"]):::iri
v5 --"wdt:P31"--> c6
v5 --"wdt:P771"--> v6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."rdfs:label".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v5 -."rdfs:label".-> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v5 -."rdfs:label".-> v2
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v5 -."rdfs:label".-> v1
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v5 -."wdt:P131".-> a1
a1 --"wdt:P300"--> v7
end