*/
private void createClassesForObjectTypes(List<ObjectType> objectTypes) throws Exception {
// FIXME What about caching Common Domain model instances
// for each object type create a class
for (ObjectType type : objectTypes) {
OntClass klass = orh.createOntClassByObjectTypeDefinition(CMISModelMapper
.getObjectTypeDefinition(type));
for (PropertyDefinition<?> propDef : type.getPropertyDefinitions().values()) {
org.apache.stanbol.cmsadapter.servicesapi.model.web.PropertyDefinition propertyDef = CMISModelMapper
.getPropertyDefinition(propDef);
if (objectPropertyCheck(propertyDef)) {
orh.createObjectPropertyByPropertyDefinition(propertyDef,
Arrays.asList(new Resource[] {klass}), new ArrayList<Resource>(1));
} else {
orh.createDatatypePropertyByPropertyDefinition(propertyDef,
Arrays.asList(new Resource[] {klass}));
}
}
}
// for each parent id create a superclass relation
for (ObjectType type : objectTypes) {
ObjectType parentType = type.getParentType();
if (parentType != null) {
OntClass klass = orh.createOntClassByObjectTypeDefinition(CMISModelMapper
.getObjectTypeDefinition(type));
OntClass parentClass = orh.createOntClassByObjectTypeDefinition(CMISModelMapper
.getObjectTypeDefinition(parentType));
klass.addSuperClass(parentClass);
}
}
}