我已经知道如何从 OWL 类中获取注释(参见下面的 java 代码)。但我无法从 OWL 个人那里获得注释。谁能告诉我如何为 OWLIndividual 而不是 OWLClass 编写相同的功能?谢谢!
IRI iri = IRI.create("http://www.example.com/ontology/108024893-n"); //class IRI
OWLClass clazz = manager.getOWLDataFactory().getOWLClass(iri);
for (OWLAnnotation annotation : clazz.getAnnotations(ontology))
{
System.out.println("\nannotation value: "+annotation.getValue());
}