query-4a50859569cbd8db467b51d571e1df27

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?rank ?dob ?eventtime ?age WHERE{
  wd:Q67123914 p:P710 [ps:P710 ?item ; pq:P1352 ?rank].
  wd:Q67123914 wdt:P585 ?eventtime.
  ?item wdt:P569 ?dob. 
  bind(floor((?eventtime - ?dob)/365.25) as ?age)  # how to calculate this? because this is giving an error.
  Filter ( ?rank in (1, 2, 3)).       
 # and then finally sum the three ages together
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?age"):::projected v4("?dob"):::projected v3("?eventtime"):::projected v2("?item"):::projected v1("?rank"):::projected a1((" ")) c11(["bd:serviceParam"]):::iri c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal c6(["wd:Q67123914"]):::iri list0c1(["1^^xsd:integer"]):::literal list0c2(["2^^xsd:integer"]):::literal list0c3(["3^^xsd:integer"]):::literal list0c1 --o f0 list0c2 --o f0 list0c3 --o f0 f0[[" in "]] f0 --> v1 a1 --"p:statement/P710"--> v2 a1 --"p:qualifier/P1352"--> v1 c6 --"p:P710"--> a1 c6 --"p:direct/P585"--> v3 v2 --"p:direct/P569"--> v4 bind1[/"numeric-floor(?eventtime - ?dob / '365.25^^xsd:decimal')"/] v3 --o bind1 v4 --o bind1 bind1 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end