aboutsummaryrefslogtreecommitdiffstats
path: root/python
diff options
context:
space:
mode:
authorMartin Czygan <martin.czygan@gmail.com>2020-01-04 00:19:56 +0100
committerMartin Czygan <martin.czygan@gmail.com>2020-01-04 00:19:56 +0100
commite6feb6fd6d48f7b179389e79dfeb994d1b0f797b (patch)
treefe35cbed0950e17f2223beae2ea0c66ce81baad9 /python
parent328d7901df30ba94685d34d6a428e798b4604839 (diff)
downloadfatcat-e6feb6fd6d48f7b179389e79dfeb994d1b0f797b.tar.gz
fatcat-e6feb6fd6d48f7b179389e79dfeb994d1b0f797b.zip
datacite: always include "datacite" key in extra
> always include extra values for the respective DOI registrars (datacite, crossref, jalc), even if they are empty ({}), to be used as a flag so we know which DOI registrar supplied the metadata.
Diffstat (limited to 'python')
-rw-r--r--python/fatcat_tools/importers/datacite.py4
-rw-r--r--python/tests/files/datacite/datacite_result_03.json4
-rw-r--r--python/tests/files/datacite/datacite_result_04.json2
-rw-r--r--python/tests/files/datacite/datacite_result_11.json4
-rw-r--r--python/tests/files/datacite/datacite_result_12.json4
-rw-r--r--python/tests/files/datacite/datacite_result_13.json4
-rw-r--r--python/tests/files/datacite/datacite_result_15.json4
-rw-r--r--python/tests/files/datacite/datacite_result_17.json4
-rw-r--r--python/tests/files/datacite/datacite_result_18.json4
-rw-r--r--python/tests/files/datacite/datacite_result_19.json4
-rw-r--r--python/tests/files/datacite/datacite_result_20.json4
-rw-r--r--python/tests/files/datacite/datacite_result_21.json4
-rw-r--r--python/tests/files/datacite/datacite_result_22.json4
-rw-r--r--python/tests/files/datacite/datacite_result_23.json4
-rw-r--r--python/tests/files/datacite/datacite_result_24.json2
15 files changed, 28 insertions, 28 deletions
diff --git a/python/fatcat_tools/importers/datacite.py b/python/fatcat_tools/importers/datacite.py
index d0c75b6e..2fad1264 100644
--- a/python/fatcat_tools/importers/datacite.py
+++ b/python/fatcat_tools/importers/datacite.py
@@ -604,8 +604,8 @@ class DataciteImporter(EntityImporter):
if not container_id and container_name:
extra['container_name'] = container_name
- if extra_datacite:
- extra['datacite'] = extra_datacite
+ # Always include datacite key, even if value is empty (dict).
+ extra['datacite'] = extra_datacite
extids = self.lookup_ext_ids(doi=doi)
diff --git a/python/tests/files/datacite/datacite_result_03.json b/python/tests/files/datacite/datacite_result_03.json
index 3e3c2bd5..e8367e8f 100644
--- a/python/tests/files/datacite/datacite_result_03.json
+++ b/python/tests/files/datacite/datacite_result_03.json
@@ -1,5 +1,5 @@
{
- "extra": {},
+ "extra": {"datacite": {}},
"title": "midterm ah30903",
"release_type": "article",
"release_year": 2016,
@@ -16,4 +16,4 @@
],
"refs": [],
"abstracts": []
-} \ No newline at end of file
+}
diff --git a/python/tests/files/datacite/datacite_result_04.json b/python/tests/files/datacite/datacite_result_04.json
index 94fa1f94..5b956836 100644
--- a/python/tests/files/datacite/datacite_result_04.json
+++ b/python/tests/files/datacite/datacite_result_04.json
@@ -1,5 +1,5 @@
{
- "extra": {},
+ "extra": {"datacite": {}},
"title": "On chain maps inducing isomorphisms in homology",
"release_type": "article-journal",
"release_stage": "published",
diff --git a/python/tests/files/datacite/datacite_result_11.json b/python/tests/files/datacite/datacite_result_11.json
index 037c5ac2..3045701f 100644
--- a/python/tests/files/datacite/datacite_result_11.json
+++ b/python/tests/files/datacite/datacite_result_11.json
@@ -1,5 +1,5 @@
{
- "extra": {},
+ "extra": {"datacite": {}},
"title": "N1 bei Safenwil",
"release_type": "graphic",
"release_stage": "published",
@@ -18,4 +18,4 @@
],
"refs": [],
"abstracts": []
-} \ No newline at end of file
+}
diff --git a/python/tests/files/datacite/datacite_result_12.json b/python/tests/files/datacite/datacite_result_12.json
index 192062e3..5dbcd8d0 100644
--- a/python/tests/files/datacite/datacite_result_12.json
+++ b/python/tests/files/datacite/datacite_result_12.json
@@ -1,5 +1,5 @@
{
- "extra": {},
+ "extra": {"datacite": {}},
"title": "Anthropometric and Physiological Profile of Mixed Martial Art Athletes: A Brief Review",
"release_type": "article-journal",
"release_stage": "published",
@@ -41,4 +41,4 @@
],
"refs": [],
"abstracts": []
-} \ No newline at end of file
+}
diff --git a/python/tests/files/datacite/datacite_result_13.json b/python/tests/files/datacite/datacite_result_13.json
index c8971667..2509f27e 100644
--- a/python/tests/files/datacite/datacite_result_13.json
+++ b/python/tests/files/datacite/datacite_result_13.json
@@ -1,5 +1,5 @@
{
- "extra": {},
+ "extra": {"datacite": {}},
"title": "[M\u00fcssen wir des Gl\u00fccks uns sch\u00e4men?]",
"release_type": "article-journal",
"release_stage": "published",
@@ -25,4 +25,4 @@
],
"refs": [],
"abstracts": []
-} \ No newline at end of file
+}
diff --git a/python/tests/files/datacite/datacite_result_15.json b/python/tests/files/datacite/datacite_result_15.json
index bdeb8426..1b430a7d 100644
--- a/python/tests/files/datacite/datacite_result_15.json
+++ b/python/tests/files/datacite/datacite_result_15.json
@@ -1,5 +1,5 @@
{
- "extra": {},
+ "extra": {"datacite": {}},
"title": "Parramore Island of the Virginia Coast Reserve Permanent Plot Resurvey: Tree data 1997",
"release_type": "dataset",
"release_stage": "published",
@@ -19,4 +19,4 @@
],
"refs": [],
"abstracts": []
-} \ No newline at end of file
+}
diff --git a/python/tests/files/datacite/datacite_result_17.json b/python/tests/files/datacite/datacite_result_17.json
index 0852a09e..73b082d9 100644
--- a/python/tests/files/datacite/datacite_result_17.json
+++ b/python/tests/files/datacite/datacite_result_17.json
@@ -1,5 +1,5 @@
{
- "extra": {},
+ "extra": {"datacite": {}},
"title": "gel_BSA-FITC_Markov_segmntation0343.tif",
"release_type": "dataset",
"release_stage": "published",
@@ -17,4 +17,4 @@
],
"refs": [],
"abstracts": []
-} \ No newline at end of file
+}
diff --git a/python/tests/files/datacite/datacite_result_18.json b/python/tests/files/datacite/datacite_result_18.json
index 274858c3..d0b53222 100644
--- a/python/tests/files/datacite/datacite_result_18.json
+++ b/python/tests/files/datacite/datacite_result_18.json
@@ -1,5 +1,5 @@
{
- "extra": {},
+ "extra": {"datacite": {}},
"title": "Eastern questionnaire, answer sheet for Interviewee 53215, page 064",
"release_type": "article",
"release_stage": "published",
@@ -12,4 +12,4 @@
"contribs": [],
"refs": [],
"abstracts": []
-} \ No newline at end of file
+}
diff --git a/python/tests/files/datacite/datacite_result_19.json b/python/tests/files/datacite/datacite_result_19.json
index 8d797268..55b43684 100644
--- a/python/tests/files/datacite/datacite_result_19.json
+++ b/python/tests/files/datacite/datacite_result_19.json
@@ -1,5 +1,5 @@
{
- "extra": {},
+ "extra": {"datacite": {}},
"title": "Eastern questionnaire, answer sheet for Interviewee 55236, page 092",
"release_type": "article",
"release_stage": "published",
@@ -12,4 +12,4 @@
"contribs": [],
"refs": [],
"abstracts": []
-} \ No newline at end of file
+}
diff --git a/python/tests/files/datacite/datacite_result_20.json b/python/tests/files/datacite/datacite_result_20.json
index 97d7ae75..48063d9d 100644
--- a/python/tests/files/datacite/datacite_result_20.json
+++ b/python/tests/files/datacite/datacite_result_20.json
@@ -1,5 +1,5 @@
{
- "extra": {},
+ "extra": {"datacite": {}},
"title": "<h1>Eastern questionnaire</h1>",
"release_type": "article",
"release_stage": "published",
@@ -11,4 +11,4 @@
"contribs": [],
"refs": [],
"abstracts": []
-} \ No newline at end of file
+}
diff --git a/python/tests/files/datacite/datacite_result_21.json b/python/tests/files/datacite/datacite_result_21.json
index 0a05a7cd..99dcad1b 100644
--- a/python/tests/files/datacite/datacite_result_21.json
+++ b/python/tests/files/datacite/datacite_result_21.json
@@ -1,5 +1,5 @@
{
- "extra": {},
+ "extra": {"datacite": {}},
"title": "ABC",
"release_type": "article",
"release_stage": "published",
@@ -12,4 +12,4 @@
"contribs": [],
"refs": [],
"abstracts": []
-} \ No newline at end of file
+}
diff --git a/python/tests/files/datacite/datacite_result_22.json b/python/tests/files/datacite/datacite_result_22.json
index 9e4225b5..30d75a3d 100644
--- a/python/tests/files/datacite/datacite_result_22.json
+++ b/python/tests/files/datacite/datacite_result_22.json
@@ -1,5 +1,5 @@
{
- "extra": {},
+ "extra": {"datacite": {}},
"title": "ABC",
"release_type": "article",
"release_stage": "published",
@@ -19,4 +19,4 @@
],
"refs": [],
"abstracts": []
-} \ No newline at end of file
+}
diff --git a/python/tests/files/datacite/datacite_result_23.json b/python/tests/files/datacite/datacite_result_23.json
index 46f60492..f79053df 100644
--- a/python/tests/files/datacite/datacite_result_23.json
+++ b/python/tests/files/datacite/datacite_result_23.json
@@ -1,5 +1,5 @@
{
- "extra": {},
+ "extra": {"datacite": {}},
"title": "ABC",
"release_type": "article",
"release_stage": "published",
@@ -19,4 +19,4 @@
],
"refs": [],
"abstracts": []
-} \ No newline at end of file
+}
diff --git a/python/tests/files/datacite/datacite_result_24.json b/python/tests/files/datacite/datacite_result_24.json
index 42859275..a7fc59ba 100644
--- a/python/tests/files/datacite/datacite_result_24.json
+++ b/python/tests/files/datacite/datacite_result_24.json
@@ -1,5 +1,5 @@
{
- "extra": {},
+ "extra": {"datacite": {}},
"title": "ABC",
"subtitle": "DEF",
"release_type": "article",