query-710100f711016d2c5c154ff6a423926c

rq turtle/ttl

Ziegen SELECT DISTINCT ?item ?itemLabel ?year ?yearDOB ?diff WHERE { ?item wdt:P106 wd:Q10873124 . ?item p:P1087 [ps:P1087 ?elo; pq:P585 ?date ] .

?item wdt:P569 ?dob .

BIND(YEAR(?date) AS ?year ). BIND(YEAR(?dob) AS ?yearDOB ).

BIND( MIN(?year - ?yearDOB) AS ?diff ). SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } LIMIT 1000

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#>
#Ziegen
SELECT DISTINCT ?item ?itemLabel ?year ?yearDOB ?diff
WHERE 
{
  ?item wdt:P106 wd:Q10873124 .
  ?item p:P1087 [ps:P1087 ?elo; pq:P585 ?date ] .

  ?item wdt:P569 ?dob .

  BIND(YEAR(?date) AS ?year ).
  BIND(YEAR(?dob) AS ?yearDOB ).

  BIND( MIN(?year - ?yearDOB) AS ?diff ).
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
LIMIT 1000

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?date") v7("?diff"):::projected v4("?dob") v2("?elo") v1("?item"):::projected v5("?year"):::projected v6("?yearDOB"):::projected a1((" ")) c8(["bd:serviceParam"]):::iri c2(["wd:Q10873124"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal v1 --"p:direct/P106"--> c2 a1 --"p:statement/P1087"--> v2 a1 --"p:qualifier/P585"--> v3 v1 --"p:P1087"--> a1 v1 --"p:direct/P569"--> v4 bind0[/"year-from-dateTime(?date)"/] v3 --o bind0 bind0 --as--o v5 bind1[/"year-from-dateTime(?dob)"/] v4 --o bind1 bind1 --as--o v6 bind2[/"min(?year - ?yearDOB)"/] v5 --o bind2 v6 --o bind2 bind2 --as--o v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end