query-ffe1f5b1636c3bba96ced1e654afe17b
ValterVB
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 DISTINCT ?item ?itemLabel ?lev ?levLabel ?tipoLev ?tipoLevLabel
WHERE {
VALUES ?item { wd:Q193812 } #common item
{ ?item wdt:P7938 ?lev. }
UNION
{ ?item wdt:P131+ ?lev. }
?lev wdt:P31 ?tipoLev.
FILTER (?tipoLev in (wd:Q36784,wd:Q6465,wd:Q194203,wd:Q18524218)) #region, departement, arrondissement, canton
SERVICE wikibase:label { bd:serviceParam wikibase:language "fr". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v3("?lev"):::projected
v1("?tipoLev"):::projected
c9(["bd:serviceParam"]):::iri
c11(["fr"]):::literal
list0c1(["wd:Q36784"]):::iri
list0c4(["wd:Q18524218"]):::iri
list0c2(["wd:Q6465"]):::iri
list0c3(["wd:Q194203"]):::iri
list0c1 --o f0
list0c2 --o f0
list0c3 --o f0
list0c4 --o f0
f0[[" in "]]
f0 --> v1
bind1[/VALUES ?item/]
bind1-->v2
bind10(["wd:Q193812"])
bind10 --> bind1
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P131"--> v3
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v2 --"wdt:P7938"--> v3
end
union0r <== or ==> union0l
end
v3 --"wdt:P31"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end