XSDDecimal.getInstance().getName() ) ) );
}
@Test
public void testMaxCardinality() {
KnowledgeBase kb = new KnowledgeBase();
kb.addObjectProperty( term( "p" ) );
kb.addObjectProperty( term( "q" ) );
kb.addFunctionalProperty( term( "q" ) );
kb.addClass( term( "C" ) );
kb.addSubClass( term( "C" ), ATermUtils.makeMax( term( "p" ), 2, ATermUtils.TOP ) );
kb.addClass( term( "D1" ) );
kb.addClass( term( "D2" ) );
kb.addClass( term( "D3" ) );
kb.addClass( term( "D4" ) );
kb.addClass( term( "E1" ) );
kb.addClass( term( "E2" ) );
kb.addClass( term( "E3" ) );
kb.addClass( term( "E4" ) );
kb.addSubClass( term( "D1" ), ATermUtils.makeSomeValues( term( "q" ), term( "E1" ) ) );
kb.addSubClass( term( "D2" ), ATermUtils.makeSomeValues( term( "q" ), term( "E2" ) ) );
kb.addSubClass( term( "D3" ), ATermUtils.makeSomeValues( term( "q" ), term( "E3" ) ) );
kb.addSubClass( term( "D4" ), ATermUtils.makeSomeValues( term( "q" ), term( "E4" ) ) );
kb.addIndividual( term( "x" ) );
kb.addType( term( "x" ), term( "C" ) );
kb.addIndividual( term( "x1" ) );
kb.addType( term( "x1" ), term( "D1" ) );
kb.addIndividual( term( "x2" ) );
kb.addType( term( "x2" ), term( "D2" ) );
kb.addIndividual( term( "x3" ) );
kb.addType( term( "x3" ), term( "D3" ) );
kb.addIndividual( term( "x4" ) );
kb.addType( term( "x4" ), term( "D4" ) );
kb.addPropertyValue( term( "p" ), term( "x" ), term( "x1" ) );
kb.addPropertyValue( term( "p" ), term( "x" ), term( "x2" ) );
kb.addPropertyValue( term( "p" ), term( "x" ), term( "x3" ) );
kb.addPropertyValue( term( "p" ), term( "x" ), term( "x4" ) );
kb.addDisjointClass( term( "E1" ), term( "E2" ) );
kb.addDisjointClass( term( "E1" ), term( "E4" ) );
kb.addDisjointClass( term( "E2" ), term( "E3" ) );
assertTrue( kb.isConsistent() );
assertTrue( kb.isSameAs( term( "x1" ), term( "x3" ) ) );
assertTrue( kb.isSameAs( term( "x3" ), term( "x1" ) ) );
assertTrue( kb.isSameAs( term( "x2" ), term( "x4" ) ) );
assertTrue( kb.getSames( term( "x1" ) ).contains( term( "x3" ) ) );
assertTrue( kb.getSames( term( "x2" ) ).contains( term( "x4" ) ) );
}