by FelipeCortez · 8mo ago · 0 comments
SELECT ?work ?workLabel ?author ?authorLabel ?publicationDate ?ageAtPublication
WHERE {
?author wdt:P569 ?birth .
?author wdt:P570 ?death .
?author wdt:P800 ?work .
?work wdt:P50 ?author ;
wdt:P31 wd:Q47461344 ;
wdt:P577 ?publicationDate .
FILTER(?publicationDate <= ?death)
BIND(YEAR(?publicationDate) - YEAR(?birth) AS ?ageAtPublication)
FILTER(?ageAtPublication > 60)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
ORDER BY DESC(?ageAtPublication)
LIMIT 300This seems like the kind of thing that should be more widely known, and have some good tutorials written for it :)
https://www.wikidata.org/wiki/Wikidata:Introduction
And you can find lots of SPARQL examples here:
https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/...
I tried modifying it to give me authors whose first publication (any publication at all) happened after 60 years old, but also who had at least one wdt:P800 work. I got people like Cato the Elder, Josephus, and William of Tyre.
I tried again for only people born in the 20th century, and I got some results (plus quite a bit of wrong answers, presumably something about the query or data)! Oddly quite a few of the results are from criminals who wrote an autobiography after their release, including Henri Charrière and the infamous Nazi, Albert Speer.
?work wdt:P50 ?author ;
wdt:P577 ?publicationDate ;
wdt:P8383 ?goodreadsID .
?article schema:about ?work ;
schema:isPartOf <https://en.wikipedia.org/> ;
schema:inLanguage "en" .