243 draft doi sent to datacite incorrectly and incompletely maps some fields #259
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This pull request addresses several discrepancies noted in the DataCite Fabrica when reviewing draft DOIs for submitted metadata records. Previously, there were a number of fields either incorrectly mapped or left empty, leading to incomplete metadata. The changes made ensure that:
The URL element in DataCite is no longer left empty. It is now dynamically generated using the dataset UUID and appended to "https://catalogue.hakai.org/dataset/ca-cioos_".
Author names are correctly shown in the creators' list, along with their affiliations which are now properly nested under each creator in the JSON object sent to Datacite.
The Datacite Resource type general is auto-populated as 'Dataset'.
Dynamic setting of the prefix based on the region instead of using a hardcoded value.
Motivation and Context
These changes fix the open issue #243
How has this been tested?
The changes have been thoroughly tested with the following approaches:
Unit tests were added specifically for the recordToDataCite function to ensure proper mapping and generation of fields moving forward.
Manual testing was conducted to verify that the draft DOIs now contain complete and correctly mapped metadata and appear as expected in DataCite Fabrica. Cross-referencing with existing metadata records to ensure consistency and accuracy in the creator's list etc.