query-c7f7bf69c51ea644da55a28f43107fda
Propertiesinstance of (P31)subclass of (P279)located in the administrative territorial entity (P131)
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 ?commune ?communeLabel ?region ?regionLabel
WHERE {
?commune wdt:P31/wdt:P279* wd:Q484170 . # commune
FILTER ( ?commune != wd:Q90 ) # qui n'est pas Paris
?commune wdt:P131 ?region . # qui est dans une entité administrative
?region wdt:P31/wdt:P279* wd:Q36784 . # qui est une région…
FILTER NOT EXISTS { ?region wdt:P31/wdt:P279* ?collectivite . VALUES ?collectivite { wd:Q202216 wd:Q719487 } } # …mais n'est pas un DOM/COM
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;
v3("?collectivite")
v3("?commune"):::projected
v1("?region"):::projected
a2((" "))
a3((" "))
a1((" "))
c6(["wd:Q36784"]):::iri
c8(["bd:serviceParam"]):::iri
c10(["fr"]):::literal
c4(["wd:Q484170"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P31"--> e0a1
e0a1 --"wdt:P279"--> e0v3
bind0[/VALUES ?collectivite/]
bind0-->e0v3
bind00(["wd:Q202216"])
bind00 --> bind0
bind01(["wd:Q719487"])
bind01 --> bind0
e0v3("?collectivite"):::projected
e0v1("?region"):::projected
e0a1((" ")):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> a1
f0 --> c2
f0 --> v3
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> v3
bind1[/VALUES ?collectivite/]
bind1-->v3
bind10(["wd:Q202216"])
bind10 --> bind1
bind11(["wd:Q719487"])
bind11 --> bind1
f2[["?commune != 'wd:Q90'"]]
f2 --> v3
v3 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c4
v3 --"wdt:P131"--> v1
v1 --"wdt:P31"--> a3
a3 --"wdt:P279"--> c6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end