query-c2a5ff51c112b59e9d8d01d6cc18a8cd
Am 17. April 2023 war es dann endlich so weit und die 10784 deutschen Gemeinden, um die es hier geht, haben die Einwohnerdaten eingetragen.
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
PREFIX v: <http://www.wikidata.org/prop/statement/>
SELECT ?muni ?key ?muniLabel ?population ?male ?female ?instanceLabel ?rank WHERE {
BIND("2021-12-31"^^xsd:date AS ?popDay) .
BIND("2022-12-31"^^xsd:date AS ?muniDay) .
VALUES ?instance {wd:Q116457956 wd:Q42744322} .
?muni p:P31 ?instanceBlock .
?instanceBlock v:P31 ?instance .
FILTER NOT EXISTS {?instanceBlock pq:P580 ?start FILTER(?start > ?muniDay)} .
FILTER NOT EXISTS {?instanceBlock pq:P582 ?end FILTER(?end < ?muniDay)} .
?muni wdt:P439 ?key .
?muni p:P1082 ?populationBlock .
?populationBlock v:P1082 ?population .
?populationBlock pq:P1540 ?male .
?populationBlock pq:P1539 ?female .
?populationBlock wikibase:rank ?rank .
?populationBlock pq:P585 ?popDay
SERVICE wikibase:label{bd:serviceParam wikibase:language "de"}
}
ORDER BY ?key
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?end")
v12("?female"):::projected
v7("?instance")
v4("?instanceBlock")
v1("?key"):::projected
v11("?male"):::projected
v8("?muni"):::projected
v7("?muniDay")
v6("?popDay")
v10("?population"):::projected
v9("?populationBlock")
v13("?rank"):::projected
v5("?start")
c15(["de"]):::literal
c13(["bd:serviceParam"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0f0[["?end < ?muniDay"]]
e0f0 --> e0v1
e0f0 --> e0v2
e0v3 --"p:qualifier/P582"--> e0v1
e0v1("?end"):::projected
e0v3("?instanceBlock"):::projected
e0v2("?muniDay"):::projected
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> v7
f0 --> v4
f0 --> c1
f1[["?end < ?muniDay"]]
f1 --> v2
f1 --> v7
v4 --"p:qualifier/P582"--> v2
f2[["not "]]
subgraph f2e1["Exists Clause"]
e1f0[["?start > ?muniDay"]]
e1f0 --> e1v1
e1f0 --> e1v2
e1v3 --"p:qualifier/P580"--> e1v1
e1v3("?instanceBlock"):::projected
e1v2("?muniDay"):::projected
e1v1("?start"):::projected
end
f2--EXISTS--> f2e1
f2 --> v5
f2 --> v7
f2 --> v4
f2 --> c2
f3[["?start > ?muniDay"]]
f3 --> v5
f3 --> v7
v4 --"p:qualifier/P580"--> v5
bind4[/"'2021-12-31^^xsd:date'"/]
bind4 --as--o v6
bind5[/"'2022-12-31^^xsd:date'"/]
bind5 --as--o v7
bind6[/VALUES ?instance/]
bind6-->v7
bind60(["wd:Q116457956"])
bind60 --> bind6
bind61(["wd:Q42744322"])
bind61 --> bind6
v8 --"p:P31"--> v4
v4 --"p:statement/P31"--> v7
v8 --"p:direct/P439"--> v1
v8 --"p:P1082"--> v9
v9 --"p:statement/P1082"--> v10
v9 --"p:qualifier/P1540"--> v11
v9 --"p:qualifier/P1539"--> v12
v9 --"wikibase:rank"--> v13
v9 --"p:qualifier/P585"--> v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c13 --"wikibase:language"--> c15
end