耶拿递归推理问题

时间:2011-04-27 11:51:50

标签: jena reasoning

在下面的示例中,infM没有推断出{r myProperty v},为什么会有任何想法?

但是,它确实从mySameAs断言语句推断出{r owl:sameAs r1}。但如果我写:

this.infM = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_MINI_RULE_INF, this.baseM);
this.infM = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_MINI_RULE_INF, this.infM);

然后它还输出{r myProperty v}

示例代码:

this.baseM = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
this.infM = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_MINI_RULE_INF, this.baseM);

OntResource r = baseM.createOntResource(null);
OntResource r1 = baseM.createOntResource(null);
OntProperty myProperty = baseM.createOntProperty("http://example.com#my_property");
OntResource v = baseM.createOntResource("http://example.com#a_value");
OntProperty mySameAs = baseM.createOntProperty("http://example.com#mySameAs");
baseM.add(mySameAs, RDFS.subPropertyOf, OWL.sameAs);

r1.addProperty(myProperty, v);
r.addProperty(mySameAs, r1);

infM.rebind();

assertTrue(infM.contains(r, myProperty, v));

1 个答案:

答案 0 :(得分:1)

对我来说这看起来像个错误。我在Apache Jena Jira上将其记录为jena-61