query-2b0a4752a800bd33a056f1a7ae63d9ad
Indian centenarians SELECT ?person ?personLabel ?age WHERE { ?person wdt:P31 wd:Q5. ?person wdt:P27 wd:Q668. ?person wdt:P793 wd:Q2944360. OPTIONAL { ?person wdt:P569 ?born.} OPTIONAL { ?person wdt:P570 ?died.} BIND(FLOOR((?died - ?born)/365.2425) AS ?age). SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY DESC(?age)
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#>
#Indian centenarians
SELECT ?person ?personLabel ?age
WHERE {
?person wdt:P31 wd:Q5.
?person wdt:P27 wd:Q668.
?person wdt:P793 wd:Q2944360.
OPTIONAL { ?person wdt:P569 ?born.}
OPTIONAL { ?person wdt:P570 ?died.}
BIND(FLOOR((?died - ?born)/365.2425) AS ?age).
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?age)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?age"):::projected
v3("?born")
v4("?died")
v2("?person"):::projected
c10(["bd:serviceParam"]):::iri
c4(["wd:Q668"]):::iri
c2(["wd:Q5"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c6(["wd:Q2944360"]):::iri
v2 --"wdt:P31"--> c2
v2 --"wdt:P27"--> c4
v2 --"wdt:P793"--> c6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P569".-> v3
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P570".-> v4
end
bind0[/"numeric-floor(?died - ?born / '365.2425^^xsd:decimal')"/]
v4 --o bind0
v3 --o bind0
bind0 --as--o v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end