query-be463ba8e5552e1d3b61682b0996499e
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 {
?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 . }
FILTER NOT EXISTS { ?item wdt:P31 wd:Q902814 }
FILTER NOT EXISTS { ?item wdt:P31 wd:Q1637706 }
FILTER NOT EXISTS { ?item wdt:P31 wd:Q188443 }
FILTER NOT EXISTS { ?item wdt:P31 wd:Q200250 }
FILTER NOT EXISTS { ?item wdt:P31 wd:Q1665321 }
# FILTER NOT EXISTS { ?item wdt:P31 wd:Q171441 }
FILTER NOT EXISTS { ?item wdt:P31 wd:Q1549591 }
FILTER NOT EXISTS { ?item wdt:P31 wd:Q3518817 }
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((" "))
c6(["wd:Q188443"]):::iri
c23(["bd:serviceParam"]):::iri
c3(["wd:Q1549591"]):::iri
c14(["wd:Q81063407"]):::iri
c5(["wd:Q200250"]):::iri
c7(["wd:Q1637706"]):::iri
c25(["en,fr"]):::literal
c19(["wd:Q29051383"]):::iri
c8(["wd:Q902814"]):::iri
c2(["wd:Q3518817"]):::iri
c4(["wd:Q1665321"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"p:direct/P31"--> e0c2
e0v1("?item"):::projected
e0c2(["wd:Q3518817"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> c2
v1 --"p:direct/P31"--> c2
f1[["not "]]
subgraph f1e1["Exists Clause"]
e1v1 --"p:direct/P31"--> e1c2
e1v1("?item"):::projected
e1c2(["wd:Q1549591"]):::iri
end
f1--EXISTS--> f1e1
f1 --> v1
f1 --> c1
f1 --> c3
v1 --"p:direct/P31"--> c3
f2[["not "]]
subgraph f2e2["Exists Clause"]
e2v1 --"p:direct/P31"--> e2c2
e2v1("?item"):::projected
e2c2(["wd:Q1665321"]):::iri
end
f2--EXISTS--> f2e2
f2 --> v1
f2 --> c1
f2 --> c4
v1 --"p:direct/P31"--> c4
f3[["not "]]
subgraph f3e3["Exists Clause"]
e3v1 --"p:direct/P31"--> e3c2
e3v1("?item"):::projected
e3c2(["wd:Q200250"]):::iri
end
f3--EXISTS--> f3e3
f3 --> v1
f3 --> c1
f3 --> c5
v1 --"p:direct/P31"--> c5
f4[["not "]]
subgraph f4e4["Exists Clause"]
e4v1 --"p:direct/P31"--> e4c2
e4v1("?item"):::projected
e4c2(["wd:Q188443"]):::iri
end
f4--EXISTS--> f4e4
f4 --> v1
f4 --> c1
f4 --> c6
v1 --"p:direct/P31"--> c6
f5[["not "]]
subgraph f5e5["Exists Clause"]
e5v1 --"p:direct/P31"--> e5c2
e5v1("?item"):::projected
e5c2(["wd:Q1637706"]):::iri
end
f5--EXISTS--> f5e5
f5 --> v1
f5 --> c1
f5 --> c7
v1 --"p:direct/P31"--> c7
f6[["not "]]
subgraph f6e6["Exists Clause"]
e6v1 --"p:direct/P31"--> e6c2
e6v1("?item"):::projected
e6c2(["wd:Q902814"]):::iri
end
f6--EXISTS--> f6e6
f6 --> v1
f6 --> c1
f6 --> c8
v1 --"p:direct/P31"--> c8
f7[["not "]]
subgraph f7e7["Exists Clause"]
e7v1 --"p:direct/P576"--> e7v2
e7v2("?dissoldt"):::projected
e7v1("?item"):::projected
end
f7--EXISTS--> f7e7
f7 --> v1
f7 --> c9
f7 --> v2
v1 --"p:direct/P576"--> v2
f8[["not "]]
subgraph f8e8["Exists Clause"]
e8v1 --"p:direct/P582"--> e8v2
e8v2("?enddt"):::projected
e8v1("?item"):::projected
end
f8--EXISTS--> f8e8
f8 --> v1
f8 --> c10
f8 --> v3
v1 --"p:direct/P582"--> v3
f9[["?date >= '2019-01-01T00:00:00Z^^xsd:dateTime'"]]
f9 --> v4
f10[["not "]]
subgraph f10e9["Exists Clause"]
e9v1 --"p:qualifier/P582"--> e9v2
e9v2("?dtend"):::projected
e9v1("?statut_statement"):::projected
end
f10--EXISTS--> f10e9
f10 --> v5
f10 --> c12
f10 --> v6
v5 --"p:qualifier/P582"--> v6
v1 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c14
v1 --"p:direct/P31"--> v7
v1 --"p:P31"--> v5
v1 --"p:direct/P3856"--> v8
a2 --"p:statement/P1082"--> v9
a2 --"p:qualifier/P459"--> c19
a2 --"p:qualifier/P585"--> v4
v1 --"p:P1082"--> a2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c23 --"wikibase:language"--> c25
end