Metadata blocks can be updated, the technical process is similar to the initial integration. However, it is not yet documented how changes affect already captured metadata or the existing structure. The current implementation [1] simply overwrites the existing definitions, matching is based on the value of the "name" property of metadata blocks and dataset fields (or "value" for elements of the controlled vocabulary). As a result, names are globally unique and not per metadata block. Therefore, the behavior when updating metadata blocks must be considered undefined and risky!
To improve the situation it would be great if we could document and answer the following questions:
I absolutely agree. It should definitely be documented. @Johannes D would you be able to create an issue about this?
I faced this problem recently. I would be interested in this as well. I can at least add a user story or two ;)
That would be much appreciated!
Sure, can I'm also happy to write the documentation but I need some help grasping the functionality.
@Philip Durbin : I'm trying to understand the source code related to metadatablocks. I struggle to understand the purpose of DatasetFieldDefaultValue. My editor says there is no usage of the class/object. Is that correct?
I'm seeing 14 usages:
Screenshot-2023-09-19-at-6.37.01-AM.png
I do find it interesting that the project still compiles if I delete DatasetFieldDefaultValue and DefaultValueSet and only these lines:
diff --git a/src/main/java/edu/harvard/iq/dataverse/DatasetFieldType.java b/src/main/java/edu/harvard/iq/dataverse/DatasetFieldType.java
index 824b486a42..b328d46f3a 100644
--- a/src/main/java/edu/harvard/iq/dataverse/DatasetFieldType.java
+++ b/src/main/java/edu/harvard/iq/dataverse/DatasetFieldType.java
@@ -504,17 +504,6 @@ public class DatasetFieldType implements Serializable, Comparable<DatasetFieldTy
this.datasetFields = datasetFieldValues;
}
- @OneToMany(mappedBy = "datasetField", cascade = {CascadeType.REMOVE, CascadeType.MERGE, CascadeType.PERSIST})
- private List<DatasetFieldDefaultValue> datasetFieldDefaultValues;
-
- public List<DatasetFieldDefaultValue> getDatasetFieldDefaultValues() {
- return datasetFieldDefaultValues;
- }
-
- public void setDatasetFieldDefaultValues(List<DatasetFieldDefaultValue> datasetFieldDefaultValues) {
- this.datasetFieldDefaultValues = datasetFieldDefaultValues;
- }
-
@Override
public int compareTo(DatasetFieldType o) {
return Integer.compare(this.getDisplayOrder(), (o.getDisplayOrder()));
Maybe it was an experiment? And isn't actually used? I'm not sure.
I ignored the self usage. I tried the same and stated a new instance, toyed around and found no issues. Do you think it is save to remove the class?
I'd want to ask around internally first.
On a related note, here is my list of shortcomings I found in the metadata block spec:
@Philip Durbin I believe the same applies to DatasetDistributor as there is no object created in the codebase.. and DatasetKeyword without any usage.
@Johannes D maybe you could make a PR to delete all of it. I assume tests will pass. We can point other devs at it and ask if we need it.
Philip Durbin said:
Johannes D maybe you could make a PR to delete all of it. I assume tests will pass. We can point other devs at it and ask if we need it.
here it is: https://github.com/IQSS/dataverse/pull/9932
@Leo Andreev what do you think?
Last updated: Nov 01 2025 at 14:11 UTC