@Test public void testNone2() throws OWLException { addAxiom(OWL.subClassOf(_cls[0], _P0AllC0)); addAxiom(OWL.equivalentClasses(_cls[0], _cls[1])); addAxiom(OWL.equivalentClasses(_cls[0], OWL.Thing)); final List<Lint> lints = _pattern.match(_ontology); assertEquals(0, lints.size()); }
/** * Test that entities appearing in declarations only can still be used in clashExplanation requests. */ @Test public void declarationOnlyEntity() throws Exception { final OWLAxiom[] axioms = { OWL.equivalentClasses(_A, OWL.Thing), OWL.declaration(_B) }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.subClassOf(_B, _A), 0, new OWLAxiom[] { axioms[0] }); }
@Test public void testNone() { assertFalse(_pattern.isFixable()); OWLAxiom axiom = OWL.equivalentClasses(_cls[0], _cls[1]); assertNull(_pattern.match(_ontology, axiom)); axiom = OWL.equivalentClasses(CollectionUtil.<OWLClassExpression> asSet(_cls[0], _cls[1], _cls[2])); assertNull(_pattern.match(_ontology, axiom)); axiom = OWL.equivalentClasses(CollectionUtil.<OWLClassExpression> asSet(_cls[0], _P0AllC0, _cls[2])); assertNull(_pattern.match(_ontology, axiom)); }
@Test public void testNone1() throws OWLException { addAxiom(OWL.subClassOf(_cls[0], _P0AllC0)); addAxiom(OWL.subClassOf(_cls[0], _cls[1])); addAxiom(OWL.equivalentClasses(_cls[1], _cls[2])); addAxiom(OWL.equivalentClasses(_cls[1], _cls[3])); assertTrue(_pattern.isFixable()); final List<Lint> lints = _pattern.match(_ontology); assertEquals(0, lints.size()); }
@Test public void nestedUnionTest() { final OWLAxiom[] axioms = { equivalentClasses(_A, and(_B, or(_C, _D))), equivalentClasses(_E, and(_B, _C)) }; extractModules(axioms); testModule(_A, _A, _B, _C, _D, _E); testModule(_B, _B); testModule(_C, _C); testModule(_D, _D); testModule(_E, _A, _B, _C, _D, _E); }
@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 basicDisjointnessTest() { final OWLAxiom[] axioms = { disjointClasses(_A, _B), subClassOf(_C, _A), subClassOf(_D, _B), equivalentClasses(_E, _A) }; disjointnessTest(axioms); }
@Test public void allValuesTest() { final OWLAxiom[] axioms = { equivalentClasses(_A, all(_p, _B)) }; extractModules(axioms); testModule(_A, _A, _p, _B); testModule(_B, _A, _p, _B); } }
@Test public void testOneOf() { final OWLClassExpression oneOf = OWL.oneOf(_ind); final OWLAxiom axiom = OWL.equivalentClasses(CollectionUtil.<OWLClassExpression> asSet(_P0AllC0, oneOf)); assertNull(_pattern.match(_ontology, axiom)); }
/** * Test for #447 */ @Test public void testGetUnsatClasses() { createReasoner(OWL.disjointClasses(_A, _B), OWL.equivalentClasses(_C, OWL.and(_A, _B))); assertStreamAsSetEquals(Stream.of(_C, OWL.Nothing), _reasoner.getUnsatisfiableClasses().entities()); assertStreamAsSetEquals(Stream.of(_C, OWL.Nothing), _reasoner.getEquivalentClasses(_C).entities()); }
@Test public void propertyChain2() throws Exception { final OWLAxiom[] axioms = { OWL.subPropertyOf(new OWLObjectProperty[] { _p, _q }, _r), OWL.propertyAssertion(_a, _p, _b), OWL.propertyAssertion(_b, _q, _c), OWL.equivalentClasses(_A, OWL.some(_r, OWL.Thing)) }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.classAssertion(_a, _A), 0, axioms); }
@Test public void intersectionTest() { final OWLAxiom[] axioms = { equivalentClasses(_A, and(_B, _C)) }; extractModules(axioms); testModule(_A, _A, _B, _C); testModule(_B, _B); testModule(_C, _C); }
@Test public void testComplexEquivalence() { final OWLAxiom axiom = OWL.equivalentClasses(CollectionUtil.<OWLClassExpression> asSet(_cls[0], _P0AllC0, _P0SomeC1)); final Lint lint = _pattern.match(_ontology, axiom); assertNotNull(lint); assertTrue(lint.getParticipatingClasses().isEmpty()); assertTrue(lint.getParticipatingAxioms().contains(axiom)); assertNull(lint.getSeverity()); assertSame(_ontology, lint.getParticipatingOntology()); }
@Test public void transitiveProperty() throws Exception { final OWLAxiom[] axioms = { OWL.transitive(_p), OWL.propertyAssertion(_a, _p, _b), OWL.propertyAssertion(_b, _p, _c), OWL.equivalentClasses(_A, OWL.value(_p, _c)) }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.classAssertion(_b, _A), 0, new OWLAxiom[] { axioms[2], axioms[3] }); testExplanations(OWL.classAssertion(_a, _A), 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 testNested1() { _pattern.setMaxAllowed(2); final OWLClassExpression union = OWL.or(_cls[1], _cls[2], _cls[3]); final OWLClassExpression all = OWL.all(_pro[0], union); final OWLClassExpression and = OWL.and(all, _cls[4]); final OWLAxiom axiom = OWL.equivalentClasses(and, _cls[0]); assertNotNull(_pattern.match(_ontology, axiom)); }
@Test public void userDefinedDatatype3() throws Exception { final OWLAxiom[] axioms = { OWL.classAssertion(_a, _A), OWL.propertyAssertion(_a, dp, OWL.constant(9)), OWL.equivalentClasses(_B, OWL.and(_A, OWL.some(dp, _dt))), OWL.datatypeDefinition(_dt, OWL.restrict(XSD.INTEGER, OWL.maxExclusive(10))) }; setupGenerators(Stream.of(axioms)); testExplanations(OWL.classAssertion(_a, _B), 0, axioms); }
@Test public void testNone() { assertTrue(_pattern.isFixable()); OWLAxiom axiom = OWL.equivalentClasses(CollectionUtil.<OWLClassExpression> asSet(OWL.Nothing, _cls[2], _cls[3])); assertNull(_pattern.match(_ontology, axiom)); axiom = OWL.subClassOf(OWL.Thing, _cls[1]); assertNull(_pattern.match(_ontology, axiom)); }
@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()); }
@Test public void deleteNonLocal() { final OWLAxiom[] axioms = { equivalentClasses(_A, all(_p, _B)), subClassOf(_C, all(_p, _B)), subClassOf(_D, all(_p, _B)), subClassOf(_D, _C) }; final OWLAxiom[] additions = {}; final OWLAxiom[] deletions = { subClassOf(_C, all(_p, _B)) }; updateTest(axioms, additions, deletions); }