Search in sources :

Example 1 with DomainRestrictionType

use of eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.DomainRestrictionType 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 DomainRestrictionType

use of eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.DomainRestrictionType 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 3 with DomainRestrictionType

use of eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.DomainRestrictionType in project hale by halestudio.

the class OmlRdfGenerator method getDomainRestrictionType.

/**
 * Converts from OML FeatureClass to the JAXB generated
 * DomainRestrictionType
 *
 * @param feature
 * @return
 */
private DomainRestrictionType getDomainRestrictionType(FeatureClass feature) {
    DomainRestrictionType drType = new DomainRestrictionType();
    // set one property in case of the PropertyQualifier only
    drType.setClazz(getClassType(feature));
    return drType;
}
Also used : DomainRestrictionType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.DomainRestrictionType)

Aggregations

DomainRestrictionType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.DomainRestrictionType)3 FeatureClass (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.FeatureClass)2 ArrayList (java.util.ArrayList)2 About (eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About)1 ClassType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ClassType)1 ValueClassType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueClassType)1 IAbout (eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout)1