使用Java OWL API声明对象属性

时间:2018-08-31 06:42:48

标签: java owl owl-api

创建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))

1 个答案:

答案 0 :(得分:1)

getOWLDeclarationAxiom()方法对属性的作用与对类的作用相同,即

OWLObjectProperty hasValue = df.getOWLObjectProperty(IOR + "#hasValue");
OWLDeclarationAxiom d_hasValue = df.getOWLDeclarationAxiom(hasValue);