-1

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

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

reasoner.getInstances(query,true);

这个正在工作:

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

但问题是我需要 objectintersectionof 因为我需要属于几种类型的类的实例

我什至试过这个:

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

它仍然无法正常工作

4

1 回答 1

0

getOWLObjectIntersectionOf是一种构建更复杂的类表达式的方法,该方法断言and输入表达式之间的关系,通常不会像这样单独使用(参见那里的背景)。

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

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

于 2013-02-15T09:26:08.883 回答