}
}
public CategoricScale getCategoricScale(Model model,
Resource resource) throws Exception {
CategoricScale categoricScale = (CategoricScale) getResourceFromCache(
resource, CategoricScale.class);
if(categoricScale != null) {
return categoricScale;
}
categoricScale = (CategoricScale) getScale(model, resource, CategoricScale.class);
Property allowValue = ResourceFactory.createProperty(
riNamespace + "allowValue");
// allowValue //
StmtIterator stmtI1 = model.listStatements(resource,
allowValue, (RDFNode)null);
while(stmtI1.hasNext()) {
Statement statement = stmtI1.nextStatement();
// validate allowValue property //
if(!statement.getObject().isLiteral()) {
if(!ModelException.throwException(ModelException.SCALE,
"allowValue property of CategoricScale resource:"+
resource.getURI()+" is not a literal")) {
return null;
}
} else {
categoricScale.addCategories(statement.getObject().asLiteral().getString());
}
}
return categoricScale;
}