ontologyowl-api

OWLApi include import closure for getAnnotations()


I am working with OWLAPI v3.5.2 on iterating over all classes via getClassesInSignature(true), including the imports closure of the current ontology, and I am wondering if there's a similar way to include the imports closure for getAnnotations() as well.

A very basic example would be the following:

for (OWLClass klass: ontology.getClassesInSignature(true)) {
   for (OWLAnnotation annotations: klass.getAnnotations(ontology, datafactory.getRDFSLabel())) {
      ...
   }
}

Currently, only rdfs:labels contained in the root ontology are found while classes originated from owl:imports are not.


Solution

  • It's available in 4.x, in OWLOntology and EntitySearcher. Not supported in 3.5.2 - it would be an interface change, so it's not going to be backported.