Package au.csiro.ontology.model

Examples of au.csiro.ontology.model.NamedFeature


        }
        return r;
    }

    protected NamedFeature getFeature(String id, Map<String, NamedFeature> fi) {
        NamedFeature f = fi.get(id);
        if (f == null) {
            f = new NamedFeature(id);
            fi.put(id, f);
        }
        return f;
    }
View Full Code Here


                return value;
            }
        }

        protected void mapDatatype(List<Concept> conjs, String[] datatype) {
            NamedFeature feature = getFeature(datatype[0], fi);
            String type = featureType.get(datatype[0]);

            String operatorId = datatype[1];
            String unitId = datatype[3];
View Full Code Here

                OWLLiteral l = e.getValue();
                OWLDatatype type = l.getDatatype();

                checkInconsistentProperty(dp, type);

                NamedFeature f = new NamedFeature(dp.toStringID());
                Literal lit = getLiteral(l);
                if(lit != null) {
                    push(new Datatype(f, Operator.EQUALS,lit));
                } else {
                    problems.add("Axiom " + e + " will be ignored because of the unsupported literal.");
                }
            }

            public void visit(OWLDataAllValuesFrom e) {
                unimplemented(e);
            }

            public void visit(OWLDataSomeValuesFrom e) {
                OWLDataProperty dp = e.getProperty().asOWLDataProperty();
                OWLDataRange range = e.getFiller();
               
                /*
                 * An OWLDataRange can be one of the following:
                 * Datatype | DataIntersectionOf | DataUnionOf |
                 * DataComplementOf | DataOneOf | DatatypeRestriction
                 *
                 * We initially support only DataOneOf.
                 */
                if(range instanceof OWLDataOneOf) {
                    OWLDataOneOf doo = (OWLDataOneOf)range;
                    Set<OWLLiteral> values = doo.getValues();
                    if(values.size() != 1) {
                        problems.add("Expected only a single literal in "+e);
                        return;
                    }
                    OWLLiteral l = (OWLLiteral)values.toArray()[0];
                    OWLDatatype type = l.getDatatype();
                    checkInconsistentProperty(dp, type);
                   
                    NamedFeature f = new NamedFeature(dp.toStringID());
                    Literal lit = getLiteral(l);
                    if(lit != null) {
                        push(new Datatype(f, Operator.EQUALS, lit));
                    } else {
                        problems.add("Axiom " + e + " will be ignored because of the unsupported literal.");
                    }
                } else if(range instanceof OWLDatatypeRestriction) {
                    NamedFeature f = new NamedFeature(dp.toStringID());
                   
                    OWLDatatypeRestriction dtr = (OWLDatatypeRestriction)range;
                    Set<OWLFacetRestriction> frs = dtr.getFacetRestrictions();
                   
                    List<Datatype> conjuncts = new ArrayList<Datatype>();
View Full Code Here

        }
        return r;
    }

    protected NamedFeature getFeature(String id, Map<String, NamedFeature> fi) {
        NamedFeature f = fi.get(id);
        if (f == null) {
            f = new NamedFeature(id);
            fi.put(id, f);
        }
        return f;
    }
View Full Code Here

                return value;
            }
        }

        protected void mapDatatype(List<Concept> conjs, String[] datatype) {
            NamedFeature feature = getFeature(datatype[0], fi);
            String type = featureType.get(datatype[0]);

            String operatorId = datatype[1];
            String unitId = datatype[3];
View Full Code Here

            return new Existential(new NamedRole(roleId), con);
        } else if(obj instanceof au.csiro.snorocket.core.model.Datatype) {
            au.csiro.snorocket.core.model.Datatype dt = (au.csiro.snorocket.core.model.Datatype) obj;
            String featureId = factory.lookupFeatureId(dt.getFeature());
            Literal l = transformLiteralToModel(dt.getLiteral());
            return new Datatype(new NamedFeature(featureId), dt.getOperator(), l);
        } else if(obj instanceof au.csiro.snorocket.core.model.Concept) {
            au.csiro.snorocket.core.model.Concept c = (au.csiro.snorocket.core.model.Concept) obj;
            Object id = factory.lookupConceptId(c.hashCode());
            if(id instanceof String) {
                return new NamedConcept((String) id);
View Full Code Here

            return new Conjunction(result);
        }
    }

    protected void addDatatype(final List<Concept> result, au.csiro.snorocket.core.model.Datatype datatype) {
        Feature feature = new NamedFeature(factory.lookupFeatureId(datatype.getFeature()));
        Operator operator = Operator.EQUALS;
        Literal literal;
        if (datatype.getLiteral() instanceof DecimalLiteral) {
            literal = new au.csiro.ontology.model.DecimalLiteral(((DecimalLiteral) datatype.getLiteral()).getValue());
        } else if (datatype.getLiteral() instanceof IntegerLiteral) {
View Full Code Here

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

    public static Role createNamedRole(String id) {
        return new NamedRole(id);
    }

    public static Feature createNamedFeature(String id) {
        return new NamedFeature(id);
    }
View Full Code Here

            return new Existential(new NamedRole(roleId), con);
        } else if(obj instanceof au.csiro.snorocket.core.model.Datatype) {
            au.csiro.snorocket.core.model.Datatype dt = (au.csiro.snorocket.core.model.Datatype) obj;
            String featureId = factory.lookupFeatureId(dt.getFeature());
            Literal l = transformLiteralToModel(dt.getLiteral());
            return new Datatype(new NamedFeature(featureId), dt.getOperator(), l);
        } else if(obj instanceof au.csiro.snorocket.core.model.Concept) {
            au.csiro.snorocket.core.model.Concept c = (au.csiro.snorocket.core.model.Concept) obj;
            Object id = factory.lookupConceptId(c.hashCode());
            if(id instanceof String) {
                return new NamedConcept((String) id);
View Full Code Here

TOP

Related Classes of au.csiro.ontology.model.NamedFeature

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.