You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Leadgy <le...@gmail.com> on 2011/04/27 17:15:06 UTC

Jena recursive reasoning issue

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 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));


also posted at: 
http://answers.semanticweb.com/questions/8985/jena-recursive-reasoning-issue 


Re: Jena recursive reasoning issue

Posted by Dave Reynolds <da...@gmail.com>.
On Wed, 2011-04-27 at 18:15 +0300, Leadgy wrote: 
> 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}

Yes, as you surmised on JIRA, this is because the rule reasoners limit
the set of entailments through the use of layered reasoning - some
forward closure followed by backward closure over the results.  This
means they are not complete for OWL full cases where you do things like
alias the OWL properties themselves.

This was a deliberate trade-off to get performance to more acceptable
levels than a pure forward (or backward) solution offered.

It's not clear what to do about this.

It would be possible to modify the rule set to handle this sort of
situation but with a performance cost for people who don't need such OWL
fullness. Given the rather small number of times this issue has come up
over the last 7 years since the reasoners were developed I suspect its a
minority requirement :)

It would be possible to generate a specialist OWL full rule set which
makes different completeness/performance trade-offs. But that would have
a maintenance and support cost.

It would be lovely to have time to develop a more complete and more
scalable reasoning solution but in the absence of funding that's not an
option.

Dave


> /_*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 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));
> 
> 
> also posted at: 
> http://answers.semanticweb.com/questions/8985/jena-recursive-reasoning-issue 
>