query-871d3a4b000a85546be8b1c59ebf3cab
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
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/>
SELECT ?actor ?movie ?age ?dob (year(?dob) as ?yeardob) WHERE {
?actor p:P569/psv:P569 ?birth_date_node .
{?birth_date_node wikibase:timePrecision "7"^^xsd:integer .}
?birth_date_node wikibase:timeValue ?dob .
?actor wdt:P106 wd:Q33999 .
# ?movie wdt:P495 wd:Q142 .
?actor wdt:P27 wd:Q142 .
?movie wdt:P161 ?actor .
?movie wdt:P577 ?dateMovie .
BIND(YEAR(?dateMovie)-YEAR(?dob) as ?age) .
FILTER(?age = 1) .
}
ORDER BY ?age
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?actor"):::projected
v7("?age"):::projected
v3("?birth_date_node")
v6("?dateMovie")
v4("?dob"):::projected
v5("?movie"):::projected
v7("?yeardob")
a1((" "))
c5(["7^^xsd:integer"]):::literal
c8(["wd:Q33999"]):::iri
c10(["wd:Q142"]):::iri
f0[["?age = '1^^xsd:integer'"]]
f0 --> v7
v2 --"p:P569"--> a1
a1 --"p:statement/value/P569"--> v3
v3 --"wikibase:timePrecision"--> c5
v3 --"wikibase:timeValue"--> v4
v2 --"p:direct/P106"--> c8
v2 --"p:direct/P27"--> c10
v5 --"p:direct/P161"--> v2
v5 --"p:direct/P577"--> v6
bind1[/"year-from-dateTime(?dateMovie) - year-from-dateTime(?dob)"/]
v6 --o bind1
v4 --o bind1
bind1 --as--o v7
bind2[/"year-from-dateTime(?dob)"/]
v4 --o bind2
bind2 --as--o v7