query-d7fb23022f03e79ea3810d595521e9da
Odia people (whose spoken/written language is Odia) died in 2020
SOURCE EXAMPLE: https://www.wikidata.org/wiki/Wikidata:SPARQL_tutorial#BIND,_BOUND,_IF
SELECT ?person ?personLabel ?personDescription ?born ?died ?age WHERE{ ?person wdt:P31 wd:Q5; wdt:P1412 wd:Q33810; wdt:P569 ?born; wdt:P570 ?died. FILTER( ?died > ?born ). FILTER ( ?died >= "2020-01-01T00:00:00Z"^^xsd:dateTime && ?died <= "2020-12-31T00:00:00Z"^^xsd:dateTime ) BIND(?died - ?born AS ?ageInDays). BIND(?ageInDays/365.2425 AS ?ageInYears). BIND(FLOOR(?ageInYears) AS ?age). # or, as one expression: #BIND(FLOOR((?died - ?born)/365.2425) AS ?age). # (https://en.wikibooks.org/wiki/SPARQL/Expressions_and_Functions#COUNT,_MIN,_MAX,_AVG_and_SUM) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en". } } ORDER BY DESC(?age)
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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#>
# Odia people (whose spoken/written language is Odia) died in 2020
# SOURCE EXAMPLE: https://www.wikidata.org/wiki/Wikidata:SPARQL_tutorial#BIND,_BOUND,_IF
SELECT ?person ?personLabel ?personDescription ?born ?died ?age
WHERE{
?person wdt:P31 wd:Q5;
wdt:P1412 wd:Q33810;
wdt:P569 ?born;
wdt:P570 ?died.
FILTER( ?died > ?born ).
FILTER ( ?died >= "2020-01-01T00:00:00Z"^^xsd:dateTime && ?died <= "2020-12-31T00:00:00Z"^^xsd:dateTime )
BIND(?died - ?born AS ?ageInDays).
BIND(?ageInDays/365.2425 AS ?ageInYears).
BIND(FLOOR(?ageInYears) AS ?age).
# or, as one expression:
#BIND(FLOOR((?died - ?born)/365.2425) AS ?age). # (https://en.wikibooks.org/wiki/SPARQL/Expressions_and_Functions#COUNT,_MIN,_MAX,_AVG_and_SUM)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en". }
}
ORDER BY DESC(?age)