@Test
public void testSameAs2() {
OntModelSpec ontModelSpec = new OntModelSpec( OntModelSpec.OWL_DL_MEM_RULE_INF );
ontModelSpec.setReasoner( new PelletReasoner() );
OntModel model = ModelFactory.createOntologyModel( ontModelSpec );
Individual i1 = model.createIndividual( "http://test#i1", OWL.Thing );
Individual i2 = model.createIndividual( "http://test#i2", OWL.Thing );
Property prop = model.createProperty( "http://test#prop" );
i1.addProperty( prop, "test" );
i1.addSameAs( i2 );
// confirm that sameAs was created
assertTrue( i1.isSameAs( i2 ) );
// confirm that symmetric sameAs inferred
assertTrue( i2.isSameAs( i1 ) );
// confirm that the property is there
assertTrue( i1.hasProperty( prop, "test" ) );
// confirm that the property is there when querying with a predicate
assertIteratorContains( i1.listProperties(), model.createStatement( i1, prop, "test" ) );
// confirm that the property is copied over when querying with a
// predicate
assertTrue( i2.hasProperty( prop, "test" ) );
// confirm that the property is copied over when querying with a
// predicate
assertIteratorContains( i2.listProperties(), model.createStatement( i2, prop, "test" ) );
}