Over at https://guides.dataverse.org/en/6.6/api/native-api.html#editing-variable-level-metadata we have docs for an API that lets you edit variable level metadata. It was originally added in #5616 by @Victoria Lubitch. I'm having trouble getting it to work.
There's a dct.xml file provided but I assume it won't "just work".
I assume I should first download variable-level DDI from my file from $SERVER_URL/api/v1/access/datafile/$FILE_ID/metadata/ddi (docs), edit it, and use that. Does that sound right?
I just started playing with this as well. I downloaded variable level ddi from the record, changed it and ran the api call to edit it. That seemed to work well.
The results are that I see the proper DDI with the changes when I fetch it via the API. But should I also see it in the GUI when I download the DDI for a file? I'm not seeing the changes there, even after I publish the file. I half suspect that I need to re-run some back end process to regenerate them for the UI?
You might need to reexport that dataset: https://guides.dataverse.org/en/6.7.1/admin/metadataexport.html#batch-exports-through-the-api
Does that run at a regular interval, or only when a record is re/published? (or when someone runs it explicitly like during an upgrade)
Only when a dataset is republished.
We ask people to reexport in release notes, sometimes, if we change something.
For 6.7 we updated the Croissant export, for example. So we advise people to reexport all.
Reexporting on a dataset should also work with the file metadata? Or do I need to do something separate for that? I'm not seeing the file level
variable changes in the metadata yet.
I did this for the dataset:
curl http://localhost:8080/api/admin/metadata/:persistentId/reExportDataset?persistentId=doi:10.5072/FK2/F8WTAD
and I get a message it's started and see a success in the log.
(dataverse version 5.14, for reference)
The file metadata should come along for the ride. :rocket:
fwiw, I am seeing this after I re-publish a dataset after a change to the file's metadata:
[#|2025-08-18T21:16:27.600+0000|SEVERE|Payara 5.2022.5|javax.enterprise.resource.webcontainer.jsf.context|_ThreadID=96;_ThreadName=http-thread-pool::jk-connector(4);_TimeMillis=1755551787600;_LevelValue=1000;|
javax.faces.view.facelets.TagAttributeException: /dataset.xhtml @93,82 test="#{not empty DatasetPage.getSignpostingLinkHeader()}" /dataset.xhtml @93,82 test="#{not empty DatasetPage.getSignpostingLinkHeader()}": java.lang.NullPointerException
at com.sun.faces.facelets.tag.TagAttributeImpl.getObject(TagAttributeImpl.java:318)
at com.sun.faces.facelets.tag.TagAttributeImpl.getBoolean(TagAttributeImpl.java:109)
at com.sun.faces.facelets.tag.jstl.core.IfHandler.apply(IfHandler.java:50)
at javax.faces.view.facelets.CompositeFaceletHandler.apply(CompositeFaceletHandler.java:55)
at com.sun.faces.facelets.tag.ui.DefineHandler.applyDefinition(DefineHandler.java:65)
I'm guessing that the generation of the updated export files are failing in our setup due to (it seems like) the workingVersion in the DatasetPage.java is not set for some reason. Weird.
Actually, looks like I'm running into: https://github.com/IQSS/dataverse/issues/9954
This may be preventing the generation of the new files... Interesting.
Yikes, yes, interesting is one way to put it. :grimacing:
Last updated: Nov 01 2025 at 14:11 UTC