aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2022-02-09 17:15:02 -0800
committerBryan Newbold <bnewbold@robocracy.org>2022-02-09 17:34:42 -0800
commit88fe8c60c169fea628bfb42d1f4af5297c914546 (patch)
tree04d72cbf9ecda7887d9f88cb8371d87c4b34f43e
parentd4c7fd88f359f60ccc5ac82c1c79045a12f4c582 (diff)
downloadfatcat-88fe8c60c169fea628bfb42d1f4af5297c914546.tar.gz
fatcat-88fe8c60c169fea628bfb42d1f4af5297c914546.zip
datacite importer: skip container_id for some repository sources
-rw-r--r--python/fatcat_tools/importers/datacite.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/python/fatcat_tools/importers/datacite.py b/python/fatcat_tools/importers/datacite.py
index b310f8bc..1d098aca 100644
--- a/python/fatcat_tools/importers/datacite.py
+++ b/python/fatcat_tools/importers/datacite.py
@@ -511,6 +511,8 @@ class DataciteImporter(EntityImporter):
):
relations.append(rel)
+ # TODO: could use many of these relations to do release/work grouping
+
if relations:
extra_datacite["relations"] = relations
@@ -646,6 +648,38 @@ class DataciteImporter(EntityImporter):
):
re.extra["container_name"] = "figshare.com"
+ # Columbia Institutional Repository includes full bibliographic
+ # metadata, which results in incorrect container_id matches. But this
+ # DOI prefix also publishes actual journals!
+ if (
+ re.ext_ids.doi.startswith("10.7916/")
+ and "-" in re.ext_ids.doi
+ and re.publisher == "Columbia University"
+ and re.extra
+ and re.extra.get("datacite")
+ ):
+ for relation in re.extra["datacite"].get("relations", []):
+ if relation.get("relationType") == "IsVariantFormOf":
+ re.container_id = None
+ if re.release_stage in ("published", None):
+ re.release_stage = "submitted"
+
+ # several institutional and other repositories (including "RWTH" and
+ # "DESY") also results in incorrect container_id matches.
+ # This probably doesn't filter out enough, but is a start.
+ IR_DOI_PREFIXES = [
+ "10.15495/epub_ubt_",
+ "10.18154/rwth-20",
+ "10.3204/pubdb-",
+ "10.3204/phppubdb-",
+ "10.26204/kluedo/",
+ ]
+ for prefix in IR_DOI_PREFIXES and re.extra and re.extra.get("datacite"):
+ if re.ext_ids.doi.startswith(prefix):
+ for relation in re.extra["datacite"].get("relations", []):
+ if relation.get("relationType") == "IsVariantFormOf":
+ re.container_id = None
+
return re
def try_update(self, re: ReleaseEntity) -> bool: