query-13ff2c7c41333944cf643962c51ff5c6

rq turtle/ttl

(35) Map of deaths from Wuhan pneumonia (COVID-19): birth/death/nationality locationsNo.35 (2020.03.08T1443 created)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# people who died from Wuhan pneumonia (COVID-19)
# querying qualifier
# viewed as map of birth/death/nationality locations, with ?edgeLabel as layer
# also viewable as table and graph
#defaultView:Map{"layer":"?edgeLabel"}
SELECT DISTINCT ?patient ?patientLabel ?image ?birth_date ?disease_start ?death_date ?x ?xLabel ?edgeLabel ?coord
WHERE {
  # ?patient is instance of (P31) human (Q5)
  ?patient wdt:P31 wd:Q5;
  # ?patient's cause of death (P509) is COVID-19 (Q84263196)
           wdt:P509 wd:Q84263196.
  # optional: show ?patient's image (P18) as ?image
  OPTIONAL {?patient wdt:P18 ?image}
  # optional: show ?patient's birth date (P569) as ?birth_date
  OPTIONAL {?patient wdt:P569 ?birth_date}
  # optional: show ?patient's start time (P580) of COVID-19 (Q84263196) as ?disease_start by
  # defining ?patient's "medical condition" (P1050) statement as ?COVID19
  OPTIONAL {?patient p:P1050 ?COVID19.
            # and defining ?COVID19's value as COVID-19 (Q84263196)
            ?COVID19 ps:P1050 wd:Q84263196;
            # and defining ?COVID19's qualifier "start time" (P580) as ?disease_start
                     pq:P580 ?disease_start}
  # optional: show ?patient's death date (P570) as ?death_date
  OPTIONAL {?patient wdt:P570 ?death_date}
  # optional: show ?patient's birth place (P19) or death place (P20) or nationality (P27) or occupation (P106) as ?x
  OPTIONAL {?patient (wdt:P19|wdt:P20|wdt:P27|wdt:P106) ?x
            # optional: show ?x's coordinate location (P625) as ?coord
             OPTIONAL {?x wdt:P625 ?coord}
            # To avoid showing any other relation
            # define ?relation as birth place (P19) or death place (P20) or nationality (P27) or occupation (P106)
             VALUES ?relation {wdt:P19 wdt:P20 wdt:P27 wdt:P106}
            # ?relation is from ?patient to ?x
            ?patient ?relation ?x.
            # get ?relation's property label and allow it to appear on graph edge
            ?edge wikibase:directClaim ?relation;
               a wikibase:Property}
  # show label in auto language as default, and English when no default label exists
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
# order layer by ?edgeLabel
ORDER BY ?edgeLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?COVID19") v4("?birth_date"):::projected v11("?coord"):::projected v7("?death_date"):::projected v6("?disease_start"):::projected v10("?edge") v1("?edgeLabel"):::projected v3("?image"):::projected v2("?patient"):::projected v9("?relation") v8("?x"):::projected c4(["wd:Q84263196"]):::iri c17(["wikibase:Property"]):::iri c20(["bd:serviceParam"]):::iri c2(["wd:Q5"]):::iri c22(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"p:direct/P31"--> c2 v2 --"p:direct/P509"--> c4 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P18".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P569".-> v4 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P1050".-> v5 v5 --"p:statement/P1050"--> c4 v5 --"p:qualifier/P580"--> v6 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P570".-> v7 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; v2 -."p:direct/P106".-> v8 end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P27"--> v8 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P20"--> v8 end union1r <== or ==> union1l end end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"p:direct/P19"--> v8 end union0r <== or ==> union0l end bind0[/VALUES ?relation/] bind0-->v9 bind00(["p:direct/P19"]) bind00 --> bind0 bind01(["p:direct/P20"]) bind01 --> bind0 bind02(["p:direct/P27"]) bind02 --> bind0 bind03(["p:direct/P106"]) bind03 --> bind0 v2 -->v9--> v8 v10 --"wikibase:directClaim"--> v9 v10 --"a"--> c17 subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v8 -."p:direct/P625".-> v11 end end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c20 --"wikibase:language"--> c22 end