NamedRole irole = new NamedRole(factory.lookupRoleId(role).toString());
return new au.csiro.ontology.model.Existential(irole, iconcept);
} else if(o instanceof Datatype) {
Datatype d = (Datatype) o;
String feature = factory.lookupFeatureId(d.getFeature());
AbstractLiteral literal = d.getLiteral();
if(literal instanceof DateLiteral) {
return new au.csiro.ontology.model.Datatype(new NamedFeature(feature), d.getOperator(),
new au.csiro.ontology.model.DateLiteral(((DateLiteral) literal).getValue()));
} else if(literal instanceof DecimalLiteral) {
return new au.csiro.ontology.model.Datatype(new NamedFeature(feature), d.getOperator(),
new au.csiro.ontology.model.DecimalLiteral(((DecimalLiteral) literal).getValue()));
} else if(literal instanceof IntegerLiteral) {
return new au.csiro.ontology.model.Datatype(new NamedFeature(feature), d.getOperator(),
new au.csiro.ontology.model.IntegerLiteral(((IntegerLiteral) literal).getValue()));
} else if(literal instanceof StringLiteral) {
return new au.csiro.ontology.model.Datatype(new NamedFeature(feature), d.getOperator(),
new au.csiro.ontology.model.StringLiteral(((StringLiteral) literal).getValue()));
} else {
throw new RuntimeException("Unexpected literal " + literal.getClass().getName());
}
} else if(o instanceof Concept) {
Object obj = factory.lookupConceptId(((Concept)o).hashCode());
return transform(obj);