Search in sources :

Example 1 with ClassType

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

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

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

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

the class OmlRdfGenerator method getClassType.

/**
 * Converts from OML FeatureClass to the JAXB ClassType
 *
 * @param feature
 * @return
 */
private ClassType getClassType(FeatureClass feature) {
    ClassType cType = new ClassType();
    IAbout about = null;
    if (feature != null) {
        if (feature.getAbout() != null) {
            about = feature.getAbout();
        }
        if (feature.getLabel() != null) {
            cType.getLabel().addAll(feature.getLabel());
        }
        if (about != null) {
            cType.setAbout(about.getAbout());
        }
        if (feature.getTransformation() != null) {
            cType.setTransf(getTransf(feature.getTransformation()));
        }
        if (feature.getAttributeTypeCondition() != null) {
            cType.getAttributeTypeCondition().addAll(getConditions(feature.getAttributeTypeCondition()));
        }
        if (feature.getAttributeValueCondition() != null) {
            cType.getAttributeValueCondition().addAll(getConditions(feature.getAttributeValueCondition()));
        }
        if (feature.getAttributeOccurenceCondition() != null) {
            cType.getAttributeOccurenceCondition().addAll(getConditions(feature.getAttributeOccurenceCondition()));
        }
    }
    return cType;
}
Also used : IAbout(eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout) ClassType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ClassType) ValueClassType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueClassType)

Example 5 with ClassType

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

the class OmlRdfGenerator method getEntityType.

/**
 * converts from IEntity to the Jaxb generated EntityType
 *
 * @param entity
 * @return
 */
private JAXBElement<? extends EntityType> getEntityType(IEntity entity) {
    JAXBElement<? extends EntityType> eType = null;
    if (entity != null) {
        if (entity instanceof Property) {
            // instantiate as PropertyType
            Property property = (Property) entity;
            PropertyType pType = getPropertyType(property);
            eType = new JAXBElement<PropertyType>(new QName("http://www.omwg.org/TR/d7/ontology/alignment", "Property"), PropertyType.class, pType);
        } else if (entity instanceof FeatureClass) {
            // instantiate as ClassType
            FeatureClass feature = (FeatureClass) entity;
            ClassType cType = getClassType(feature);
            eType = new JAXBElement<ClassType>(new QName("http://www.omwg.org/TR/d7/ontology/alignment", "Class"), ClassType.class, cType);
        } else if (entity instanceof Relation) {
        // instantiate as RelationType
        // TODO add implementation, for the next release
        } else if (entity instanceof PropertyQualifier) {
        // instantiate as PropertyQualifierType
        // TODO add implementation, will get the examples from MDV
        }
    }
    return eType;
}
Also used : Relation(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.Relation) QName(javax.xml.namespace.QName) PropertyType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.PropertyType) JAXBElement(javax.xml.bind.JAXBElement) ClassType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ClassType) ValueClassType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueClassType) ComposedProperty(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.ComposedProperty) Property(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.Property) FeatureClass(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.FeatureClass) PropertyQualifier(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.PropertyQualifier)

Aggregations

ClassType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ClassType)6 ValueClassType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueClassType)6 FeatureClass (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.FeatureClass)5 IAbout (eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout)5 About (eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About)4 ComposedProperty (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.ComposedProperty)2 Property (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.Property)2 PropertyType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.PropertyType)2 Entity (eu.esdihumboldt.hale.io.oml.internal.goml.align.Entity)1 Transformation (eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.Transformation)1 PropertyQualifier (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.PropertyQualifier)1 Relation (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.Relation)1 IEntity (eu.esdihumboldt.hale.io.oml.internal.model.align.IEntity)1 DomainRestrictionType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.DomainRestrictionType)1 EntityType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.EntityType)1 PropertyCompositionType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.PropertyCompositionType)1 ArrayList (java.util.ArrayList)1 JAXBElement (javax.xml.bind.JAXBElement)1 QName (javax.xml.namespace.QName)1