Closed rlskoeser closed 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.
Perfect!
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_
ViafEntity
, strip the trailing slashWe'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