Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions doc/release-notes/11793 - ext. vocab. improvements.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
This version of Dataverse includes extensions of the Dataverse External Vocabulary mechanism (https://guides.dataverse.org/en/latest/admin/metadatacustomization.html#using-external-vocabulary-services) that improve Dataverse's ability to include metadata about vocabulary terms and external identifiers such as ORCID and ROR in it's metadata exports. More information on how to configure external vocabulary scripts to use this functionality can be found at https://github.com/gdcc/dataverse-external-vocab-support/blob/main/docs/readme.md and in the examples in the https://github.com/gdcc/dataverse-external-vocab-support repository.
Original file line number Diff line number Diff line change
Expand Up @@ -764,13 +764,24 @@ Object processPathSegment(int index, String[] pathParts, JsonValue curPath, Stri
JsonValue val = jo.get(keyVal[0]);
if (val != null) {
if (val.getValueType().equals(ValueType.STRING)) {
//Match a string value
if (((JsonString) val).getString().equals(expected)) {
logger.fine("Found: " + jo);
curPath = jo;
return processPathSegment(index + 1, pathParts, curPath, termUri);
}
} else {
logger.warning("Expected a string value for " + keyVal[0] + " but found: " + val.getValueType());
} else if (val.getValueType() == JsonValue.ValueType.ARRAY) {
// Match one string in an array
JsonArray jsonArray = (JsonArray) val;
for (JsonValue arrayVal : jsonArray) {
if (arrayVal.getValueType() == JsonValue.ValueType.STRING) {
if (((JsonString) arrayVal).getString().equals(expected)) {
logger.fine("Found match in array: " + jo.toString());
curPath = jo;
return processPathSegment(index + 1, pathParts, curPath, termUri);
}
}
}
}
}
}
Expand Down