Paul,
As far as I know, there hasn’t been a way to set these via API – as you found, the json add/edit/delete api calls in the native api are focused on the metadata in the blocks.
There is a new ‘experimental’ API that allows this - added in v5.6 and documented in the developers: https://guides.dataverse.org/en/latest/developers/dataset-semantic-metadata-api.html?highlight=semantic%20api . This API uses json-ld instead – the same format as in the OAI_ORE metadata export.
Copying and altering the example in the guides, setting the TermsOfUse field would be done with
curl -X PUT -H X-Dataverse-key:$API_TOKEN -H 'Content-Type: application/ld+json' -d '{" https://dataverse.org/schema/core#termsOfUse":"Some terms"}' "$SERVER_URL/api/datasets/$DATASET_ID/metadata?replace=true"
or
curl -X PUT -H X-Dataverse-key:$API_TOKEN -H 'Content-Type: application/ld+json' -d '{" dvcore:termsOfUse":"Some terms", "@context":{"dvcore":"https://dataverse.org/schema/core#"}}' "$SERVER_URL/api/datasets/$DATASET_ID/metadata?replace=true"
The other Terms fields are in the same namespace: e,g, confidentialityDeclaration, specialPermissions, restrictions, citationRequirements, depositorRequirements, conditions, and disclaimer.
In general, if you look in the ore:describes object in the OAI_ORE export, the semantic APIs use the same identifiers and sub-structure (i.e. for compound fields in metadata blocks). Aside from also supporting terms and licenses (which will be maintained as the multi-license support PR is added) one of the nice things about the semantic API is that it has a flatter structure.
FWIW: The API is ‘experimental’ and listed in the developer guide for a couple reasons – json-ld and the potential to use an @context for readability can be confusing, the API is new and has had less breadth of use than the earlier APIs, and it may be that the API itself and/or identifiers used may change at some point. That said, both DANS and Sciences PO are developing with it now and the DVUploader has an experimental capability to recreate a Dataset from the OAI_ORE file in an exported Bag using the semantic APIs and it works. If you find issues with it and/or limitations, please report them so we can make fixes. If you have further questions, just let me know.
-- Jim
--
You received this message because you are subscribed to the Google Groups "Dataverse Users Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
dataverse-commu...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/dataverse-community/ce35580f-1cdb-4076-bb0f-d3016f25c1efn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dataverse-community/CB93F92A-111D-41D4-974C-B68B1B8C1961%40ubc.ca.