query-21f81c565dd1372685026d0dab1510b5
Theklan
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?year ?label (SUM(?count) AS ?total) WHERE {
{
SELECT ?name ?date (COUNT(DISTINCT ?human) AS ?count) WHERE {
?human wdt:P31 wd:Q5;
wdt:P27 wd:Q183;
wdt:P569 ?date;
wdt:P735 ?name.
MINUS { ?human wdt:P570 ?died. }
}
GROUP BY ?name ?date
}
?name wdt:P1705 ?label.
BIND(YEAR(?date) AS ?year)
}
GROUP BY ?year ?label
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?count"):::projected
v2("?date")
v4("?died")
v1("?human")
v6("?label"):::projected
v3("?name")
v8("?total")
v7("?year"):::projected
c2(["wd:Q5"]):::iri
c4(["wd:Q183"]):::iri
v1 --"wdt:P31"--> c2
v1 --"wdt:P27"--> c4
v1 --"wdt:P569"--> v2
v1 --"wdt:P735"--> v3
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v1 --"wdt:P570"--> v4
end
bind2[/"count(?human)"/]
v1 --o bind2
bind2 --as--o v5
v3 --"wdt:P1705"--> v6
bind3[/"year-from-dateTime(?date)"/]
v2 --o bind3
bind3 --as--o v7
bind5[/"sum(?count)"/]
v5 --o bind5
bind5 --as--o v8