From e925c3e75fd5ded1eab8274824acf5552fd2e1eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szczepanik?= Date: Fri, 7 Jul 2023 12:52:38 +0200 Subject: [PATCH 1/2] Fix publication doi translation for datacite_gin Now uses a case-insensitive replacement (accepting both "doi:" and "DOI:" prefix in translated metadata) and returns the DOI as https://doi.org/... (no www) because this is the format expected by the catalog for nice rendering. --- datalad_catalog/translators/datacite_gin_translator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/datalad_catalog/translators/datacite_gin_translator.py b/datalad_catalog/translators/datacite_gin_translator.py index 3d1e2726..45382d9b 100644 --- a/datalad_catalog/translators/datacite_gin_translator.py +++ b/datalad_catalog/translators/datacite_gin_translator.py @@ -143,7 +143,7 @@ def get_publications(self): '{"type":"", ' '"title":$pubin["citation"], ' '"doi":' - '($pubin["id"] | sub("DOI:"; "https://www.doi.org/")), ' + '($pubin["id"] | sub("(?i)DOI:"; "https://doi.org/")), ' '"datePublished":"", ' '"publicationOutlet":"", ' '"authors": []}]' From abd9d3966b4f857bfd018383d16bc5588f4c89f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Szczepanik?= Date: Fri, 7 Jul 2023 14:38:14 +0200 Subject: [PATCH 2/2] Update expected data for test_workflow This commit is a manual change to the expected doi value, replacing `doi:` with `https://doi.org/` in response to the change introduced in e925c3e. The updated values are consistent e.g. with the doi formatting in `workflow_generated_meta_super.json`. --- datalad_catalog/tests/data/workflow_generated_meta_sub.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/datalad_catalog/tests/data/workflow_generated_meta_sub.json b/datalad_catalog/tests/data/workflow_generated_meta_sub.json index cef03fef..222fda09 100644 --- a/datalad_catalog/tests/data/workflow_generated_meta_sub.json +++ b/datalad_catalog/tests/data/workflow_generated_meta_sub.json @@ -140,7 +140,7 @@ { "type": "", "title": "Sengupta, A., Kaule, F. R., Guntupalli, J. S., Hoffmann, M. B., H\u00e4usler, C., Stadler, J., Hanke, M. (2016). A studyforrest extension, retinotopic mapping and localization of higher visual areas. Scientific Data, 3, 160093.", - "doi": "doi:10.1038/sdata.2016.93", + "doi": "https://doi.org/10.1038/sdata.2016.93", "datePublished": "", "publicationOutlet": "", "authors": [] @@ -148,10 +148,10 @@ { "type": "", "title": "Hanke, M, Adelh\u00f6fer, N, Kottke, D, Iacovella, V, Sengupta, A, Kaule, FR, Nigbur, R, Waite, AQ, Baumgartner, F, Stadler, J (2016). A studyforrest extension, simultaneous fMRI and eye gaze recordings during prolonged natural stimulation. Scientific Data, 3, 160092.", - "doi": "doi:10.1038/sdata.2016.92", + "doi": "https://doi.org/10.1038/sdata.2016.92", "datePublished": "", "publicationOutlet": "", "authors": [] } ] -} \ No newline at end of file +}