Every object on the ADC (or the KNB) has “system metadata”. An object’s system metadata have information about the file itself, such as the name of the file (
fileName), the format (
formatId), who the
rightsHolder is, what the
accessPolicy is, and more. Sometimes we will need to edit system metadata in order to make sure that things on the webpage display correctly, or to ensure a file downloads from the website with the correct file name and extension.
Although the majority of system metadata changes that need to be made are done automatically, sometimes we need to change aspects of the system metadata (or ‘sysmeta’ for short) manually.
To edit the sysmeta of an object (data file, EML, or resource map, etc.) with a
PID, first load the sysmeta into R using the following command:
<- getSystemMetadata(mn, pid)sysmeta
Then edit the sysmeta slots by using
@ functionality. For example, to change the
fileName use the following command:
@fileName <- 'NewFileName.csv'sysmeta
Note that some slots cannot be changed by simple text replace (particularly the
accessPolicy). There are various helper functions for changing the
rightsHolder such as
datapack::addAccessRule() (which takes the sysmeta as an input) or
arcticdatautils::set_rights_and_access(), which only requires a
PID. In general, you most frequently need to use
dataone::getSystemMetadata() to change either the
fileName slots (see the DataONE list of format ids) for acceptable formats.
# Example of setting the formatId slot @formatId <- "eml://ecoinformatics.org/eml-2.1.1"sysmeta
After you have changed the necessary slot, you can update the system metadata using the following command:
updateSystemMetadata(mn, pid, sysmeta)
Importantly, changing the system metadata does NOT necessitate a change in the
PID of an object. This is because changes to the system metadata do not change the object itself, they are only changing the description of the object (although ideally the system metadata are accurate when an object is first published).
Sometimes the system doesn’t recognize the file types properly. For example you have a csv file but the File type on the website says
- Read the system metadata in from the data file you uploaded previously.
- Check to make sure the
formatIdare set correctly (the extension in
fileNameshould match the
- Update the system metadata if necessary.