query-5d41a6f1ddbddc2d73285c20a3eb9eda

rq turtle/ttl

Disasters by location and disaster type, with number of casualties

Use at

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#>
#defaultView:Map{"layer":"?typeLabel"}
SELECT ?item ?itemLabel ?geo ?type ?typeLabel ?casualties (SAMPLE(?_image) AS ?image) WHERE {
  ?type wdt:P279* wd:Q3839081 .
  ?item wdt:P31 ?type ;
        wdt:P1120 ?casualties ;
        wdt:P625 ?geo .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  OPTIONAL { ?item wdt:P18 ?_image }
}
GROUP BY ?item ?itemLabel ?geo ?type ?typeLabel ?casualties

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?_image"):::projected v3("?casualties"):::projected v4("?geo"):::projected v6("?image") v2("?item"):::projected v1("?type"):::projected c7(["bd:serviceParam"]):::iri c9(["#91;AUTO_LANGUAGE#93;,en"]):::literal c2(["wd:Q3839081"]):::iri v1 --"wdt:P279"--> c2 v2 --"wdt:P31"--> v1 v2 --"wdt:P1120"--> v3 v2 --"wdt:P625"--> v4 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P18".-> v5 end bind1[/"sample(?_image)"/] v5 --o bind1 bind1 --as--o v6