From b9d5c3853fe70663b0eff101c9ac4a1cbfd354e7 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Wed, 15 Dec 2021 12:48:13 -0800 Subject: crossref importer: skip affiliations lacking 'name' Relatedly, we should start handling ROR affiliations in contribs soon. --- python/fatcat_tools/importers/crossref.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/python/fatcat_tools/importers/crossref.py b/python/fatcat_tools/importers/crossref.py index 52bd7465..9150322b 100644 --- a/python/fatcat_tools/importers/crossref.py +++ b/python/fatcat_tools/importers/crossref.py @@ -137,6 +137,9 @@ class CrossrefImporter(EntityImporter): index = None raw_affiliation = None affiliation_list = am.get("affiliation") or [] + # TODO: currently requiring a "name" in all affiliations. Could + # add ROR support (via identifier) in the near future + affiliation_list = [a for a in affiliation_list if "name" in a] if affiliation_list and len(affiliation_list) > 0: raw_affiliation = affiliation_list[0]["name"] if len(affiliation_list) > 1: -- cgit v1.2.3