Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datacite: fix related identifiers serialization. #1583

Conversation

alejandromumo
Copy link
Member

@@ -362,7 +385,8 @@ def get_related_identifiers(self, obj):
default=scheme,
)

if id_scheme:
# Only serialize related identifiers with a valid scheme for DataCite.
if id_scheme and id_scheme.lower() in RELATED_IDENTIFIER_SCHEMES:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor: instead of that would it make sense to:

  • remove the "datacite": "Other" value from the RDM_RECORDS_IDENTIFIERS_SCHEMES config (we only need "valid" DataCite values there)
  • change it so that the get_scheme_datacite calls are a bit more strict? Right now I see default=scheme being passed in many places, which is wrong. We want to enforce that if there is not equivalent DataCite scheme for an identifier, it has to be skipped.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a task to tackle the invalid schemes.

We have more schemes that don't map to DataCite's related identifiers (e.g. crossreffunderid)

@@ -94,7 +94,6 @@ def always_valid(identifier):
"url": {"label": _("URL"), "validator": idutils.is_url, "datacite": "URL"},
"urn": {"label": _("URN"), "validator": idutils.is_urn, "datacite": "URN"},
"w3id": {"label": _("W3ID"), "validator": always_valid, "datacite": "w3id"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will it be that now all IDs will be identified as w3id, since it's the last entry with always_valid?

I'm not sure what the logic for scheme detecting is for related identifiers...

Copy link
Member Author

@alejandromumo alejandromumo Oct 27, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a quick look and it seems that this "fallback" does not happen, but I want to be more thorough with the analysis. I will do it in a separate task so we can unblock the fix for now

@alejandromumo alejandromumo force-pushed the fix_datacite_related_identifiers branch from 88ca365 to 0fc2be2 Compare October 27, 2023 12:48
@zzacharo zzacharo merged commit 7bca45a into inveniosoftware:master Oct 27, 2023
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants