@Override public AllDifferent createAllDifferent() { return inner.createAllDifferent(); }
@Override public AllDifferent createAllDifferent(RDFList differentMembers) { return inner.createAllDifferent(differentMembers); }
@Override public OntResource doCreate( OntModel m ) { return m.createAllDifferent(); } @Override
@Override public OntResource doCreate( OntModel m ) { return m.createAllDifferent(); } @Override
@Override public void ontTest( OntModel m ) { Profile prof = m.getProfile(); AllDifferent a = m.createAllDifferent(); OntResource b = m.getResource( NS + "b" ).as( OntResource.class ); OntResource c = m.getResource( NS + "c" ).as( OntResource.class ); a.addDistinctMember( b ); assertEquals( "Cardinality should be 1", 1, a.getCardinality( prof.DISTINCT_MEMBERS() ) ); assertEquals( "List size should be 1", 1, a.getDistinctMembers().size() ); assertTrue( "a should have b as distinct", a.hasDistinctMember( b ) ); a.addDistinctMember( c ); assertEquals( "Cardinality should be 1", 1, a.getCardinality( prof.DISTINCT_MEMBERS() ) ); assertEquals( "List size should be 2", 2, a.getDistinctMembers().size() ); iteratorTest( a.listDistinctMembers(), new Object[] {b, c} ); assertTrue( "a should have b as distinct", a.hasDistinctMember( b ) ); assertTrue( "a should have c as distinct", a.hasDistinctMember( c ) ); a.setDistinctMembers( m.createList( new RDFNode[] {b} ) ); assertEquals( "Cardinality should be 1", 1, a.getCardinality( prof.DISTINCT_MEMBERS() ) ); assertEquals( "List size should be 1", 1, a.getDistinctMembers().size() ); assertTrue( "a should have b as distinct", a.hasDistinctMember( b ) ); assertTrue( "a should not have c as distinct", !a.hasDistinctMember( c ) ); a.removeDistinctMember( b ); assertTrue( "a should have not b as distinct", !a.hasDistinctMember( b ) ); } },
@Override public void ontTest( OntModel m ) { Profile prof = m.getProfile(); AllDifferent a = m.createAllDifferent(); OntResource b = m.getResource( NS + "b" ).as( OntResource.class ); OntResource c = m.getResource( NS + "c" ).as( OntResource.class ); a.addDistinctMember( b ); assertEquals( "Cardinality should be 1", 1, a.getCardinality( prof.DISTINCT_MEMBERS() ) ); assertEquals( "List size should be 1", 1, a.getDistinctMembers().size() ); assertTrue( "a should have b as distinct", a.hasDistinctMember( b ) ); a.addDistinctMember( c ); assertEquals( "Cardinality should be 1", 1, a.getCardinality( prof.DISTINCT_MEMBERS() ) ); assertEquals( "List size should be 2", 2, a.getDistinctMembers().size() ); iteratorTest( a.listDistinctMembers(), new Object[] {b, c} ); assertTrue( "a should have b as distinct", a.hasDistinctMember( b ) ); assertTrue( "a should have c as distinct", a.hasDistinctMember( c ) ); a.setDistinctMembers( m.createList( new RDFNode[] {b} ) ); assertEquals( "Cardinality should be 1", 1, a.getCardinality( prof.DISTINCT_MEMBERS() ) ); assertEquals( "List size should be 1", 1, a.getDistinctMembers().size() ); assertTrue( "a should have b as distinct", a.hasDistinctMember( b ) ); assertTrue( "a should not have c as distinct", !a.hasDistinctMember( c ) ); a.removeDistinctMember( b ); assertTrue( "a should have not b as distinct", !a.hasDistinctMember( b ) ); } },