开发者

Jena recursive reasoning issue

开发者 https://www.devze.com 2023-03-01 04:36 出处:网络
In the below example, the infM doesn\'t infer that {r myProperty v}, any ideas why? However, it does infer that {r owl:sameAs r1} from the mySameAs asserted statement. But if I write:

In the below example, the infM doesn't infer that {r myProperty v}, any ideas why?

However, it does infer that {r owl:sameAs r1} from the mySameAs asserted statement. But if I write:

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

then it also outputs that {r myProperty v}

Example code:

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 myProper开发者_如何学Goty = 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));


This looks like a bug to me. I've logged it as jena-61 on the Apache Jena Jira.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号