query-512313ea43861a757a5f66007571d0fa
Image grid of individuals who have been diagnosed with COVID-19 ordered by Wikidata item completeness
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
#defaultView:ImageGrid
SELECT ?person ?person_label (GROUP_CONCAT(?country_of_citizenship_label; separator=";") AS ?countries_of_citizenship) ?image ?rank
WHERE {
?person wdt:P1050 wd:Q84263196; wdt:P31 wd:Q5 .
OPTIONAL { ?person rdfs:label ?person_label . FILTER(LANG(?person_label) = "en")}
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:P18 ?image }
OPTIONAL { ?person wdt:P27 ?country_of_citizenship . ?country_of_citizenship rdfs:label ?country_of_citizenship_label . FILTER(LANG(?country_of_citizenship_label) = "en")}
}
GROUP BY ?person ?person_label ?image ?rank
ORDER BY DESC(?rank)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v10("?countries_of_citizenship")
v9("?country_of_citizenship")
v2("?country_of_citizenship_label"):::projected
v7("?identifiers_count")
v8("?image"):::projected
v4("?person"):::projected
v3("?person_label"):::projected
v8("?rank"):::projected
v6("?sitelinks_count")
v5("?statements_count")
c3(["wd:Q84263196"]):::iri
c5(["wd:Q5"]):::iri
v4 --"wdt:P1050"--> c3
v4 --"wdt:P31"--> c5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v4 -."rdfs:label".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wikibase:statements".-> v5
v4 --"wikibase:sitelinks"--> v6
v4 --"wikibase:identifiers"--> v7
bind0[/"?statements_count + ?sitelinks_count + ?identifiers_count"/]
v5 --o bind0
v6 --o bind0
v7 --o bind0
bind0 --as--o v8
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P18".-> v8
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v4 -."wdt:P27".-> v9
v9 --"rdfs:label"--> v2
end
bind2[/"?country_of_citizenship_label"/]
v2 --o bind2
bind2 --as--o v10