Skip to content
Open
Show file tree
Hide file tree
Changes from all 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
Original file line number Diff line number Diff line change
Expand Up @@ -635,39 +635,43 @@ protected List<ConceptModel> mapThemesConcepts(MDKeywordsPropertyType descriptiv
}

protected String mapThemesTitle(MDKeywordsPropertyType descriptiveKeyword, String uuid) {
return safeGet(() -> descriptiveKeyword.getMDKeywords().getThesaurusName().getAbstractCitation())
String title = safeGet(() -> descriptiveKeyword.getMDKeywords().getThesaurusName().getAbstractCitation())
.map(citation -> {
if(citation.getValue() instanceof CICitationType2 thesaurusNameType2) {
CharacterStringPropertyType titleString = thesaurusNameType2.getTitle();
if (titleString != null
&& titleString.getCharacterString() != null
&& titleString.getCharacterString().getValue() instanceof AnchorType value) {
return (value.getValue() != null ? value.getValue() : "");
return value.getValue();
}
else if (titleString != null
&& titleString.getCharacterString() != null
&& titleString.getCharacterString().getValue() instanceof String value) {
return value;
}
}
return "";
return null;
})
.orElseGet(() -> {
// If no thesaurusName, try to use type as title
// make sure it is really not a thesaurusName
if (safeGet(() -> descriptiveKeyword.getMDKeywords().getThesaurusName()).isEmpty()) {
var type = safeGet(() -> descriptiveKeyword.getMDKeywords().getType().getMDKeywordTypeCode().getCodeListValue());
if (type.isPresent()) {
if (type.get().isEmpty()) {
return "Keywords";
}
return String.format("Keywords (%s)", capitalizeFirstLetter(type.get()));
}
.orElse(null);

}
logger.debug("Unable to find themes' title for metadata record: {}", uuid);
return "";
});
// If no thesaurusName, try to use type as title
// make sure it is really not a thesaurusName
if (title == null || title.trim().isEmpty()) {
if (safeGet(() -> descriptiveKeyword.getMDKeywords().getThesaurusName()).isEmpty()) {
var type = safeGet(() -> descriptiveKeyword.getMDKeywords().getType().getMDKeywordTypeCode().getCodeListValue());
if (type.isPresent() && !type.get().isEmpty()) {
title = String.format("Keywords (%s)", capitalizeFirstLetter(type.get()));
}
}
}

// Use title if valid, otherwise use default "Descriptive Keyword"
if (title == null || title.trim().isEmpty()) {
logger.debug("Using default 'Descriptive Keyword' title for metadata record: {}", uuid);
return "Descriptive Keyword";
}

return title;
}

protected String mapThemesDescription(MDKeywordsPropertyType descriptiveKeyword, String uuid) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -617,138 +617,138 @@
"id" : "Current direction in the water body",
"url" : "http://vocab.nerc.ac.uk/collection/P01/current/LCDAZZ01",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "Current speed in the water body",
"url" : "http://vocab.aodn.org.au/def/discovery_parameter/entity/383",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "Eastward current velocity in the water body",
"url" : "http://vocab.nerc.ac.uk/collection/P01/current/LCEWZZ01",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "Northward current velocity in the water body",
"url" : "http://vocab.nerc.ac.uk/collection/P01/current/LCNSZZ01",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "Upward current velocity in the water body",
"url" : "http://vocab.nerc.ac.uk/collection/P01/current/LRZAZZZZ",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "Practical salinity of the water body",
"url" : "http://vocab.nerc.ac.uk/collection/P01/current/PSLTZZ01",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "Temperature of the water body",
"url" : "http://vocab.nerc.ac.uk/collection/P01/current/TEMPPR01",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "Pressure (measured variable) in the water body exerted by overlying sea water and any medium above it",
"url" : "http://vocab.aodn.org.au/def/discovery_parameter/entity/565",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "Pressure (measured variable) in the water body exerted by overlying sea water only",
"url" : "http://vocab.aodn.org.au/def/discovery_parameter/entity/566",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "Gravity",
"url" : "http://vocab.ndg.nerc.ac.uk/term/P011/667/GRAVFLDX",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "Sub-bottom structure",
"url" : "N/A",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "Abundance of biota",
"url" : "http://vocab.aodn.org.au/def/discovery_parameter/entity/488",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "Biovolume",
"url" : "http://vocab.aodn.org.au/def/discovery_parameter/entity/22",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "Sea-floor depth below surface of the water body",
"url" : "http://vocab.aodn.org.au/def/discovery_parameter/entity/574",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "Sea-floor surface hardness",
"url" : "N/A",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "Density of the water body",
"url" : "http://vocab.aodn.org.au/def/discovery_parameter/entity/401",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
} ],
"scheme" : ""
}, {
"concepts" : [ {
"id" : "research vessel",
"url" : "http://vocab.nerc.ac.uk/collection/L06/current/31",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
} ],
"scheme" : ""
}, {
"concepts" : [ {
"id" : "current profilers",
"url" : "http://vocab.nerc.ac.uk/collection/L05/current/115",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "lowered current profilers",
"url" : "http://vocab.nerc.ac.uk/collection/L05/current/116/",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "CTD",
"url" : "http://vocab.nerc.ac.uk/collection/L05/current/130",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "gravimeters",
"url" : "http://vocab.nerc.ac.uk/collection/L05/current/158/",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "2000 Hz top-bandwidth sub-bottom penetrator and mud profiler systems",
"url" : "http://vocab.nerc.ac.uk/collection/L05/current/367/",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "Fish-finder echosounders",
"url" : "http://vocab.nerc.ac.uk/collection/L05/current/FFES",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "multi-beam echosounders",
"url" : "http://vocab.nerc.ac.uk/collection/L05/current/157",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "thermosalinographs",
"url" : "http://vocab.nerc.ac.uk/collection/L05/current/133",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
}, {
"id" : "bathythermographs",
"url" : "http://vocab.nerc.ac.uk/collection/L05/current/132",
"description" : "",
"title" : ""
"title" : "Descriptive Keyword"
} ],
"scheme" : ""
}, {
Expand Down
Loading
Loading