query-93d8e071560e813222a8933db6ee22ae
Alle Personen, die an COVID-19 verstorben sind SELECT ?person ?personLabel ?personDescription ?image ?date_birth ?date_death ?age WHERE { ?person wdt:P31 wd:Q5 . # Human ?person wdt:P570 ?date_death . # has date of death ?person wdt:P509 wd:Q84263196. # COVID-19 OPTIONAL { ?person wdt:P569 ?date_birth. } # get date of birth Bind ( round((?date_death - ?date_birth)/365.2425) as ?age ) # calculate age OPTIONAL { ?person wdt:P18 ?image . } # image SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en,[AUTO_LANGUAGE]" . } } order by ?age
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#>
# Alle Personen, die an COVID-19 verstorben sind
SELECT ?person ?personLabel ?personDescription ?image ?date_birth ?date_death ?age
WHERE
{
?person wdt:P31 wd:Q5 . # Human
?person wdt:P570 ?date_death . # has date of death
?person wdt:P509 wd:Q84263196. # COVID-19
OPTIONAL { ?person wdt:P569 ?date_birth. } # get date of birth
Bind ( round((?date_death - ?date_birth)/365.2425) as ?age ) # calculate age
OPTIONAL { ?person wdt:P18 ?image . } # image
SERVICE wikibase:label {
bd:serviceParam wikibase:language "de,en,[AUTO_LANGUAGE]" .
}
}
order by ?age
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?age"):::projected
v4("?date_birth"):::projected
v3("?date_death"):::projected
v5("?image"):::projected
v2("?person"):::projected
c5(["wd:Q84263196"]):::iri
c9(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
c11(["de,en,#91;AUTO_LANGUAGE#93;"]):::literal
v2 --"wdt:P31"--> c2
v2 --"wdt:P570"--> v3
v2 --"wdt:P509"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P569".-> v4
end
bind0[/"numeric-round(?date_death - ?date_birth / '365.2425^^xsd:decimal')"/]
v3 --o bind0
v4 --o bind0
bind0 --as--o v5
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P18".-> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end