From 4f228b1c9ece8efe0635e44cb5fdc7ecc5c66ec7 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Tue, 30 Nov 2021 13:42:57 -0800 Subject: schema: use container redirect as ident if defined This is to handle containers which have been merged (redirected), but the release entities have not be updated to point to the new "primary" container yet. --- fatcat_scholar/issue_db.py | 2 +- fatcat_scholar/schema.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'fatcat_scholar') diff --git a/fatcat_scholar/issue_db.py b/fatcat_scholar/issue_db.py index 8771f7f..4d6fe04 100644 --- a/fatcat_scholar/issue_db.py +++ b/fatcat_scholar/issue_db.py @@ -274,7 +274,7 @@ class IssueDB: pub_type=meta.get("pub_type"), publisher=meta.get("publisher"), container_issnl=container and container.issnl, - container_ident=container and container.ident, + container_ident=container and (container.redirect or container.ident), wikidata_qid=container and container.wikidata_qid, ) if isinstance(row.publisher, list): diff --git a/fatcat_scholar/schema.py b/fatcat_scholar/schema.py index b170f12..14e5fed 100644 --- a/fatcat_scholar/schema.py +++ b/fatcat_scholar/schema.py @@ -525,7 +525,7 @@ def es_biblio_from_release(release: ReleaseEntity) -> ScholarBiblio: if release.container: publisher = release.publisher or release.container.publisher container_name = container_name or release.container.name - container_ident = release.container.ident + container_ident = release.container.redirect or release.container.ident container_type = release.container.container_type container_issnl = release.container.issnl issns = [] @@ -625,7 +625,7 @@ def es_release_from_release(release: ReleaseEntity) -> ScholarRelease: if release.container: container_name = release.container.name - container_ident = release.container.ident + container_ident = release.container.redirect or release.container.ident container_issnl = release.container.issnl container_type = release.container.container_type else: -- cgit v1.2.3