use all ontologies in closure when looking for annotations on deprecated classes
@@ -99,10 +99,11 @@ public class RepairOperation {
for (InvalidReferenceViolation v : violations) {
if (v.getCategory().equals(Category.DEPRECATED)) {
OWLEntity obsObj = v.getReferencedObject();
- logger.info("Finding replacements for: "+obsObj);
+ logger.info("Finding replacements for: "+v);
IRI replacedBy = null;
- for (OWLAnnotationAssertionAxiom aaa : ontology.getAnnotationAssertionAxioms(obsObj.getIRI())) {
- // TODO: use a vocabulary object
+ for (OWLOntology o : ontology.getImportsClosure()) {
+ for (OWLAnnotationAssertionAxiom aaa : o.getAnnotationAssertionAxioms(obsObj.getIRI())) {
+ // TODO: use a vocabulary class
if (aaa.getProperty().getIRI().equals(IRI.create("http://purl.obolibrary.org/obo/IAO_0100001"))) {
OWLAnnotationValue val = aaa.getValue();
Optional<IRI> valIRI = val.asIRI();
@@ -119,6 +120,7 @@ public class RepairOperation {
}
}
}
+ }
if (replacedBy != null) {
renameMap.put(obsObj, replacedBy);
}
