Search in sources :

Example 1 with About

use of eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About 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 About

use of eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About in project hale by halestudio.

the class OmlRdfReader method getProperty.

/**
 * Implements casting from the JAXB-Type to the OML Type for the Property
 * element.
 *
 * @param property jaxb-generated object
 * @return omlProperty
 */
private Property getProperty(PropertyType property) {
    Property omlProperty;
    // make decision: simple property or composed property
    if (property.getPropertyComposition() != null) {
        PropertyCompositionType pcType = property.getPropertyComposition();
        // initialize as composed property
        omlProperty = new ComposedProperty(getOperator(pcType.getOperator()), new About(""));
        // set collection of properties and/or relation
        if (pcType.getCollection() != null && pcType.getCollection().getItem() != null) {
            // set collection
            ((ComposedProperty) omlProperty).setCollection(getPropertyCollection(pcType.getCollection()));
        } else if (pcType.getProperty() != null) {
            // set a single property
            ((ComposedProperty) omlProperty).getCollection().add(getProperty(pcType.getProperty()));
        }
        if (pcType.getRelation() != null) {
            // set relation
            ((ComposedProperty) omlProperty).setRelation(getRelation(pcType.getRelation()));
        }
    } else {
        // initialize as property
        omlProperty = new Property(new About(""));
    }
    // set About
    if (property.getAbout() != null && !property.getAbout().equals("")) {
        omlProperty.setAbout(new About(property.getAbout()));
    }
    // set domain restriction
    if (property.getDomainRestriction() != null) {
        omlProperty.setDomainRestriction(getDomainRestriction(property.getDomainRestriction()));
    }
    // set label
    if (property.getLabel() != null) {
        omlProperty.setLabel(property.getLabel());
    }
    // set transformation
    if (property.getTransf() != null) {
        omlProperty.setTransformation(getTransformation(property.getTransf()));
    }
    // set type condition
    if (property.getTypeCondition() != null) {
        omlProperty.setTypeCondition(property.getTypeCondition());
    }
    // set value condition
    if (property.getValueCondition() != null) {
        omlProperty.setValueCondition(getValueCondition(property.getValueCondition()));
    }
    return omlProperty;
}
Also used : PropertyCompositionType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.PropertyCompositionType) ComposedProperty(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.ComposedProperty) ComposedProperty(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.ComposedProperty) Property(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.Property) About(eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About) IAbout(eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout)

Example 3 with About

use of eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About 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 About

use of eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About 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 About

use of eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About in project hale by halestudio.

the class Alignment method deepCopy.

/**
 * Create a deep copy of the alignment.
 *
 * @return a copy of the alignment
 */
public Alignment deepCopy() {
    Alignment result = new Alignment();
    result.setAbout(new About(this.getAbout().getAbout()));
    result.setLevel(this.getLevel());
    Schema schema1 = new Schema(this.level, (Formalism) this.getSchema1().getFormalism());
    schema1.setAbout(new About(this.getSchema1().getAbout().getAbout()));
    result.setSchema1(schema1);
    Schema schema2 = new Schema(this.level, (Formalism) this.getSchema2().getFormalism());
    schema2.setAbout(new About(this.getSchema2().getAbout().getAbout()));
    result.setSchema2(schema2);
    List<ICell> cells = new ArrayList<ICell>();
    for (ICell cell : this.getMap()) {
        cells.add(((Cell) cell).deepCopy());
    }
    result.setMap(cells);
    return result;
}
Also used : IAlignment(eu.esdihumboldt.hale.io.oml.internal.model.align.IAlignment) ISchema(eu.esdihumboldt.hale.io.oml.internal.model.align.ISchema) ArrayList(java.util.ArrayList) IAbout(eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout) About(eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About) ICell(eu.esdihumboldt.hale.io.oml.internal.model.align.ICell)

Aggregations

About (eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About)14 IAbout (eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout)14 FeatureClass (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.FeatureClass)6 ArrayList (java.util.ArrayList)6 ClassType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ClassType)4 ValueClassType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueClassType)4 Transformation (eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.Transformation)3 ICell (eu.esdihumboldt.hale.io.oml.internal.model.align.ICell)3 Parameter (eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.Parameter)2 ComposedProperty (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.ComposedProperty)2 Property (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.Property)2 Relation (eu.esdihumboldt.hale.io.oml.internal.goml.omwg.Relation)2 ISchema (eu.esdihumboldt.hale.io.oml.internal.model.align.ISchema)2 IParameter (eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IParameter)2 PropertyCompositionType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.PropertyCompositionType)2 Alignment (eu.esdihumboldt.hale.io.oml.internal.goml.align.Alignment)1 Cell (eu.esdihumboldt.hale.io.oml.internal.goml.align.Cell)1 Entity (eu.esdihumboldt.hale.io.oml.internal.goml.align.Entity)1 Formalism (eu.esdihumboldt.hale.io.oml.internal.goml.align.Formalism)1 Schema (eu.esdihumboldt.hale.io.oml.internal.goml.align.Schema)1