Package au.csiro.snorocket.core.model

Examples of au.csiro.snorocket.core.model.AbstractLiteral


            StringBuilder sb = new StringBuilder();
            Datatype d = (Datatype)o;
            String feature = factory.lookupFeatureId(d.getFeature());
            sb.append(feature.toString());
            sb.append(".(");
            AbstractLiteral literal = d.getLiteral();
            sb.append(literal);
            sb.append(")");
            return sb.toString();
        } else if(o instanceof Concept) {
            Object obj = factory.lookupConceptId(((Concept)o).hashCode());
View Full Code Here


            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);
View Full Code Here

     * @return boolean
     */
    private boolean datatypeMatches(Datatype d1, Datatype d2) {
        assert (d1.getFeature() == d2.getFeature());

        AbstractLiteral lhsLit = d1.getLiteral();
        AbstractLiteral rhsLit = d2.getLiteral();
       
        Operator lhsOp = d1.getOperator();
        Operator rhsOp = d2.getOperator();

        if (rhsOp == Operator.EQUALS) {
View Full Code Here

     * @return boolean
     */
    private boolean datatypeMatches(Datatype d1, Datatype d2) {
        assert (d1.getFeature() == d2.getFeature());

        AbstractLiteral lhsLit = d1.getLiteral();
        AbstractLiteral rhsLit = d2.getLiteral();
       
        Operator lhsOp = d1.getOperator();
        Operator rhsOp = d2.getOperator();

        if (rhsOp == Operator.EQUALS) {
View Full Code Here

            StringBuilder sb = new StringBuilder();
            Datatype d = (Datatype)o;
            String feature = factory.lookupFeatureId(d.getFeature());
            sb.append(feature.toString());
            sb.append(".(");
            AbstractLiteral literal = d.getLiteral();
            sb.append(literal);
            sb.append(")");
            return sb.toString();
        } else if(o instanceof Concept) {
            Object obj = factory.lookupConceptId(((Concept)o).hashCode());
View Full Code Here

            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);
View Full Code Here

     * @return boolean
     */
    private boolean datatypeMatches(Datatype d1, Datatype d2) {
        assert (d1.getFeature() == d2.getFeature());

        AbstractLiteral lhsLit = d1.getLiteral();
        AbstractLiteral rhsLit = d2.getLiteral();
       
        Operator lhsOp = d1.getOperator();
        Operator rhsOp = d2.getOperator();

        if (rhsOp == Operator.EQUALS) {
View Full Code Here

TOP

Related Classes of au.csiro.snorocket.core.model.AbstractLiteral

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.