query-a290e723e035c7525a55ab1becb77ac2

rq turtle/ttl

People died in 2019

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#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

# Odia people (whose spoken/written language is Odia) died in 2019
SELECT ?item ?itemLabel ?itemDescription ?dod ?dob ?age WHERE {
  ?item wdt:P570 ?dod.
  ?item wdt:P31 wd:Q5.
  ?item wdt:P1412 wd:Q7918.
  OPTIONAL {
    ?item wdt:P569 ?dob.
    BIND((2017 - (YEAR(?dob))) + 1 AS ?age)
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
  FILTER((?dod >= "2019-01-01T00:00:00Z"^^xsd:dateTime) && (?dod <= "2019-12-31T00:00:00Z"^^xsd:dateTime))
}
ORDER BY DESC(?age)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?age"):::projected v4("?dob"):::projected v2("?dod"):::projected v3("?item"):::projected c7(["wd:Q7918"]):::iri c10(["bd:serviceParam"]):::iri c5(["wd:Q5"]):::iri c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?dod >= '2019-01-01T00:00:00Z^^xsd:dateTime'?dod <= '2019-12-31T00:00:00Z^^xsd:dateTime'"]] f0 --> v2 v3 --"wdt:P570"--> v2 v3 --"wdt:P31"--> c5 v3 --"wdt:P1412"--> c7 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P569".-> v4 bind1[/"'2017^^xsd:integer' - year-from-dateTime(?dob) + '1^^xsd:integer'"/] v4 --o bind1 bind1 --as--o v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end