query-6906c716010f3dc9ff03c0ae3807aa41
Municipalities colour-coded by rising or falling population between 1930 and 1950
Use at
- https://query.wikidata.org/sparql
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/>
# Municipalities colour-coded by rising or falling population between 1930 and 1950
#defaultView:Map{"hide":["?coord"]}
SELECT ?item ?coord ?populace1930 ?populace2001 ?prirustek (IF(?prirustek > 1, CONCAT(">", STR(IF(?prirustek > 4, 4, FLOOR(?prirustek))), "x"), "prirustek") AS ?layer) WHERE {
?item wdt:P31 wd:Q5153359; wdt:P625 ?coord .
?item p:P1082 [ ps:P1082 ?populace1930; pq:P585 ?datum1930 ] .
FILTER (YEAR(?datum1930) = 1930) .
?item p:P1082 [ ps:P1082 ?populace2001; pq:P585 ?datum2001 ] .
FILTER (YEAR(?datum2001) = 1950) .
BIND ( ?populace1930 / ?populace2001 AS ?prirustek ) .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?coord"):::projected
v2("?datum1930")
v1("?datum2001")
v3("?item"):::projected
v8("?layer")
v5("?populace1930"):::projected
v6("?populace2001"):::projected
v7("?prirustek"):::projected
a1((" "))
a2((" "))
c4(["wd:Q5153359"]):::iri
f0[["year-from-dateTime(?datum2001) = '1950^^xsd:integer'"]]
f0 --> v1
f1[["year-from-dateTime(?datum1930) = '1930^^xsd:integer'"]]
f1 --> v2
v3 --"p:direct/P31"--> c4
v3 --"p:direct/P625"--> v4
a1 --"p:statement/P1082"--> v5
a1 --"p:qualifier/P585"--> v2
v3 --"p:P1082"--> a1
a2 --"p:statement/P1082"--> v6
a2 --"p:qualifier/P585"--> v1
v3 --"p:P1082"--> a2
bind2[/"?populace1930 / ?populace2001"/]
v5 --o bind2
v6 --o bind2
bind2 --as--o v7
bind3[/"if(?prirustek > '1^^xsd:integer',concat('>',str(if(?prirustek > '4^^xsd:integer','4^^xsd:integer',numeric-floor(?prirustek))),'x'),'prirustek')"/]
v7 --o bind3
bind3 --as--o v8