推理器不返回实例

时间:2013-02-14 15:52:59

标签: java ontology owl

当我这样做时,它不起作用

OWLClassExpression query = factory.getOWLObjectIntersectionOf(factory.getOWLClass("#belgique", pm))

reasoner.getInstances(查询,TRUE);

这个正在运作:

reasoner.getInstances(factory.getOWLClass("#belgique", pm),true);

但问题是我需要反对意见,因为我需要几种类型的实例

我甚至试过这个:

OWLClass newName = factory.getOWLClass(IRI.create("temp001"));
OWLAxiom definition = factory.getOWLEquivalentClassesAxiom(newName, query);
manager.addAxiom(ontology, definition);
reasoner.getInstances(newName,true)

它仍无法正常工作

1 个答案:

答案 0 :(得分:0)

getOWLObjectIntersectionOf是一种构建更复杂的类表达式的方法,该方法断言输入表达式之间的and关系,它通常不像这样单独使用(see there for backgroud)。

实施例: Mother = ObjectIntersectionOf(Woman, Parent) 此处的Mother定义为Woman a Parent是对象的交集。

您不必使用它来检索类的实例。在您使用getOWLClass()的情况下,应该完成这项工作。

相关问题