Skip to content

Commit

Permalink
MET-6302: Support for two new concept fields for dereferenced entitie…
Browse files Browse the repository at this point in the history
…s only.
  • Loading branch information
jochen-vermeulen committed Dec 20, 2024
1 parent 43cf962 commit 2615a89
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -116,19 +116,19 @@ public void execute(EnforcerRuleHelper enforcerRuleHelper) throws EnforcerRuleEx
final Path vocabularyDirectory = baseDirectory.resolve(vocabularyDirectoryFile);

try {
// Prepare validation
final VocabularyCollectionImporter importer = vocabularyCollectionImporterFactory
.createImporter(baseDirectory, vocabularyDirectory);
final VocabularyCollectionValidatorImpl validator = new VocabularyCollectionValidatorImpl(
importer, lenientOnLackOfExamples, lenientOnMappingTestFailures,
lenientOnExampleRetrievalFailures);
log.info("");
log.info("Validating vocabulary collection: " + importer.getDirectoryLocation().toString());
// Prepare validation
final VocabularyCollectionImporter importer = vocabularyCollectionImporterFactory
.createImporter(baseDirectory, vocabularyDirectory);
final VocabularyCollectionValidatorImpl validator = new VocabularyCollectionValidatorImpl(
importer, lenientOnLackOfExamples, lenientOnMappingTestFailures,
lenientOnExampleRetrievalFailures);
log.info("");
log.info("Validating vocabulary collection: " + importer.getDirectoryLocation().toString());

// Perform validation
// Perform validation

validator.validate(vocabulary -> log.info(" Vocabulary found: " + vocabulary.getName()),
log::warn);
log::warn);
} catch (VocabularyImportException e) {
log.error(e.getMessage());
throw new EnforcerRuleException("Vocabulary collection validation failed.", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ public class Concept extends EnrichmentBase {
private List<Resource> broadMatch;
@XmlElement(name = "closeMatch", namespace = "http://www.w3.org/2004/02/skos/core#")
private List<Resource> closeMatch;
/** Supported for serving in dereference API, not in the wider aggregation workflow. **/
@XmlElement(name = "definition", namespace = "http://www.w3.org/2004/02/skos/core#")
private List<Label> definitions;
@XmlElement(name = "exactMatch", namespace = "http://www.w3.org/2004/02/skos/core#")
private List<Resource> exactMatch;
@XmlElement(name = "inScheme", namespace = "http://www.w3.org/2004/02/skos/core#")
Expand All @@ -39,6 +42,9 @@ public class Concept extends EnrichmentBase {
private List<Resource> related;
@XmlElement(name = "relatedMatch", namespace = "http://www.w3.org/2004/02/skos/core#")
private List<Resource> relatedMatch;
/** Supported for serving in dereference API, not in the wider aggregation workflow. **/
@XmlElement(name = "scopeNote", namespace = "http://www.w3.org/2004/02/skos/core#")
private List<Label> scopeNotes;

/**
* Default constructor.
Expand Down Expand Up @@ -94,6 +100,14 @@ public void setCloseMatch(List<Resource> closeMatch) {
this.closeMatch = cloneListAcceptingNull(closeMatch);
}

public List<Label> getDefinitions() {
return unmodifiableListAcceptingNull(definitions);
}

public void setDefinitions(List<Label> definitions) {
this.definitions = cloneListAcceptingNull(definitions);
}

public List<Resource> getExactMatch() {
return unmodifiableListAcceptingNull(exactMatch);
}
Expand Down Expand Up @@ -142,6 +156,14 @@ public void setRelatedMatch(List<Resource> relatedMatch) {
this.relatedMatch = cloneListAcceptingNull(relatedMatch);
}

public List<Label> getScopeNotes() {
return unmodifiableListAcceptingNull(scopeNotes);
}

public void setScopeNotes(List<Label> scopeNotes) {
this.scopeNotes = cloneListAcceptingNull(scopeNotes);
}

private void init(eu.europeana.entitymanagement.definitions.model.Concept concept) {
this.hiddenLabel = convertListToLabel(concept.getHiddenLabel());
this.notation = convertMultilingualMapToLabel(concept.getNotation());
Expand Down

0 comments on commit 2615a89

Please sign in to comment.