public Concept transform(Object o) {
        if(o instanceof Conjunction) {
            Conjunction con = (Conjunction)o;
            List<Concept> concepts = new ArrayList<Concept>();
            for(AbstractConcept ac : con.getConcepts()) {
                concepts.add(transform(ac));
            }
            return new au.csiro.ontology.model.Conjunction(concepts);
        } else if(o instanceof Existential) {
            Existential e = (Existential)o;
            AbstractConcept c = e.getConcept();
            Concept iconcept = transform(c);
            int role = e.getRole();
            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);
        } else if(o instanceof String) {
            return new au.csiro.ontology.model.NamedConcept((String) o);
        } else {
            throw new RuntimeException("Unexpected object with class "+o.getClass().getName());
        }
    }
public Concept transform ( Object o ) { if ( o instanceof Conjunction ) { Conjunction con = ( Conjunction ) o ; List < Concept > concepts = new ArrayList < Concept > ( ) ; for ( AbstractConcept ac : con . getConcepts ( ) ) { concepts . add ( transform ( ac ) ) ; } return new au . csiro . ontology . model . Conjunction ( concepts ) ; } else if ( o instanceof Existential ) { Existential e = ( Existential ) o ; AbstractConcept c = e . getConcept ( ) ; Concept iconcept = transform ( c ) ; int role = e . getRole ( ) ; 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 ) ; } else if ( o instanceof String ) { return new au . csiro . ontology . model . NamedConcept ( ( String ) o ) ; } else { throw new RuntimeException ( "Unexpected object with class " + o . getClass ( ) . getName ( ) ) ; } }
@param o
@return