query-3d378cde069e7491ae903225ab221a03

rq turtle/ttl

Propertiesinstance of (P31)date of death (P570)cause of death (P509)

Use at

PREFIX mwapi: <http://wikiba.se/ontology#>
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#>
SELECT 
  DISTINCT ?item ?itemLabel ?dod ?cod ?codLabel
WHERE {
  {   
   SELECT DISTINCT ?item  WHERE {
    SERVICE wikibase:mwapi {
      bd:serviceParam wikibase:endpoint "en.wikipedia.org" .
      bd:serviceParam wikibase:api "Generator" .
      bd:serviceParam mwapi:generator "search" .
      bd:serviceParam mwapi:gsrsearch ""Spanish flu"" .
      bd:serviceParam mwapi:gsrlimit "max" .
      ?item wikibase:apiOutputItem mwapi:item .
    }
  } LIMIT 100
 }

  ?item wdt:P31 wd:Q5.

  OPTIONAL {?item wdt:P570 ?dod .}

  OPTIONAL {?item wdt:P509 ?cod .}

  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY ASC(?dod)

Query found at