query-54caea93d23a310c8da69154822ea34f

rq turtle/ttl

Gemiddelde leeftijd

Use at

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#>
select (avg(?age) as ?avgAge) where {
  ?item wdt:P179 wd:Q2330424;
        wdt:P5030 ?guest;
        wdt:P577 ?pubDate. 
  ?guest wdt:P569 ?dob. 
  bind (year(?dob) as ?dobyear). 
  bind (year(?pubDate) as ?pubyear).
  bind (?pubyear - ?dobyear as ?age).

  SERVICE wikibase:label { bd:serviceParam wikibase:language "nl". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?age"):::projected v8("?avgAge") v4("?dob") v5("?dobyear") v2("?guest") v1("?item") v3("?pubDate") v6("?pubyear") c7(["bd:serviceParam"]):::iri c2(["wd:Q2330424"]):::iri c9(["nl"]):::literal v1 --"wdt:P179"--> c2 v1 --"wdt:P5030"--> v2 v1 --"wdt:P577"--> v3 v2 --"wdt:P569"--> v4 bind0[/"year-from-dateTime(?dob)"/] v4 --o bind0 bind0 --as--o v5 bind1[/"year-from-dateTime(?pubDate)"/] v3 --o bind1 bind1 --as--o v6 bind2[/"?pubyear - ?dobyear"/] v6 --o bind2 v5 --o bind2 bind2 --as--o v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c7 --"wikibase:language"--> c9 end bind4[/"average(?age)"/] v7 --o bind4 bind4 --as--o v8