Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
4 tasks done
Tracked by #815
rlskoeser opened this issue Jan 19, 2024 · 2 comments
Closed
4 tasks done
Tracked by #815

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

rlskoeser opened this issue Jan 19, 2024 · 2 comments
Assignees
Labels

Comments

@rlskoeser
Copy link
Contributor

rlskoeser commented Jan 19, 2024

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 #800 (comment)

  • fix viaf uris in s&co codebase: when initializing ViafEntity, strip the trailing slash
  • fix date to year parsing in viapy to handle negative years (example: Aeschylus, https://viaf.org/viaf/268526195/ )

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

  • In the S&co django admin, go to the person list and select a person record with a VIAF id but no birth/death dates even though VIAF record includes dates; save the record with "save and continue editing" - birth and death dates should be populated from VIAF
  • Find Aeschylus in the Person list and do the same thing (save and continue editing); birth/death dates should be added
@rlskoeser
Copy link
Contributor Author

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
Copy link

jkotin commented Apr 23, 2024

Perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

No branches or pull requests

2 participants