Princeton-CDH / mep-django

Shakespeare and Company Project - Python/Django web application
https://shakespeareandco.princeton.edu
Apache License 2.0
5 stars 1 forks source link

viaf lookup for birth/death dates are not working properly #801

Closed rlskoeser closed 5 months ago

rlskoeser commented 8 months ago

Did a little more digging - we have viaf IDs ending with slashes but the RDF has URIs ending without the slash, so our lookups don't match and we don't get the dates we should be getting. (Maybe something changed with VIAF since the time this was implemented, or maybe we changed our local practice.). We can fix that part in the S&co codebase.

I also see that the date parsing doesn't handle negative years... That needs to be fixed in viapy.

_Originally posted by @rlskoeser in https://github.com/Princeton-CDH/mep-django/pull/800#discussion_r1459201382_

We'll want to batch update records when this is fixed - maybe a one-off python console update would be sufficient in this case instead of a manage command (although log entries would be nice)

testing notes

rlskoeser commented 5 months ago

python console syntax for updating missing birth/death years from viaf:

from mep.people.models import Person
for p in Person.objects.exclude(viaf_id='').filter(birth_year__isnull=True):
    p.set_birth_death_years()
    p.save()

This won't create log entries - need to decide if that matters.

jkotin commented 5 months ago

Perfect!