创建OWL类的声明很容易,即
Declaration(Class(:ComponentIT))
使用java OWL API v5
:
OWLClass A = df.getOWLClass(IOR + "#ComponentIT");
OWLDeclarationAxiom da = df.getOWLDeclarationAxiom(A);
问题是如何使用OWL API创建对象属性声明(插入OWLOntology对象的公理),即
Declaration(ObjectProperty(:hasValue))
getOWLDeclarationAxiom()方法的工作方式与类相同,即
OWLObjectProperty hasValue = df.getOWLObjectProperty(IOR + "#hasValue");
OWLDeclarationAxiom d_hasValue = df.getOWLDeclarationAxiom(hasValue);