softwarepub / hermes

Implementation of the HERMES workflow
https://docs.software-metadata.pub
Other
21 stars 6 forks source link

Invenio RDM license identifiers are lowercase, while spdx links are not, causing deposit to fail #224

Closed broeder-j closed 1 year ago

broeder-j commented 1 year ago

Invenio RDM exposes the licenses ids in lowercase in the API (At least for zenodo and zenodo sandbox):

i.e For the MIT license: valid endpoint:

https://sandbox.zenodo.org/api/vocabularies/licenses/mit Non valid endpoint https://sandbox.zenodo.org/api/vocabularies/licenses/MIT

Since all SPDX links have Uppercase or mixed, but not lowercase (https://spdx.org/licenses/MIT) This code part https://github.com/hermes-hmc/workflow/blob/5726d30e9b11a161034588f3c897debb7ef8f968/src/hermes/commands/deposit/invenio.py#L556-L560 will fail. i.e the license id probably has to be converted to lowercase. I am currently not sure if this will work for all identifiers. Or better, one first has to extract an 'identifier mapping' from an API endpoint.

This currently causes Hermes deposit with:

Error in 'hermes.deposit.publish' entry point 'invenio': Not a valid license identifier: MIT

Hermes config:

[harvest]
from = [ "git", "cff" ]

[harvest.cff]
validate = false

[deposit]
mapping = "invenio"
target = "invenio"

[deposit.invenio]
site_url = "https://sandbox.zenodo.org"
access_right = "open"

[deposit.invenio.api_paths]
depositions = "api/deposit/depositions"
licenses = "api/vocabularies/licenses"
communities = "api/communities"

[postprocess]
execute = [ "config_record_id" ]
led02 commented 1 year ago

Thanks for the hint. There is already a branch / PR associated with this: #222

However, simply "lower-casing" is not the answer here... better would be to:

Edit: Unfortunately, the vocabulary at https://zenodo.org/api/vocabularies/licenses does not list the https://spdx.org URLs but the https://opensource.org URLs