return null;
}
public EntityType getEntityType(Model model,
Resource resource) throws Exception {
EntityType entityType = (EntityType) getResourceFromCache(
resource, EntityType.class);
if(entityType != null) {
return entityType;
}
entityType = new EntityType();
addResourceInstanceToCache(resource, entityType);
// type //
Property type = ResourceFactory.createProperty(riNamespace + "type");
StmtIterator stmtI1 = model.listStatements(resource,
type, (RDFNode)null);
while(stmtI1.hasNext()) {
Statement statement = stmtI1.nextStatement();
// validate type property //
if(!statement.getObject().isLiteral()) {
if(!ModelException.throwException(ModelException.ENTITYTYPE,
"type property of EntityType resource:"+
resource.getURI()+" is not a literal")) {
return null;
}
} else {
entityType.setType(statement.getObject().asLiteral().getString());
}
}
return entityType;
}