@Test public void internalSplitTest() { final OWLAxiom[] axioms = { subClassOf(_A, Thing), subClassOf(_B, _A), subClassOf(_C, _B), subClassOf(_D, _C), subClassOf(_E, _B), subClassOf(_B, _C) }; final OWLAxiom[] additions = {}; final OWLAxiom[] deletions = { subClassOf(_B, _C) }; updateTest(axioms, additions, deletions); }
@Test public void internalMergeTest() { final OWLAxiom[] axioms = { subClassOf(_A, Thing), subClassOf(_B, _A), subClassOf(_C, _B), subClassOf(_D, _C), subClassOf(_E, _B) }; final OWLAxiom[] additions = { subClassOf(_B, _C) }; final OWLAxiom[] deletions = {}; updateTest(axioms, additions, deletions); }
@Test public void indirectSubClassTest() { final OWLAxiom[] axioms = { subClassOf(_A, Thing), equivalentClasses(_A, some(_p, _C)), equivalentClasses(_B, some(_p, _D)), subClassOf(_C, Thing), subClassOf(_D, _C), subClassOf(_E, Thing), subClassOf(_F, _E) }; final OWLAxiom[] additions = {}; final OWLAxiom[] deletions = { subClassOf(_D, _C) }; updateTest(axioms, additions, deletions); }
@Test public void simpleSubClass() throws Exception { // this test case is to check the effect of classification and caching // on explanations. the last axiom is to ebsure the EL classifier will // not be used final OWLAxiom[] axioms = { OWL.subClassOf(_A, _B), OWL.subClassOf(_B, _C), OWL.subClassOf(_A, OWL.all(_p, _B)) }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.subClassOf(_A, _C), 0, axioms[0], axioms[1]); }
/** * Test that entities appearing in annotations only can still be used in clashExplanation requests. */ @Test public void annotationOnlyDuringMUPSEntity() throws Exception { final OWLAxiom[] axioms = { OWL.subClassOf(_A, OWL.Thing), OWL.subClassOf(_B, _A), OWL.comment(_B, "Annotation only class") }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.subClassOf(_B, _A), 0, new OWLAxiom[] { axioms[1] }); }
@Test public void indirectModuleTest() { final OWLAxiom[] axioms = { subClassOf(_A, and(_B, _C, some(_p, _C))), subClassOf(_B, or(all(_p, not(_C)), _D)), subClassOf(_D, _E) }; final OWLAxiom[] additions = { subClassOf(_A, not(_E)) }; final OWLAxiom[] deletions = {}; updateTest(axioms, additions, deletions); }
@Test public void basicDisjointnessTest() { final OWLAxiom[] axioms = { disjointClasses(_A, _B), subClassOf(_C, _A), subClassOf(_D, _B), equivalentClasses(_E, _A) }; disjointnessTest(axioms); }
@Test public void disjointSupers() throws Exception { final OWLAxiom[] axioms = { OWL.subClassOf(_A, _B), OWL.subClassOf(_A, _C), OWL.disjointClasses(_B, _C) }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.equivalentClasses(_A, OWL.Nothing), 0, axioms); }
@Test public void basicDisjointnessUpdateTest() { final OWLAxiom[] axioms = { disjointClasses(_A, _B), subClassOf(_C, _A), subClassOf(_D, _B), equivalentClasses(_E, _A) }; final OWLAxiom[] additions = { disjointClasses(_D, _C) }; final OWLAxiom[] deletions = { disjointClasses(_A, _B) }; disjointnessUpdateTest(axioms, additions, deletions); }
@Test public void expressionInRange() throws Exception { final OWLAxiom[] axioms = { OWL.subClassOf(_A, OWL.some(_p, _B)), OWL.range(_p, OWL.or(_C, _D)), OWL.disjointClasses(_B, _C), OWL.disjointClasses(_B, _D) }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.subClassOf(_A, OWL.Nothing), 0, axioms); }
@Test public void testGCI() { final OWLAxiom axiom = OWL.subClassOf(_P0AllC0, _cls[1]); final Lint lint = _pattern.match(_ontology, axiom); assertNotNull(lint); assertTrue(lint.getParticipatingClasses().isEmpty()); assertTrue(lint.getParticipatingAxioms().contains(axiom)); } }
/** * Test that named classes as super in subClass axioms are handled correctly. */ @Test public void objectSuperCls() { assertLocal(subClassOf(Class("A"), Class("B")), Class("A")); assertNonLocal(subClassOf(Class("A"), Class("B")), Class("B")); }
@Test public void testObjecDomainWithEquivalents() { createReasoner(OWL.subClassOf(_A, min(_p, 1)), OWL.domain(_p, _A), OWL.domain(_p, _C), OWL.subClassOf(_A, _B)); assertTrue(_reasoner.isEntailed(OWL.domain(_p, _A))); assertStreamAsSetEquals(Stream.of(_A), _reasoner.getObjectPropertyDomains(_p, true).entities()); assertStreamAsSetEquals(Stream.of(_A, _B, _C, OWL.Thing), _reasoner.getObjectPropertyDomains(_p, false).entities()); }
/** * Test that complemented sub class descriptions are handled correctly. */ @Test public void objectComplementSubCls() { assertLocal(subClassOf(not(Thing), Class("A")), Class("A")); assertNonLocal(subClassOf(not(Class("B")), Class("A")), Class("A")); assertNonLocal(subClassOf(not(Class("B")), Class("A")), Class("A"), Class("B")); }
@Test public void testOneOf() throws OWLException { addAxiom(OWL.subClassOf(_cls[0], _P0AllC0)); final OWLClassExpression oneOf = OWL.oneOf(_ind); addAxiom(OWL.equivalentClasses(CollectionUtil.asSet(_cls[0], _cls[1], oneOf))); final List<Lint> lints = _pattern.match(_ontology); assertEquals(0, lints.size()); }
/** * Test that in all circumstances where the role of an object existential is not in a signature, the axiom is non-local (Known to fail prior to r99) */ @Test public void objectExistentialSuperClsProp() { assertNonLocal(subClassOf(Class("A"), some(ObjectProperty("p"), Thing)), Class("A")); assertNonLocal(subClassOf(Class("A"), some(ObjectProperty("p"), Nothing)), Class("A")); assertNonLocal(subClassOf(Class("A"), some(ObjectProperty("p"), Class("B"))), Class("A")); assertNonLocal(subClassOf(Class("A"), some(ObjectProperty("p"), Class("A"))), Class("A")); }
@Test public void objectMaxSubCls() { assertNonLocal(subClassOf(max(ObjectProperty("p"), 2, Thing), Class("A")), Class("A")); assertNonLocal(subClassOf(max(ObjectProperty("p"), 2, Thing), Class("A")), Class("A"), ObjectProperty("p")); assertNonLocal(subClassOf(max(ObjectProperty("p"), 2, Nothing), Class("A")), Class("A")); assertNonLocal(subClassOf(max(ObjectProperty("p"), 2, Nothing), Class("A")), Class("A"), ObjectProperty("p")); assertNonLocal(subClassOf(max(ObjectProperty("p"), 2, Class("B")), Class("A")), Class("A")); assertNonLocal(subClassOf(max(ObjectProperty("p"), 2, Class("B")), Class("A")), Class("A"), ObjectProperty("p")); assertNonLocal(subClassOf(max(ObjectProperty("p"), 2, Class("B")), Class("A")), Class("A"), ObjectProperty("p"), Class("B")); }
@Test public void testObjectDomainWithSubClasses() { createReasoner(OWL.domain(_p, _A), OWL.subClassOf(_A, _B)); assertTrue(_reasoner.isEntailed(OWL.domain(_p, _A))); assertStreamAsSetEquals(Stream.of(_A), _reasoner.getObjectPropertyDomains(_p, true).entities()); assertStreamAsSetEquals(Stream.of(_A, _B, OWL.Thing), _reasoner.getObjectPropertyDomains(_p, false).entities()); }
/** * Test that universal object restriction subclasses are handled correctly */ @Test public void objectUniversalSubCls() { assertNonLocal(subClassOf(all(ObjectProperty("p"), Class("B")), Class("A")), Class("A")); assertNonLocal(subClassOf(all(ObjectProperty("p"), Class("B")), Class("A")), Class("A"), Class("B")); assertNonLocal(subClassOf(all(ObjectProperty("p"), Class("B")), Class("A")), Class("A"), ObjectProperty("p")); } }
@Test public void testObjectRangeWithEquivalents() { createReasoner(OWL.equivalentClasses(_C, some(inverse(_p), OWL.Thing)), OWL.range(_p, _D), OWL.subClassOf(_C, _E)); _reasoner.getKB().printClassTree(); assertTrue(_reasoner.isEntailed(OWL.range(_p, _C))); assertStreamAsSetEquals(Stream.of(_C), _reasoner.getEquivalentClasses(some(inverse(_p), OWL.Thing)).entities()); assertStreamAsSetEquals(Stream.of(_C), _reasoner.getObjectPropertyRanges(_p, true).entities()); assertStreamAsSetEquals(Stream.of(_C, _D, _E, OWL.Thing), _reasoner.getObjectPropertyRanges(_p, false).entities()); }