query-b073e937fe00e0ff100a5fa7971944ff
Municipalités du Québec. SELECT DISTINCT ?item ?code ?itemLabel ?adminLabel ?pop ?sup ?geo WHERE { ?item wdt:P3856 ?code . ?item wdt:P131 ?admin . ?item p:P1082 [ ps:P1082 ?population; pq:P459 wd:Q29051383; pq:P585 ?date ] . FILTER (?date >= "2020-00-00T00:00:00Z"^^xsd:dateTime) ?item wdt:P2046 ?sup . ?item wdt:P625 ?geo . FILTER NOT EXISTS { ?item wdt:P582 ?enddt . } FILTER NOT EXISTS { ?item wdt:P576 ?dissoldt . } SERVICE wikibase:label { bd:serviceParam wikibase:language 'en,fr'. } . } ORDER BY ?code LIMIT 1500
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Municipalités du Québec.
SELECT DISTINCT ?item ?code ?itemLabel ?adminLabel ?pop ?sup ?geo
WHERE {
?item wdt:P3856 ?code .
?item wdt:P131 ?admin .
?item p:P1082 [ ps:P1082 ?population; pq:P459 wd:Q29051383; pq:P585 ?date ] .
FILTER (?date >= "2020-00-00T00:00:00Z"^^xsd:dateTime)
?item wdt:P2046 ?sup .
?item wdt:P625 ?geo .
FILTER NOT EXISTS { ?item wdt:P582 ?enddt . }
FILTER NOT EXISTS { ?item wdt:P576 ?dissoldt . }
SERVICE wikibase:label { bd:serviceParam wikibase:language 'en,fr'. } .
}
ORDER BY ?code
LIMIT 1500
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?admin")
v1("?code"):::projected
v5("?date")
v3("?dissoldt")
v4("?enddt")
v9("?geo"):::projected
v2("?item"):::projected
v7("?population")
v8("?sup"):::projected
a1((" "))
c16(["en,fr"]):::literal
c8(["wd:Q29051383"]):::iri
c14(["bd:serviceParam"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:direct/P576"--> e0v2
e0v2("?dissoldt"):::projected
e0v1("?item"):::projected
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> c1
f0 --> v3
v2 --"p:direct/P576"--> v3
f1[["not "]]
subgraph f1e1["Exists Clause"]
e1v1 --"p:direct/P582"--> e1v2
e1v2("?enddt"):::projected
e1v1("?item"):::projected
end
f1--EXISTS--> f1e1
f1 --> v2
f1 --> c2
f1 --> v4
v2 --"p:direct/P582"--> v4
f2[["?date >= '2020-00-00T00:00:00Z^^xsd:dateTime'"]]
f2 --> v5
v2 --"p:direct/P3856"--> v1
v2 --"p:direct/P131"--> v6
a1 --"p:statement/P1082"--> v7
a1 --"p:qualifier/P459"--> c8
a1 --"p:qualifier/P585"--> v5
v2 --"p:P1082"--> a1
v2 --"p:direct/P2046"--> v8
v2 --"p:direct/P625"--> v9
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c14 --"wikibase:language"--> c16
end