query-9518a2d262609c501cb27170c52ef282
Oldest living Odia (no death data @ Wikidata) SELECT DISTINCT ?item ?itemLabel ?genderLabel ?itemDescription ?birth ?age WHERE { ?item wdt:P1412 wd:Q33810 ; wdt:P569 ?birth ; wdt:P21 ?gender . MINUS { ?item wdt:P570 [] }
BIND(YEAR(now())-YEAR(?birth) as ?age)
BIND( YEAR(now()) - YEAR(?birth) - IF(MONTH(now())<MONTH(?birth) || (MONTH(now())=MONTH(?birth) && DAY(now())<DAY(?birth)),1,0) AS ?age ) # Wikidata:Request_a_query#Oldest_male_living_tennis_players_who_won_a_Grand_Slam_singles_title (FEB 2021)
FILTER ( ?age < 110 )
SERVICE wikibase:label { bd:serviceParam wikibase:language "or, [AUTO_LANGUAGE]". } } ORDER BY DESC(?age) LIMIT 111
Use at
- https://query.wikidata.org/sparql
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#>
# Oldest living Odia (no death data @ Wikidata)
SELECT DISTINCT ?item ?itemLabel ?genderLabel ?itemDescription ?birth ?age
WHERE {
?item wdt:P1412 wd:Q33810 ;
wdt:P569 ?birth ;
wdt:P21 ?gender .
MINUS { ?item wdt:P570 [] }
# BIND(YEAR(now())-YEAR(?birth) as ?age)
BIND( YEAR(now()) - YEAR(?birth) -
IF(MONTH(now())<MONTH(?birth) ||
(MONTH(now())=MONTH(?birth) && DAY(now())<DAY(?birth)),1,0) AS ?age ) # Wikidata:Request_a_query#Oldest_male_living_tennis_players_who_won_a_Grand_Slam_singles_title (FEB 2021)
# FILTER ( ?age < 110 )
SERVICE wikibase:label { bd:serviceParam wikibase:language "or, [AUTO_LANGUAGE]". }
}
ORDER BY DESC(?age)
LIMIT 111
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?age"):::projected
v3("?birth"):::projected
v4("?gender")
v2("?item"):::projected
a1((" "))
c9(["or, #91;AUTO_LANGUAGE#93;"]):::literal
c7(["bd:serviceParam"]):::iri
c2(["wd:Q33810"]):::iri
v2 --"wdt:P1412"--> c2
v2 --"wdt:P569"--> v3
v2 --"wdt:P21"--> v4
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P570"--> a1
end
bind1[/"year-from-dateTime(NOW()) - year-from-dateTime(?birth) - if((month-from-dateTime(NOW()) < month-from-dateTime(?birth) || month-from-dateTime(NOW()) = month-from-dateTime(?birth)day-from-dateTime(NOW()) < day-from-dateTime(?birth)),'1^^xsd:integer','0^^xsd:integer')"/]
v3 --o bind1
bind1 --as--o v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c7 --"wikibase:language"--> c9
end