incubator-jena-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dan Leadgy (JIRA)" <>
Subject [jira] [Commented] (JENA-61) Expected result not entailed
Date Wed, 27 Apr 2011 16:18:03 GMT


Dan Leadgy commented on JENA-61:

[rdfs6:  (?p rdfs:subPropertyOf ?q), notEqual(?p,?q) -> [ (?a ?q ?b) <- (?a ?p ?b)]
[equality1: (?X owl:sameAs ?Y), notEqual(?X,?Y) -> [(?X ?P ?V) <- (?Y ?P ?V)] [(?V ?P
?X) <- (?V ?P ?Y)] ]

Looking at the OWL mini rules that Jena applies, I think the issue could be caused because
rdfs:subPropertyOf is defined as a hybrid rule and the owl:sameAs is only fired when querying
the model(at the time backward rules get fired).

Because owl:sameAs is defined also as a hybrid rule, it's forward definition (?X owl:sameAs
?Y) doesn't see the results of the subPropertyOf backward rule(which would assert that {r
owl:sameAs r1}), hence the rule for owl:sameAs never gets fired.

To overcome this issue, I think that making the inference twice would solve any similar issues.
For this, we could configure another OWLMini inferencer over the existing OWLMini inferencer:

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

This looks like a very hackish solution, but it seems to make the test case work successfully.

However, I believe there has to be a way to make this work without creating another inference
model on top of the existing inference model. Looking forward for any suggestions.

Thank you!

> Expected result not entailed
> ----------------------------
>                 Key: JENA-61
>                 URL:
>             Project: Jena
>          Issue Type: Bug
>          Components: Reasoners
>            Reporter: Ian Dickinson
>            Assignee: Dave Reynolds
> From a question on Stack Overflow [1]. The expected entailment `:r :my_property :a_value`
is not asserted in the inference model. As far as I can see, the OP is correct that this result
should be entailed.
> [1]
> Complete test case:
> ------------------------------------------------------------------
> package example;
> import static org.junit.Assert.assertTrue;
> import org.junit.Test;
> import com.hp.hpl.jena.ontology.*;
> import com.hp.hpl.jena.rdf.model.ModelFactory;
> import com.hp.hpl.jena.vocabulary.OWL;
> public class InfTest
> {
>     OntModel baseM, infM;
>     @Test
>     public void test1() {
>         this.baseM = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM);
>         // also fails with MICRO_RULE_INF
>         this.infM = ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM_MINI_RULE_INF,
>         OntResource r = baseM.createOntResource("");
>         OntResource r1 = baseM.createOntResource("");
>         OntProperty myProperty = baseM.createOntProperty("");
>         OntResource v = baseM.createOntResource("");
>         OntProperty mySameAs = baseM.createOntProperty("");
>         baseM.add(mySameAs, OWL.equivalentProperty, OWL.sameAs);
>         r1.addProperty(myProperty, v);
>         r.addProperty(mySameAs, r1);
>         infM.rebind();
>         //infM.writeAll( System.out, "Turtle", null );
>         assertTrue(infM.contains(r, myProperty, v));
>     }
> }
> ------------------------------------------------------------------

This message is automatically generated by JIRA.
For more information on JIRA, see:

View raw message