String ns = "urn:test:";
OntModelSpec spec = new OntModelSpec( OntModelSpec.OWL_DL_MEM );
spec.setReasoner( new PelletReasoner() );
OntModel model = ModelFactory.createOntologyModel( spec, null );
OntClass HomeOwner = model.createClass( ns + "HomeOwner" );
Individual bob = model.createIndividual( ns + "bob", HomeOwner );
ObjectProperty hasNeighbor = model.createObjectProperty( ns + "hasNeighbor" );
OntClass NeighborOfBob = model.createClass( ns + "NeighborOfBob" );
NeighborOfBob
.addEquivalentClass( model.createHasValueRestriction( null, hasNeighbor, bob ) );
Individual susan = model.createIndividual( ns + "susan", HomeOwner );