-
Notifications
You must be signed in to change notification settings - Fork 87
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
datacite: fix related identifiers serialization. #1583
Conversation
@@ -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: |
There was a problem hiding this comment.
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 theRDM_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 seedefault=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.
There was a problem hiding this comment.
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)
invenio_rdm_records/config.py
Outdated
@@ -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"}, |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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
88ca365
to
0fc2be2
Compare
closes https://github.com/zenodo/rdm-project/issues/472