Hacker News new | ask | show | jobs
by FelipeCortez 78 days ago
This is actually a good fit for a Wikidata SPARQL query you can run here https://query.wikidata.org/:

  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 300
5 comments

How can I learn more about this? I looked into it recently but didn't get very far.

This seems like the kind of thing that should be more widely known, and have some good tutorials written for it :)

The Wikidata documentation is good:

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/...

Wow - this is super cool. Thanks for sharing!
This is a very cool query tool that I haven't seen before, thanks! (Also the syntax drives me a little batty).

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.

This is actually very awesome. Had no idea about this.
Can you filter by "major works only"?
that's kind of what P800 (notable work) is doing, but you can try some approximations to "major work" with "has both an English Wikipedia page and a Goodreads link":

  ?work wdt:P50 ?author ;
        wdt:P577 ?publicationDate ; 
        wdt:P8383 ?goodreadsID .

  ?article schema:about ?work ;
           schema:isPartOf <https://en.wikipedia.org/> ;
           schema:inLanguage "en" .
I don't think that's what they meant by major.
Why?