javaowlowl-api

Cannot Get Annotations for OWLClass in OWLAPI


I am using OWLAPI 4.0.1 as a global library from Maven in IntelliJ. I am seeing many examples on the Web for how to get annotations for a class (such as the one in this related question), but IntelliJ tells me there is no such getAnnotations() method. Other API code works fine, and I'm able to find classes and properties in an ontology. Has the OWLAPI changed, or am I missing something?


Solution

  • Yes, this has changed in OWLAPI 4. Use EntitySearcher.getAnnotationObjects(cls.getIRI(), ontology) instead.

    To search over the imports closure, pass the closure instead of the single ontology.