query-4aed025d0afa9a2a4453bfe4f07bc7b7
TODO
Use at
- https://query.wikidata.org/sparql
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 pqv: <http://www.wikidata.org/prop/qualifier/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?place ?placeLabel ?populationLabel ?populationDate ?precision ?date WHERE {
?place wdt:P131 wd:Q835108;
p:P1082 ?place_statement.
?place_statement ps:P1082 ?population;
pqv:P585 [
wikibase:timePrecision ?precision;
wikibase:timeValue ?populationDate ].
BIND(IF(?precision=9,YEAR(?populationDate),"") as ?date)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY (?place) (?populationDate)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?date"):::projected
v1("?place"):::projected
v3("?place_statement")
v4("?population")
v2("?populationDate"):::projected
v5("?precision"):::projected
a1((" "))
c2(["wd:Q835108"]):::iri
c9(["bd:serviceParam"]):::iri
c11(["en"]):::literal
v1 --"p:direct/P131"--> c2
v1 --"p:P1082"--> v3
v3 --"p:statement/P1082"--> v4
a1 --"wikibase:timePrecision"--> v5
a1 --"wikibase:timeValue"--> v2
v3 --"p:qualifier/value/P585"--> a1
bind0[/"if(?precision = '9^^xsd:integer',year-from-dateTime(?populationDate),'')"/]
v5 --o bind0
v2 --o bind0
bind0 --as--o v6
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end