query-6d0eff581fd8c2e59d88382c414a9ea9

rq turtle/ttl

Image grid of individuals who have died from COVID-19 ordered by Wikidata item completeness

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
#defaultView:ImageGrid
SELECT ?person ?date_of_death ?age ?image
WHERE {
    ?person wdt:P509 wd:Q84263196 ; wdt:P31 wd:Q5 
    OPTIONAL { ?person wdt:P570 ?date_of_death }
    OPTIONAL { ?person wikibase:statements ?statements_count ; wikibase:sitelinks ?sitelinks_count ; wikibase:identifiers ?identifiers_count . BIND(?statements_count + ?sitelinks_count + ?identifiers_count AS ?rank)}
    OPTIONAL { ?person wdt:P569 ?dob ; wdt:P570 ?dod . BIND(YEAR(?dod)-YEAR(?dob) as ?age) }
    OPTIONAL { ?person wdt:P18 ?image }
}
ORDER BY DESC(?rank)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v9("?age"):::projected v3("?date_of_death"):::projected v7("?dob") v8("?dod") v6("?identifiers_count") v10("?image"):::projected v2("?person"):::projected v7("?rank") v5("?sitelinks_count") v4("?statements_count") c2(["wd:Q84263196"]):::iri c4(["wd:Q5"]):::iri v2 --"wdt:P509"--> c2 v2 --"wdt:P31"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P570".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wikibase:statements".-> v4 v2 --"wikibase:sitelinks"--> v5 v2 --"wikibase:identifiers"--> v6 bind0[/"?statements_count + ?sitelinks_count + ?identifiers_count"/] v4 --o bind0 v5 --o bind0 v6 --o bind0 bind0 --as--o v7 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P569".-> v7 v2 --"wdt:P570"--> v8 bind1[/"year-from-dateTime(?dod) - year-from-dateTime(?dob)"/] v8 --o bind1 v7 --o bind1 bind1 --as--o v9 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P18".-> v10 end