Search in sources :

Example 11 with About

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

the class OmlRdfReader method getRelation.

/**
 * Implements casting from the JAXB-Type to the OML Type for the Relation
 * element.
 *
 * @param relation jaxb-generated object
 * @return omlRelation
 */
private Relation getRelation(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.RelationType relation) {
    Relation omlRelation = new Relation(new About(""));
    if (relation != null) {
        // set about
        if (relation.getAbout() != null && !relation.getAbout().equals("")) {
            omlRelation.setAbout(new About(relation.getAbout()));
        }
        // set domain restriction
        if (relation.getDomainRestriction() != null) {
            FeatureClass domainRestriction = getDomainRestriction(relation.getDomainRestriction());
            ArrayList<FeatureClass> domainRestrictions = new ArrayList<FeatureClass>();
            domainRestrictions.add(domainRestriction);
            omlRelation.setDomainRestriction(domainRestrictions);
        }
        // set label
        if (relation.getLabel() != null && relation.getLabel().size() > 0) {
            omlRelation.setLabel(relation.getLabel());
        }
        // set transformation
        if (relation.getTransf() != null) {
            omlRelation.setTransformation(getTransformation(relation.getTransf()));
        }
        // set Range Restriction
        if (relation.getRangeRestriction() != null) {
            FeatureClass omlRangeRestriction = getRangeRestriction(relation.getRangeRestriction());
            List<FeatureClass> omlRangeRestrictions = new ArrayList<FeatureClass>();
            omlRangeRestrictions.add(omlRangeRestriction);
            omlRelation.setRangeRestriction(omlRangeRestrictions);
        }
    }
    return omlRelation;
}
Also used : Relation(eu.esdihumboldt.hale.io.oml.internal.goml.omwg.Relation) ArrayList(java.util.ArrayList) 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 12 with About

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

the class OmlRdfReader method getCell.

/**
 * converts from {@link CellType} to {@link Cell}
 *
 * @param cell
 * @return
 */
private Cell getCell(CellType cellType) {
    Cell cell = new Cell();
    List<String> labels = cellType.getLabel();
    if (labels != null) {
        cell.setLabel(labels);
    }
    // TODO check with Marian set about as UUID from string about
    // cell.setAbout(new About(UUID.fromString(cellType.getAbout())));
    About about = new About(UUID.randomUUID());
    if (cellType.getAbout() != null) {
        about.setAbout(cellType.getAbout());
    }
    cell.setAbout(about);
    // set entity1
    if (cellType.getEntity1() != null) {
        cell.setEntity1(getEntity(cellType.getEntity1().getEntity()));
    }
    // set entity2
    if (cellType.getEntity2() != null) {
        cell.setEntity2(getEntity(cellType.getEntity2().getEntity()));
    }
    // Measure is optional
    if (cellType.getMeasure() != null) {
        cell.setMeasure(cellType.getMeasure());
    }
    // Relation is optional
    if (cellType.getRelation() != null) {
        cell.setRelation(getRelation(cellType.getRelation()));
    }
    return cell;
}
Also used : Cell(eu.esdihumboldt.hale.io.oml.internal.goml.align.Cell) ICell(eu.esdihumboldt.hale.io.oml.internal.model.align.ICell) About(eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About) IAbout(eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout)

Example 13 with About

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

the class FeatureClass method deepCopy.

@Override
public IEntity deepCopy() {
    FeatureClass result = new FeatureClass(new About(this.getAbout().getAbout()));
    Transformation t = new Transformation(this.getTransformation().getService());
    List<IParameter> parameters = new ArrayList<IParameter>();
    for (IParameter p : this.getTransformation().getParameters()) {
        parameters.add(new Parameter(p.getName(), p.getValue()));
    }
    t.setParameters(parameters);
    result.setTransformation(t);
    List<String> newLabels = new ArrayList<String>();
    for (String label : this.getLabel()) {
        newLabels.add(label);
    }
    result.setLabel(newLabels);
    return result;
}
Also used : Transformation(eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.Transformation) IParameter(eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IParameter) ArrayList(java.util.ArrayList) IParameter(eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IParameter) Parameter(eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.Parameter) IAbout(eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout) About(eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About)

Example 14 with About

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

the class Property method deepCopy.

@Override
public IEntity deepCopy() {
    Property result = new Property(new About(this.getAbout().getAbout()));
    Transformation t = new Transformation(this.getTransformation().getService());
    List<IParameter> parameters = new ArrayList<IParameter>();
    for (IParameter p : this.getTransformation().getParameters()) {
        parameters.add(new Parameter(p.getName(), p.getValue()));
    }
    t.setParameters(parameters);
    result.setTransformation(t);
    List<String> newLabels = new ArrayList<String>();
    for (String label : this.getLabel()) {
        newLabels.add(label);
    }
    result.setLabel(newLabels);
    return result;
}
Also used : Transformation(eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.Transformation) IParameter(eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IParameter) ArrayList(java.util.ArrayList) IParameter(eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IParameter) Parameter(eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.Parameter) IAbout(eu.esdihumboldt.hale.io.oml.internal.model.rdf.IAbout) DetailedAbout(eu.esdihumboldt.hale.io.oml.internal.goml.rdf.DetailedAbout) About(eu.esdihumboldt.hale.io.oml.internal.goml.rdf.About)

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