query-5fe859bebbe8c0393904f5d5c0652016

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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?age  {
  ?item wdt:P1196 wd:Q8454 . 
# ?item wdt:P1399 [] .
  ?item p:P569 [ a wikibase:BestRank ;
                 psv:P569 [ wikibase:timeValue ?birth;
                            wikibase:timePrecision ?precision_birth ] ] .
  ?item p:P570 [ a wikibase:BestRank ;
                 psv:P570 [ wikibase:timeValue ?death;
                            wikibase:timePrecision ?precision_death ] ] . 
  FILTER (?precision_birth > 8 && ?precision_death > 8) 
  BIND ((?death - ?birth)/365.25 AS ?age) 
  FILTER (?age <= 18.5)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en"}
} ORDER BY ?age

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?age"):::projected v5("?birth") v6("?death") v4("?item"):::projected v2("?precision_birth") v3("?precision_death") a1((" ")) a2((" ")) a3((" ")) a4((" ")) c6(["wikibase:BestRank"]):::iri c16(["en"]):::literal c4(["wd:Q8454"]):::iri c14(["bd:serviceParam"]):::iri f0[["?age <= '18.5^^xsd:decimal'"]] f0 --> v7 f1[["?precision_birth > '8^^xsd:integer'?precision_death > '8^^xsd:integer'"]] f1 --> v2 f1 --> v3 v4 --"p:direct/P1196"--> c4 a1 --"a"--> c6 a2 --"wikibase:timeValue"--> v5 a2 --"wikibase:timePrecision"--> v2 a1 --"p:statement/value/P569"--> a2 v4 --"p:P569"--> a1 a3 --"a"--> c6 a4 --"wikibase:timeValue"--> v6 a4 --"wikibase:timePrecision"--> v3 a3 --"p:statement/value/P570"--> a4 v4 --"p:P570"--> a3 bind2[/"?death - ?birth / '365.25^^xsd:decimal'"/] v6 --o bind2 v5 --o bind2 bind2 --as--o v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 end