r.getInstances(OWL.not(e)).entities().forEach(System.out::println);
r.getInstances(OWL.not(e)).entities().forEach(System.out::println);
@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 that complemented super descriptions in subclass axioms are handled correctly. (Known to fail in r100 and earlier) */ @Test public void objectComplementSuperCls() { assertLocal(subClassOf(Class("A"), not(Nothing)), Class("A")); assertLocal(subClassOf(Class("A"), not(Class("B"))), Class("A")); assertNonLocal(subClassOf(Class("A"), not(Class("B"))), Class("A"), Class("B")); }
/** * 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 that complemented sub class descriptions are handled correctly. */ @Test public void objectComplementSubCls() { assertLocal(subClassOf(not(Thing), Class("A")), Class("A")); assertLocal(subClassOf(not(Class("B")), Class("A")), Class("A")); assertNonLocal(subClassOf(not(Class("B")), Class("A")), Class("A"), Class("B")); }
@Test public void unsatisfiableTest2() { final OWLAxiom[] axioms = { subClassOf(_C, _B), subClassOf(_B, _A), subClassOf(_D, Thing) }; final OWLAxiom[] additions = { subClassOf(_B, not(_A)) }; final OWLAxiom[] deletions = {}; updateTest(axioms, additions, deletions); }
@Test public void testComplementOfOthers() { final OWLClassExpression comp = OWL.not(OWL.or(_cls[1], _cls[2])); final OWLAxiom axiom = OWL.equivalentClasses(_cls[0], comp); final Lint lint = _pattern.match(_ontology, axiom); assertNotNull(lint); assertTrue(lint.getParticipatingClasses().contains(_cls[0])); final LintFixer fixer = lint.getLintFixer(); assertTrue(fixer.getAxiomsToRemove().contains(axiom)); final OWLAxiom expectedAxiom = OWL.subClassOf(_cls[0], comp); assertTrue(fixer.getAxiomsToAdd().contains(expectedAxiom)); } }
@Test public void testComplementOfItself() { final OWLClassExpression comp = OWL.not(_cls[0]); final OWLAxiom axiom = OWL.equivalentClasses(_cls[0], comp); final Lint lint = _pattern.match(_ontology, axiom); assertNotNull(lint); assertTrue(lint.getParticipatingClasses().contains(_cls[0])); final LintFixer fixer = lint.getLintFixer(); assertTrue(fixer.getAxiomsToRemove().contains(axiom)); final OWLAxiom expectedAxiom = OWL.subClassOf(_cls[0], comp); assertTrue(fixer.getAxiomsToAdd().contains(expectedAxiom)); assertNull(lint.getSeverity()); assertSame(_ontology, lint.getParticipatingOntology()); }
OWL.subClassOf(UplandArea, OWL.not(Volcano)),//
@Test public void testNone() { assertTrue(_pattern.isFixable()); final OWLClassExpression comp = OWL.not(_cls[0]); OWLAxiom axiom = OWL.subClassOf(_cls[0], comp); assertNull(_pattern.match(_ontology, axiom)); axiom = OWL.equivalentClasses(_P0AllC0, comp); assertNull(_pattern.match(_ontology, axiom)); axiom = OWL.equivalentClasses(CollectionUtil.asSet(_cls[0], _cls[1], comp)); assertNull(_pattern.match(_ontology, axiom)); axiom = OWL.equivalentClasses(OWL.Nothing, OWL.Thing); assertNull(_pattern.match(_ontology, axiom)); }
@Test public void testComplementRemoval() { final String ns = "http://test#"; final OWLOntology ont = loadOntology(OWLManager.createOWLOntologyManager(), MiscTests._base + "ticket539.ofn"); final OpenlletReasoner reasoner = OpenlletReasonerFactory.getInstance().createNonBufferingReasoner(ont); assertFalse(reasoner.isConsistent()); ont.removeAxiom(OWL.subClassOf(OWL.Class(ns + "a_GROUP"), OWL.Class(ns + "a_TEMPORALTHING"))); assertFalse(reasoner.isConsistent()); ont.removeAxiom(OWL.subClassOf(OWL.Class(ns + "a_INDIVIDUAL"), OWL.not(OWL.Class(ns + "a_SETORCOLLECTION")))); assertFalse(reasoner.isConsistent()); } }