From d38dda53dd29024c8c855c64dfbb1529d0aaac83 Mon Sep 17 00:00:00 2001 From: Martin Czygan Date: Mon, 6 Jan 2020 22:30:20 +0100 Subject: datacite: month field should be top-level --- python/fatcat_tools/importers/datacite.py | 4 ++-- python/tests/files/datacite/datacite_result_00.json | 4 ++-- python/tests/files/datacite/datacite_result_05.json | 6 +++--- python/tests/files/datacite/datacite_result_12.json | 2 +- python/tests/files/datacite/datacite_result_13.json | 2 +- python/tests/files/datacite/datacite_result_18.json | 2 +- python/tests/files/datacite/datacite_result_19.json | 2 +- python/tests/files/datacite/datacite_result_20.json | 2 +- python/tests/files/datacite/datacite_result_21.json | 2 +- python/tests/files/datacite/datacite_result_22.json | 2 +- python/tests/files/datacite/datacite_result_23.json | 2 +- python/tests/files/datacite/datacite_result_24.json | 2 +- 12 files changed, 16 insertions(+), 16 deletions(-) diff --git a/python/fatcat_tools/importers/datacite.py b/python/fatcat_tools/importers/datacite.py index a673f00b..1cee6db3 100644 --- a/python/fatcat_tools/importers/datacite.py +++ b/python/fatcat_tools/importers/datacite.py @@ -603,8 +603,6 @@ class DataciteImporter(EntityImporter): extra_datacite['license'] = license_extra if attributes.get('subjects'): extra_datacite['subjects'] = attributes['subjects'] - if release_month: - extra_datacite['month'] = release_month # Include certain relations from relatedIdentifiers. Keeping the # original structure of data here, which is a list of dicts, with @@ -630,6 +628,8 @@ class DataciteImporter(EntityImporter): # Always include datacite key, even if value is empty (dict). extra['datacite'] = extra_datacite + if release_month: + extra['month'] = release_month extids = self.lookup_ext_ids(doi=doi) diff --git a/python/tests/files/datacite/datacite_result_00.json b/python/tests/files/datacite/datacite_result_00.json index ad917b92..e76aa391 100644 --- a/python/tests/files/datacite/datacite_result_00.json +++ b/python/tests/files/datacite/datacite_result_00.json @@ -2,7 +2,6 @@ "extra": { "container_name": "Journal of Chemical Crystallography", "datacite": { - "month": 5, "license": [ { "rightsUri": "http://www.springer.com/tdm" @@ -16,7 +15,8 @@ "relatedIdentifierType": "ISSN" } ] - } + }, + "month": 5 }, "title": "Synthesis and Crystal Structure of a Compound with Two Conformational Isomers: N-(2-methylbenzoyl)-N\u2032-(4-nitrophenyl)thiourea", "release_type": "article-journal", diff --git a/python/tests/files/datacite/datacite_result_05.json b/python/tests/files/datacite/datacite_result_05.json index cea2a25c..1352fe29 100644 --- a/python/tests/files/datacite/datacite_result_05.json +++ b/python/tests/files/datacite/datacite_result_05.json @@ -6,9 +6,9 @@ "rights": "Attribution-NonCommercial (CC BY-NC)", "rightsUri": "http://creativecommons.org/licenses/by-nc/4.0" } - ], - "month": 10 - } + ] + }, + "month": 10 }, "title": "SH409843.07FU", "subtitle": "Gomphales", diff --git a/python/tests/files/datacite/datacite_result_12.json b/python/tests/files/datacite/datacite_result_12.json index 646299cf..c3a9071c 100644 --- a/python/tests/files/datacite/datacite_result_12.json +++ b/python/tests/files/datacite/datacite_result_12.json @@ -1,5 +1,5 @@ { - "extra": {"datacite": {"month": 6}}, + "extra": {"datacite": {}, "month": 6}, "title": "Anthropometric and Physiological Profile of Mixed Martial Art Athletes: A Brief Review", "release_type": "article-journal", "release_stage": "published", diff --git a/python/tests/files/datacite/datacite_result_13.json b/python/tests/files/datacite/datacite_result_13.json index fea722c7..d6ed2985 100644 --- a/python/tests/files/datacite/datacite_result_13.json +++ b/python/tests/files/datacite/datacite_result_13.json @@ -1,5 +1,5 @@ { - "extra": {"datacite": {"month": 10}}, + "extra": {"datacite": {}, "month": 10}, "title": "[M\u00fcssen wir des Gl\u00fccks uns sch\u00e4men?]", "release_type": "article-journal", "release_stage": "published", diff --git a/python/tests/files/datacite/datacite_result_18.json b/python/tests/files/datacite/datacite_result_18.json index 6599fe08..fb109de2 100644 --- a/python/tests/files/datacite/datacite_result_18.json +++ b/python/tests/files/datacite/datacite_result_18.json @@ -1,5 +1,5 @@ { - "extra": {"datacite": {"month": 8}}, + "extra": {"datacite": {}, "month": 8}, "title": "Eastern questionnaire, answer sheet for Interviewee 53215, page 064", "release_type": "article", "release_stage": "published", diff --git a/python/tests/files/datacite/datacite_result_19.json b/python/tests/files/datacite/datacite_result_19.json index 5598ccee..85bada92 100644 --- a/python/tests/files/datacite/datacite_result_19.json +++ b/python/tests/files/datacite/datacite_result_19.json @@ -1,5 +1,5 @@ { - "extra": {"datacite": {"month": 8}}, + "extra": {"datacite": {}, "month": 8}, "title": "Eastern questionnaire, answer sheet for Interviewee 55236, page 092", "release_type": "article", "release_stage": "published", diff --git a/python/tests/files/datacite/datacite_result_20.json b/python/tests/files/datacite/datacite_result_20.json index ec2dfc38..891cb41e 100644 --- a/python/tests/files/datacite/datacite_result_20.json +++ b/python/tests/files/datacite/datacite_result_20.json @@ -1,5 +1,5 @@ { - "extra": {"datacite": {"month": 8}}, + "extra": {"datacite": {}, "month": 8}, "title": "

Eastern questionnaire

", "release_type": "article", "release_stage": "published", diff --git a/python/tests/files/datacite/datacite_result_21.json b/python/tests/files/datacite/datacite_result_21.json index b5e2207a..73df8216 100644 --- a/python/tests/files/datacite/datacite_result_21.json +++ b/python/tests/files/datacite/datacite_result_21.json @@ -1,5 +1,5 @@ { - "extra": {"datacite": {"month": 8}}, + "extra": {"datacite": {}, "month": 8}, "title": "ABC", "release_type": "article", "release_stage": "published", diff --git a/python/tests/files/datacite/datacite_result_22.json b/python/tests/files/datacite/datacite_result_22.json index bd1290c2..97f35da5 100644 --- a/python/tests/files/datacite/datacite_result_22.json +++ b/python/tests/files/datacite/datacite_result_22.json @@ -1,5 +1,5 @@ { - "extra": {"datacite": {"month": 8}}, + "extra": {"datacite": {}, "month": 8}, "title": "ABC", "release_type": "article", "release_stage": "published", diff --git a/python/tests/files/datacite/datacite_result_23.json b/python/tests/files/datacite/datacite_result_23.json index 599d1b37..93385c70 100644 --- a/python/tests/files/datacite/datacite_result_23.json +++ b/python/tests/files/datacite/datacite_result_23.json @@ -1,5 +1,5 @@ { - "extra": {"datacite": {"month": 8}}, + "extra": {"datacite": {}, "month": 8}, "title": "ABC", "release_type": "article", "release_stage": "published", diff --git a/python/tests/files/datacite/datacite_result_24.json b/python/tests/files/datacite/datacite_result_24.json index a3649867..cb08e67b 100644 --- a/python/tests/files/datacite/datacite_result_24.json +++ b/python/tests/files/datacite/datacite_result_24.json @@ -1,5 +1,5 @@ { - "extra": {"datacite": {"month": 8}}, + "extra": {"datacite": {}, "month": 8}, "title": "ABC", "subtitle": "DEF", "release_type": "article", -- cgit v1.2.3