@Test
public void testDeferredClassification() {
OWLAxiom[] axioms = { subClassOf( A, B ), subClassOf( C, D ) };
createOntology( axioms );
IncrementalClassifier modular = PelletIncremantalReasonerFactory.getInstance().createReasoner( ontology );
modular.classify();
assertTrue(modular.isClassified());
assertEquals(Collections.emptySet(), modular.getTypes(a, false).getFlattened());
assertTrue(modular.isRealized());
OntologyUtils.addAxioms( ontology, Arrays.asList( classAssertion( a, A ) ) );
// despite of having added a new fact, the classifier should still be in classified state (the axiom was an A-Box axiom)
assertTrue(modular.isClassified());
assertFalse(modular.isRealized());
assertEquals(SetUtils.create(A, B, OWL.Thing), modular.getTypes(a, false).getFlattened());
assertTrue(modular.isEntailed(subClassOf( A, B )));
assertFalse(modular.isEntailed(subClassOf( A, C )));
assertTrue(modular.isRealized());
// now try to add a T-Box axiom
OntologyUtils.addAxioms( ontology, Arrays.asList( subClassOf( A, C ) ) );
// the classifier should no longer be in classified state
assertFalse(modular.isClassified());
assertFalse(modular.isRealized());
// force classification
modular.classify();
// check whether the classifier returned to the classified state
assertTrue(modular.isClassified());
assertEquals(SetUtils.create(A, B, C, D, OWL.Thing), modular.getTypes(a, false).getFlattened());
assertTrue(modular.isEntailed(subClassOf( A, B )));
assertTrue(modular.isEntailed(subClassOf( A, C )));
}