@Test /** * Tests for the bug reported in #150 */ public void test150_1() { createReasoner(OWL.disjointProperties(_p, OWL.inverse(_q))); assertTrue(_reasoner.isEntailed(OWL.disjointProperties(_p, OWL.inverse(_q)))); }
@SuppressWarnings("unused") @Test public void testPunning2() throws Exception { final OWLObjectProperty P = OWL.ObjectProperty("P"); final OWLObjectProperty S = OWL.ObjectProperty("S"); final OWLIndividual i = OWL.Individual("P"); final Set<OWLAxiom> axioms = new HashSet<>(); axioms.add(OWL.disjointProperties(P, S)); axioms.add(OWL.propertyAssertion(i, P, i)); axioms.add(OWL.propertyAssertion(i, S, i)); final OWLOntology ontology = OWL.Ontology(axioms); final OpenlletReasoner reasoner = OpenlletReasonerFactory.getInstance().createReasoner(ontology); final PelletExplanation explain = new PelletExplanation(reasoner); assertFalse(explain.getInconsistencyExplanations().isEmpty()); }
@Test /** * Tests for the bug reported in #150 */ public void test150_2() { createReasoner(OWL.domain(_p, _C), OWL.range(_q, _D), OWL.disjointClasses(_C, _D)); assertTrue(_reasoner.isEntailed(OWL.disjointProperties(_p, OWL.inverse(_q)))); assertTrue(_reasoner.isEntailed(OWL.disjointProperties(OWL.inverse(_p), _q))); }
assertTrue(_reasoner.isEntailed(OWL.disjointProperties(hasParent, hasSpouse))); assertTrue(_reasoner.isEntailed(OWL.disjointProperties(hasParent, hasWife))); assertTrue(_reasoner.isEntailed(OWL.disjointProperties(hasParent, child))); assertTrue(_reasoner.isEntailed(OWL.disjointProperties(hasParent, hasChild))); assertTrue(_reasoner.isEntailed(OWL.disjointProperties(hasParent, OWL.bottomObjectProperty)));
@Test public void testInvalidTransitivity() { final String ns = "http://www.example.org/test#"; final OWLClass C = Class(ns + "C"); final OWLObjectProperty p1 = ObjectProperty(ns + "p1"); final OWLObjectProperty p2 = ObjectProperty(ns + "p2"); final OWLIndividual x = Individual(ns + "x"); final OWLIndividual y = Individual(ns + "y"); final OWLIndividual z = Individual(ns + "z"); final OWLOntology ont = OWL.Ontology(transitive(p1), classAssertion(x, all(p1, C)), propertyAssertion(x, p1, y), propertyAssertion(y, p1, z)); OpenlletReasoner reasoner = OpenlletReasonerFactory.getInstance().createReasoner(ont); assertTrue(reasoner.isEntailed(classAssertion(y, C))); assertTrue(reasoner.isEntailed(classAssertion(z, C))); final OWLAxiom[] axioms = new OWLAxiom[] { functional(p1), inverseFunctional(p1), irreflexive(p1), asymmetric(p1), disjointProperties(p1, p2), subClassOf(C, min(p1, 2)), classAssertion(x, max(p1, 3)), disjointClasses(C, min(p1, 2)) }; for (final OWLAxiom axiom : axioms) { ont.add(axiom); reasoner = OpenlletReasonerFactory.getInstance().createReasoner(ont); assertTrue(axiom.toString(), reasoner.isEntailed(classAssertion(y, C))); assertFalse(axiom.toString(), reasoner.isEntailed(classAssertion(z, C))); ont.remove(axiom); } }
assertTrue(reasoner.isEntailed(disjointClasses(D2, D3))); assertTrue(reasoner.isEntailed(disjointProperties(d1, d2))); assertTrue(reasoner.isEntailed(disjointProperties(d2, d1))); assertFalse(reasoner.isEntailed(disjointProperties(p, r)));
assertTrue(reasoner.isEntailed(subPropertyOf(hasChild, hasDescendant))); assertTrue(reasoner.isEntailed(disjointProperties(likes, dislikes))); assertTrue(reasoner.isEntailed(disjointProperties(dislikes, likes))); assertTrue(reasoner.isEntailed(disjointProperties(hasFather, hasMother))); assertTrue(reasoner.isEntailed(disjointProperties(hasMother, hasFather)));