Updating variable metadata via the `/api/edit` API endpoint not working as expected

50 views
Skip to first unread message

w. Patrick Gale

unread,
Jul 28, 2022, 5:36:17 PM7/28/22
to Dataverse Users Community
I cannot find any documentation on WHAT can be updated with regards to editing variable metadata as mentioned in 

I downloaded the variable metadata ddi.xml file for one of my tabular data files and tried adding categories to a variable by adding the following to the ddi.xml file:
            <catgry>
                <catValu>0</catValu>
                <labl level="category">No</labl>
            </catgry>
            <catgry>
                <catValu>1</catValu>
                <labl level="category">Yes</labl>
            </catgry>
... then tried to update the variable metadata in Dataverse by uploading the updated ddi.xml file via the API call (api/edit/{fileId}). However, the API simply returned 'Nothing to update'. I don't know how else to add categories to the variable metadata and this API endpoint does not seem to recognize changes to the variable metadata files.

Has anyone else tried doing this and had success?

The code for `dataverse/EditDDI.java at 096e3c30900e6d50873a4b6c9896f6ad7808bd8c · IQSS/dataverse (github.com)` has no comments so I have no idea what the intended function of this API endpoint is nor what the expected behavior should be.

thank you

Victoria Lubitch

unread,
Aug 4, 2022, 12:11:37 PM8/4/22
to Dataverse Users Community
One cannot add categories using this API. Only labels, questions, weights and groups can be edited. You can use "Data Curation Tool" in "Edit File"->"Data Curation Tool"  (if it is enabled in your instalation) to edit variable level metadata. This API was written for this tool.

Victoria Lubitch

unread,
Aug 4, 2022, 12:25:22 PM8/4/22
to Dataverse Users Community

w. Patrick Gale

unread,
Aug 4, 2022, 5:28:01 PM8/4/22
to Dataverse Users Community
Thank you for the clarification. The Data Curation Tool is not very useful. I have tons of datasets and no interest of manually going into a UI to add categories to my variable metadata when I have it ready to process in an automated fashion. 
Reply all
Reply to author
Forward
0 new messages