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

Output .zenodo.json #100

Open
hlmore opened this issue Oct 8, 2024 · 1 comment
Open

Output .zenodo.json #100

hlmore opened this issue Oct 8, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@hlmore
Copy link

hlmore commented Oct 8, 2024

Zenodo is a popular repository to assign code a DOI. Code owners can either upload an archive of code and manually fill out the metadata fields, or use the GitHub-Zenodo integration to automatically generate a DOI and landing page each time a new version of code is released.

When using the GitHub-Zenodo integration, if the GitHub repository contains a .zenodo.json file, Zenodo uses metadata from this file instead of requiring metadata to be entered manually.

More recently, Zenodo added support for CITATION.cff, and will use metadata from a CITATION.cff file if no .zenodo.json file is present. However, CITATION.cff doesn't yet support all the fields that .zenodo.json does.

In particular, Zenodo supports a grants field which is crucial for scientific researchers required to report grant funding for their project outputs. For European Commission grants, Zenodo allows researchers to only enter the grant number, which is extremely convenient for the many people receiving this funding.

It would be very useful if Somesy included an option to output a .zenodo.json file alongside the existing CITATION.cff and codemeta.json files, and supported more of Zenodo's metadata fields.

If Somesy did this, I would suggest that some of the most urgent Zenodo-specific fields to add would be:

  • contributors
  • related_identifiers
  • grants
  • upload_type

Unfortunately just adding fields to the current CITATION.cff output by Somesy isn't sufficient, since cff doesn't (yet) support all of Zenodo's metadata fields.

Supported fields in:

@hlmore hlmore added the enhancement New feature or request label Oct 8, 2024
@daniel-mohr
Copy link

Yes, the output of .zenodo.json would really be a useful improvement as there are many more fields available.

But I don't think this only makes sense for GitHub. There is already an integration for GitHub that also supports CITATION.cff.

However, this integration is limited to GitHub and lacks comparable functionality for other open source platforms such as GitLab or Gitea.

That's why I created the deploy2zenodo tool.

When deploying deploy2zenodo to zendoo, I even supplement the CITATION.cff in the first step with current information that is only available in a CI pipeline, for example:

TMPCITATION=$(mktemp)
yq --yaml-output ".url = \"$CI_PROJECT_URL/-/releases/$TAG\" | .commit = \"$TAG_COMMIT_SHA\" | .version = \"$TAG\" | .\"date-released\" = \"$TAG_COMMIT_TIMESTAMP\" | .identifiers[0].description = \"The DOI of this release.\" | .identifiers[0].value = \"$DOI\" | .identifiers[0].type = \"doi\" | .doi = \"$DOI\"" "$CITATION" | tee "$TMPCITATION"
mv "$TMPCITATION" "$CITATION"
cffconvert -i "$CITATION" --validate

In a later step, I add static information, for example:

cffconvert -i CITATION.cff -f zenodo | \
jq -c --argjson mixin \
"$(jq .metadata.related_identifiers "zenodo-add-related_identifiers.json")" \
--rawfile README "$tmpreadme" \
"{\"metadata\": .} | .metadata.description = \$README |
          .metadata.url = \"$tagurl\" |
          .metadata.related_identifiers += [
            {\"relation\": \"isDerivedFrom\",
             \"identifier\": \"$projecturl\",
             \"scheme\": \"url\",
             \"resource_type\": \"software\"},
            {\"relation\": \"isSupplementTo\",
             \"identifier\": \"$tagurl\",
             \"scheme\": \"url\",
             \"resource_type\": \"software\"},
             {\"relation\":\"IsNewVersionOf\",
             \"identifier\":\"$LATESTDOI\",
             \"scheme\":\"doi\",
             \"resource_type\":\"$LATESTUPLOADTYPE\"}] |
          .metadata.related_identifiers += \$mixin" | \
cat "zenodo-merge.json" - | jq -c -s '.[0] * .[1]' | \
tee "$DEPLOY2ZENODO_JSON" | jq -C .

This means that in addition to the output of .zenodo.json, the dynamic input would also be an improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants