@FunctionalInterface public interface OntologyValidator
private static OntologyValidator checkDuplicateInDatabaseValidator() {
return (ontology, identifier) -> {
GenericRejectionCause rejection = null;
boolean exist = ... exists in database?;
if (exist) {
rejection = GenericRejectionCause.rejectDuplicatedInDatabase(identifier);
}
return (rejection == null) ? Optional.empty() : Optional.of(rejection);
};
}
Call the method like this to validate the ontology ontm:
GenericRejectionCause rejection = checkDuplicateInDatabaseValidator().validate(aup, aup.getName());
Check if rejection is present then do the resolution| Modifier and Type | Interface and Description |
|---|---|
static class |
OntologyValidator.RejectionCause
Rejection Cause
|
| Modifier and Type | Method and Description |
|---|---|
Optional<OntologyValidator.RejectionCause> |
validate(OntologyModel ontology)
Validate an ontology object
|
Optional<OntologyValidator.RejectionCause> validate(OntologyModel ontology)
ontology - to validateCopyright © 2020 Vitam. All rights reserved.