query-6fea1946d0b80bac86c0f2eea719c224
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 ?code ?item ?itemLabel ?population ?date
WHERE {
?item wdt:P3856 ?code .
?item p:P1082 [ ps:P1082 ?population; pq:P459 wd:Q29051383; pq:P585 ?date ] .
FILTER (?date >= "2020-01-01T00:00:00Z"^^xsd:dateTime )
FILTER NOT EXISTS { ?item p:P31 [ pq:P582 ?pqend ] }
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
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?code"):::projected
v6("?date"):::projected
v3("?dissoldt")
v4("?enddt")
v2("?item"):::projected
v7("?population"):::projected
v5("?pqend")
a2((" "))
a1((" "))
c15(["en,fr"]):::literal
c9(["wd:Q29051383"]):::iri
c13(["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[["not "]]
subgraph f2e2["Exists Clause"]
e2a1 --"p:qualifier/P582"--> e2v1
e2v2 --"p:P31"--> e2a1
e2v2("?item"):::projected
e2v1("?pqend"):::projected
e2a1((" ")):::projected
end
f2--EXISTS--> f2e2
f2 --> a1
f2 --> c3
f2 --> v5
f2 --> v2
f2 --> c4
a1 --"p:qualifier/P582"--> v5
v2 --"p:P31"--> a1
f3[["?date >= '2020-01-01T00:00:00Z^^xsd:dateTime'"]]
f3 --> v6
v2 --"p:direct/P3856"--> v1
a2 --"p:statement/P1082"--> v7
a2 --"p:qualifier/P459"--> c9
a2 --"p:qualifier/P585"--> v6
v2 --"p:P1082"--> a2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c13 --"wikibase:language"--> c15
end