OWLOntology ont = OWL.Ontology( transitive( p1 ),
classAssertion( x, all( p1, C ) ), propertyAssertion( x, p1, y ),
propertyAssertion( y, p1, z ) );
PelletReasoner reasoner = PelletReasonerFactory.getInstance().createReasoner( ont );
assertTrue( reasoner.isEntailed( classAssertion( y, C ) ) );
assertTrue( reasoner.isEntailed( classAssertion( z, C ) ) );
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( int i = 0; i < axioms.length; i++ ) {
addAxioms( ont, axioms[i] );
reasoner = PelletReasonerFactory.getInstance().createReasoner( ont );
assertTrue( axioms[i].toString(), reasoner.isEntailed( classAssertion( y, C ) ) );
assertFalse( axioms[i].toString(), reasoner.isEntailed( classAssertion( z, C ) ) );
removeAxioms( ont, axioms[i] );
}
}