Expected result not entailed
----------------------------

                 Key: JENA-61
                 URL: https://issues.apache.org/jira/browse/JENA-61
             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] http://stackoverflow.com/questions/5803610/jena-recursive-reasoning-issue

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, 
this.baseM);

        OntResource r = baseM.createOntResource("http://example.com/r";);
        OntResource r1 = baseM.createOntResource("http://example.com/r1";);
        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, 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: http://www.atlassian.com/software/jira

Reply via email to