Search in sources :

Example 1 with FeatureClass

use of eu.esdihumboldt.hale.io.oml.internal.goml.omwg.FeatureClass in project hale by halestudio.

the class OmlRdfGenerator method getDomainRestrictionTypes.

/**
 * converts from the list of the FeatureClass to the collection of the
 * FeatureClass
 *
 * @param domainRestriction
 * @return
 */
private Collection<? extends DomainRestrictionType> getDomainRestrictionTypes(List<FeatureClass> features) {
    if (features != null) {
        ArrayList<DomainRestrictionType> drTypes = new ArrayList<DomainRestrictionType>(features.size());
        DomainRestrictionType drType;
        FeatureClass feature;
        Iterator<?> iterator = features.iterator();
        while (iterator.hasNext()) {
            feature = (FeatureClass) iterator.next();
            drType = getDomainRestrictionType(feature);
            drTypes.add(drType);
        }
        return drTypes;
    }
    return new ArrayList<DomainRestrictionType>();
}
Also used : DomainRestrictionType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.DomainRestrictionType) ArrayList(java.util.ArrayList) FeatureClass(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.FeatureClass)

Example 2 with FeatureClass

use of eu.esdihumboldt.hale.io.oml.internal.goml.omwg.FeatureClass in project hale by halestudio.

the class OmlRdfReader method getRangeRestriction.

/**
 * Converts from the JAXB-based RangeRestrictionType to the OML FeatureClass
 *
 * @param domainRestriction
 * @return
 */
private FeatureClass getRangeRestriction(RangeRestrictionType rangeRestriction) {
    FeatureClass fClass;
    ClassType clazz;
    fClass = new FeatureClass(null);
    if (rangeRestriction != null) {
        clazz = rangeRestriction.getClazz();
        if (clazz != null) {
            // set about
            About fAbout = new About(java.util.UUID.randomUUID());
            if (clazz.getAbout() != null) {
                fAbout.setAbout(clazz.getAbout());
            }
            fClass.setAbout(fAbout);
            // set attributeValueCondition list
            if (clazz.getAttributeValueCondition() != null) {
                fClass.setAttributeValueCondition(getRestrictions(clazz.getAttributeValueCondition()));
            }
            // set attributeTypeCondition list
            if (clazz.getAttributeTypeCondition() != null) {
                fClass.setAttributeTypeCondition(getRestrictions(clazz.getAttributeTypeCondition()));
            }
            // set attributeOccurenceCondition
            if (clazz.getAttributeOccurenceCondition() != null) {
                fClass.setAttributeOccurenceCondition(getRestrictions(clazz.getAttributeOccurenceCondition()));
            }
            // set label list
            if (clazz.getLabel() != null) {
                fClass.setLabel(clazz.getLabel());
            }
            // set transformation
            if (clazz.getTransf() != null) {
                fClass.setTransformation(getTransformation(clazz.getTransf()));
            }
        }
    }
    return fClass;
}
Also used : ClassType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ClassType) ValueClassType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueClassType) FeatureClass(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.FeatureClass) About(eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About) IAbout(eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout)

Example 3 with FeatureClass

use of eu.esdihumboldt.hale.io.oml.internal.goml.omwg.FeatureClass in project hale by halestudio.

the class OmlRdfReader method getDomainRestriction.

/**
 * Converts from the List of DomainRestrictionType to the List of the
 * FeatureClass
 *
 * @param domainRestriction
 * @return
 */
private List<FeatureClass> getDomainRestriction(// TODO discuss the propertytype-field
List<DomainRestrictionType> domainRestriction) {
    List<FeatureClass> classes = new ArrayList<FeatureClass>(domainRestriction.size());
    DomainRestrictionType restriction = null;
    FeatureClass fClass;
    ClassType clazz;
    Iterator<DomainRestrictionType> iterator = domainRestriction.iterator();
    while (iterator.hasNext()) {
        restriction = iterator.next();
        clazz = restriction.getClazz();
        fClass = new FeatureClass(null);
        // set about
        About fAbout = new About(java.util.UUID.randomUUID());
        if (clazz.getAbout() != null) {
            fAbout.setAbout(clazz.getAbout());
        }
        fClass.setAbout(fAbout);
        // set attributeValueCondition list
        if (clazz.getAttributeValueCondition() != null) {
            fClass.setAttributeValueCondition(getRestrictions(clazz.getAttributeValueCondition()));
        }
        // set attributeTypeCondition list
        if (clazz.getAttributeTypeCondition() != null) {
            fClass.setAttributeTypeCondition(getRestrictions(clazz.getAttributeTypeCondition()));
        }
        // set attributeOccurenceCondition
        if (clazz.getAttributeOccurenceCondition() != null) {
            fClass.setAttributeOccurenceCondition(getRestrictions(clazz.getAttributeOccurenceCondition()));
        }
        classes.add(fClass);
    }
    return classes;
}
Also used : DomainRestrictionType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.DomainRestrictionType) ArrayList(java.util.ArrayList) ClassType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ClassType) ValueClassType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueClassType) FeatureClass(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.FeatureClass) About(eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About) IAbout(eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout)

Example 4 with FeatureClass

use of eu.esdihumboldt.hale.io.oml.internal.goml.omwg.FeatureClass in project hale by halestudio.

the class OmlRdfReader method getDomainRestriction.

/**
 * Converts from the JAXB-based DomainRestrictionType to the OML
 * FeatureClass
 *
 * @param domainRestriction
 * @return
 */
private FeatureClass getDomainRestriction(DomainRestrictionType domainRestriction) {
    FeatureClass fClass;
    ClassType clazz;
    fClass = new FeatureClass(null);
    if (domainRestriction != null) {
        clazz = domainRestriction.getClazz();
        if (clazz != null) {
            // set about
            About fAbout = new About(java.util.UUID.randomUUID());
            if (clazz.getAbout() != null) {
                fAbout.setAbout(clazz.getAbout());
            }
            fClass.setAbout(fAbout);
            // set attributeValueCondition list
            if (clazz.getAttributeValueCondition() != null) {
                fClass.setAttributeValueCondition(getRestrictions(clazz.getAttributeValueCondition()));
            }
            // set attributeTypeCondition list
            if (clazz.getAttributeTypeCondition() != null) {
                fClass.setAttributeTypeCondition(getRestrictions(clazz.getAttributeTypeCondition()));
            }
            // set attributeOccurenceCondition
            if (clazz.getAttributeOccurenceCondition() != null) {
                fClass.setAttributeOccurenceCondition(getRestrictions(clazz.getAttributeOccurenceCondition()));
            }
            // set label list
            if (clazz.getLabel() != null) {
                fClass.setLabel(clazz.getLabel());
            }
            // set transformation
            if (clazz.getTransf() != null) {
                fClass.setTransformation(getTransformation(clazz.getTransf()));
            }
        }
    }
    return fClass;
}
Also used : ClassType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ClassType) ValueClassType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueClassType) FeatureClass(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.FeatureClass) About(eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About) IAbout(eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout)

Example 5 with FeatureClass

use of eu.esdihumboldt.hale.io.oml.internal.goml.omwg.FeatureClass in project hale by halestudio.

the class OmlReader method setBeanLists.

private void setBeanLists(IEntity entity, List<NamedEntityBean> list, TypeIndex schema) {
    if (entity.getAbout().getAbout().equals(Entity.NULL_ENTITY.getAbout().getAbout())) {
        return;
    }
    if (entity instanceof ComposedFeatureClass) {
        ComposedFeatureClass cfc = (ComposedFeatureClass) entity;
        List<FeatureClass> coll = cfc.getCollection();
        for (FeatureClass fc : coll) {
            setBeanLists(fc, list, schema);
        }
    } else if (entity instanceof ComposedProperty) {
        ComposedProperty cp = (ComposedProperty) entity;
        List<Property> coll = cp.getCollection();
        for (Property prop : coll) {
            setBeanLists(prop, list, schema);
        }
    } else if (entity instanceof FeatureClass) {
        // get the detailed about-information
        IDetailedAbout about = DetailedAbout.getDetailedAbout(entity.getAbout(), false);
        TypeBean typeBean = new TypeBean();
        setTypeNameBean(typeBean, about, schema);
        NamedEntityBean namedEntityBean = new NamedEntityBean();
        namedEntityBean.setEntity(typeBean);
        namedEntityBean.setName(null);
        list.add(namedEntityBean);
    } else if (entity instanceof Property) {
        // get the detailed about-information
        IDetailedAbout about = DetailedAbout.getDetailedAbout(entity.getAbout(), true);
        PropertyBean prop = new PropertyBean();
        List<ChildContextBean> childList = new ArrayList<ChildContextBean>();
        List<String> props = about.getProperties();
        for (String property : props) {
            ChildContextBean ccb = new ChildContextBean();
            ccb.setChildName(new QName(property));
            childList.add(ccb);
        }
        setTypeNameBean(prop, about, schema);
        prop.setProperties(childList);
        NamedEntityBean namedEntityBean = new NamedEntityBean();
        namedEntityBean.setEntity(prop);
        namedEntityBean.setName(null);
        list.add(namedEntityBean);
    }
}
Also used : QName(javax.xml.namespace.QName) TypeBean(eu.esdihumboldt.hale.common.align.io.impl.internal.TypeBean) ComposedFeatureClass(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.ComposedFeatureClass) ComposedFeatureClass(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.ComposedFeatureClass) FeatureClass(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.FeatureClass) ChildContextBean(eu.esdihumboldt.hale.common.align.io.impl.internal.ChildContextBean) NamedEntityBean(eu.esdihumboldt.hale.common.align.io.impl.internal.NamedEntityBean) ComposedProperty(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.ComposedProperty) IDetailedAbout(eu.esdihumboldt.hale.io.oml.internal.goml.rdf.IDetailedAbout) List(java.util.List) ArrayList(java.util.ArrayList) ComposedProperty(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.ComposedProperty) Property(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.Property) PropertyBean(eu.esdihumboldt.hale.common.align.io.impl.internal.PropertyBean)

Aggregations

FeatureClass (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.FeatureClass)9 About (eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About)6 IAbout (eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout)6 ClassType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ClassType)5 ValueClassType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueClassType)5 ArrayList (java.util.ArrayList)4 ComposedProperty (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.ComposedProperty)3 Property (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.Property)3 Relation (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.Relation)3 DomainRestrictionType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.DomainRestrictionType)2 PropertyType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.PropertyType)2 QName (javax.xml.namespace.QName)2 ChildContextBean (eu.esdihumboldt.hale.common.align.io.impl.internal.ChildContextBean)1 NamedEntityBean (eu.esdihumboldt.hale.common.align.io.impl.internal.NamedEntityBean)1 PropertyBean (eu.esdihumboldt.hale.common.align.io.impl.internal.PropertyBean)1 TypeBean (eu.esdihumboldt.hale.common.align.io.impl.internal.TypeBean)1 Entity (eu.esdihumboldt.hale.io.oml.internal.goml.align.Entity)1 Transformation (eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.Transformation)1 ComposedFeatureClass (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.ComposedFeatureClass)1 PropertyQualifier (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.PropertyQualifier)1