query-b5ad7f0984343f4c4a2d6ca9aac30204
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?causeOfDeath ?causeOfDeathLabel ?count
WHERE
{
{
SELECT ?causeOfDeath (COUNT(?item) as ?count)
WHERE
{
?item wdt:P31 wd:Q5;
wdt:P509 ?causeOfDeath_.
BIND (IF(wikibase:isSomeValue(?causeOfDeath_), "Some value", ?causeOfDeath_) AS ?causeOfDeath)
}
GROUP BY ?causeOfDeath
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?causeOfDeath"):::projected
v2("?causeOfDeath_")
v4("?count"):::projected
v1("?item")
c5(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v1 --"wdt:P31"--> c2
v1 --"wdt:P509"--> v2
bind0[/"if(http://wikiba.se/ontology#isSomeValue(?causeOfDeath_),'Some value',?causeOfDeath_)"/]
v2 --o bind0
bind0 --as--o v3
bind2[/"count(?item)"/]
v1 --o bind2
bind2 --as--o v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end