Closed jhpoelen closed 4 months ago
@gsautter - would you happen to have some examples on how to encode dwc custom fields in Zenodo metadata? For some reason, the associated Zenodo metadata produced by the Zenodo API cannot be used to submit metadata to update deposits.
For example:
curl "https://zenodo.org/api/records/10727949"\
| jq .metadata.custom
yields:
{
"dwc:family": [
"Solariellidae"
],
"dwc:genus": [
"Bathymophila"
],
"dwc:kingdom": [
"Animalia"
],
"dwc:order": [
"Trochida"
],
"dwc:phylum": [
"Mollusca"
],
"dwc:scientificNameAuthorship": [
"Dall"
],
"dwc:taxonRank": [
"genus"
],
"openbiodiv:TaxonomicConceptLabel": [
"Bathymophila Dall, 1881 sec. Herbert, 2024"
]
}
and shows up under the "biodiversity" section on the rendered webpage at https://zenodo.org/records/10727949 (see screenshot)
However, when I try to add the "custom" tag under metadata with the same values. . . the deposit is rejected by Zenodo.
@gsautter @slint How should I format a zenodo metadata json to include the informative custom dwc tags?
@jhpoelen can you share the 500 error body you're getting? The payload for custom fields looks like:
curl -X POST "$BASE_URL/api/deposit/depositions" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- << EOF
{
"metadata": {
...
"custom": {
"dwc:family": ["Felidae"],
"dwc:genus": ["Felis"],
"dwc:collectionCode": ["FSJK", "NHMUK", "NM"]
}
}
}
EOF
So similar to what you see coming back form the API. I suspect that you're getting some other type of error which we're not handling correctly (does removing the . just read again through the issue, it doesn't indeed)."custom"
key give back a good response?
Also, I wouldn't see the Lycophron documentation as a reference, since we're using it right now as an opportunity to update inputs based on the post-migration schema.
@slint thanks for your prompt reply. It appears I was dealing with a gremlin https://en.wikipedia.org/wiki/Gremlin, because my current sandbox integration test does appear to populate the biodiversity data fields.
I was able to upload metadata - https://github.com/bio-guoda/preston/blob/2554fecd89fb4945a29825ece7ade845c8ce1db0/preston-zenodo/src/test/resources/bio/guoda/preston/zenodo/zenodo-metadata-with-keywords.json
to produce the following draft sandbox deposit (see screenshot)
I now see the errors in my ways, and should be blaming those poor Gremlins. . .
I was providing:
"custom": [ { "dwc:kingdom": ["Animalia"] }, { ... ]
instead of the expected:
"custom": { "dwc:kingdom": ["Animalia"], ... }
Thanks for your guidance and patience.
Note that I was able to successfully upload a sandbox deposit that includes keywords as well as biodiversity domain specific dwc fields.
see https://sandbox.zenodo.org/records/32041
and attached screenshot.
@slint @myrmoteras thanks for your patience.
related to #5
@slint @myrmoteras - I am attempting to add dwc:kingdom etc. fields to deposit metadata records.
I tried
but Zenodo is not eating it and producing 500 error.
Removing the custom fields, but keeping the keywords work ok.
Would you happen to have an example of custom keyword submission . I dug around for quite awhile on GitHub / docs, but somehow was unable to find an example.