请问是否要在OWLClass element
之类的ObjectUnionOf OWLClassExpression
中提取ObjectUnionOf(<OWLClass> <OWLClass>)
, owl-api 中应使用哪种方法我用来获取这两个 OWLClasses ?
答案 0 :(得分:0)
方法是OWLObjectVisitor:
OWLObjectVisitorAdapter visitorAdapter = new OWLObjectVisitorAdapter() {
@Override
public void visit(OWLObjectUnionOf ce) {
for (OWLClassExpression e : ce.getOperands()) {
if (!e.isAnonymous()) {
System.out.println("VisitorAdaptor OWLClass:"+e);
}
}
}
};
classExpression.accept(visitorAdapter);