query-c2af920d3fe03f57fd2ea23567fccece
MRC et TE du Québec SELECT DISTINCT ?item ?itemLabel ?statutLabel ?regionLabel WHERE { { ?item wdt:P31 wd:Q204613 } UNION { ?item wdt:P31 wd:Q3518817 } ?item wdt:P131 ?region . ?item wdt:P31 ?statut . FILTER NOT EXISTS { ?item p:P131 [ pq:P582 ?pqfin ] } SERVICE wikibase:label { bd:serviceParam wikibase:language "fr" } } ORDER BY ?regionLabel ?itemLabel LIMIT 200
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# MRC et TE du Québec
SELECT DISTINCT ?item ?itemLabel ?statutLabel ?regionLabel
WHERE
{
{ ?item wdt:P31 wd:Q204613 } UNION { ?item wdt:P31 wd:Q3518817 }
?item wdt:P131 ?region .
?item wdt:P31 ?statut .
FILTER NOT EXISTS { ?item p:P131 [ pq:P582 ?pqfin ] }
SERVICE wikibase:label {
bd:serviceParam wikibase:language "fr"
}
}
ORDER BY ?regionLabel ?itemLabel
LIMIT 200
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?item"):::projected
v2("?itemLabel"):::projected
v3("?pqfin")
v5("?region")
v1("?regionLabel"):::projected
v6("?statut")
a1((" "))
c8(["bd:serviceParam"]):::iri
c5(["wd:Q3518817"]):::iri
c4(["wd:Q204613"]):::iri
c10(["fr"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0a1 --"p:qualifier/P582"--> e0v1
e0v2 --"p:P131"--> e0a1
e0v2("?item"):::projected
e0v1("?pqfin"):::projected
e0a1((" ")):::projected
end
f0--EXISTS--> f0e0
f0 --> a1
f0 --> c1
f0 --> v3
f0 --> v4
f0 --> c2
a1 --"p:qualifier/P582"--> v3
v4 --"p:P131"--> a1
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v4 --"p:direct/P31"--> c5
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v4 --"p:direct/P31"--> c4
end
union0r <== or ==> union0l
end
v4 --"p:direct/P131"--> v5
v4 --"p:direct/P31"--> v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end