query-c7eff9cd66eef30fd84628c02d7de31c
TODO
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#>
SELECT DISTINCT ?item ?code ?itemLabel ?statutLabel ?population
WHERE { {
SELECT DISTINCT ?item ?code ?itemLabel ?statutLabel ?population
WHERE {
?item wdt:P31/wdt:P279* wd:Q81063407 .
?item wdt:P31 ?statut .
?item p:P31 ?statut_statement .
FILTER NOT EXISTS { ?statut_statement pq:P582 ?dtend . }
?item wdt:P3856 ?code .
?item p:P1082 [ ps:P1082 ?population; pq:P459 wd:Q29051383; pq:P585 ?date ] .
FILTER (?date >= "2019-01-01T00:00:00Z"^^xsd:dateTime )
FILTER NOT EXISTS { ?item wdt:P582 ?enddt . }
FILTER NOT EXISTS { ?item wdt:P576 ?dissoldt . }
SERVICE wikibase:label { bd:serviceParam wikibase:language 'en,fr'. } .
} }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v8("?code"):::projected
v4("?date")
v2("?dissoldt")
v6("?dtend")
v3("?enddt")
v1("?item"):::projected
v9("?population"):::projected
v7("?statut")
v5("?statut_statement")
a1((" "))
a2((" "))
c18(["en,fr"]):::literal
c12(["wd:Q29051383"]):::iri
c16(["bd:serviceParam"]):::iri
c7(["wd:Q81063407"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:direct/P576"--> e0v2
e0v2("?dissoldt"):::projected
e0v1("?item"):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> v2
v1 --"p:direct/P576"--> v2
f1[["not "]]
subgraph f1e1["Exists Clause"]
e1v1 --"p:direct/P582"--> e1v2
e1v2("?enddt"):::projected
e1v1("?item"):::projected
end
f1--EXISTS--> f1e1
f1 --> v1
f1 --> c2
f1 --> v3
v1 --"p:direct/P582"--> v3
f2[["?date >= '2019-01-01T00:00:00Z^^xsd:dateTime'"]]
f2 --> v4
f3[["not "]]
subgraph f3e2["Exists Clause"]
e2v1 --"p:qualifier/P582"--> e2v2
e2v2("?dtend"):::projected
e2v1("?statut_statement"):::projected
end
f3--EXISTS--> f3e2
f3 --> v5
f3 --> c4
f3 --> v6
v5 --"p:qualifier/P582"--> v6
v1 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c7
v1 --"p:direct/P31"--> v7
v1 --"p:P31"--> v5
v1 --"p:direct/P3856"--> v8
a2 --"p:statement/P1082"--> v9
a2 --"p:qualifier/P459"--> c12
a2 --"p:qualifier/P585"--> v4
v1 --"p:P1082"--> a2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c16 --"wikibase:language"--> c18
end