Search in sources :

Example 1 with ValueExpression

use of eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.ValueExpression in project hale by halestudio.

the class OmlRdfGenerator method getJAXBValueExpressions.

private Collection<? extends ValueExprType> getJAXBValueExpressions(List<IValueExpression> value) {
    List<ValueExprType> vExpressions = new ArrayList<ValueExprType>(value.size());
    Iterator<?> iterator = value.iterator();
    ValueExprType veType;
    while (iterator.hasNext()) {
        ValueExpression ve = (ValueExpression) iterator.next();
        veType = new ValueExprType();
        if (ve.getLiteral() != null) {
            veType.setLiteral(ve.getLiteral());
        }
        if (ve.getMax() != null) {
            veType.setMax(ve.getMax());
        }
        if (ve.getMin() != null) {
            veType.setMin(ve.getMin());
        }
        if (ve.getApply() != null) {
            veType.setApply(getApplayType(ve.getApply()));
        }
        vExpressions.add(veType);
    }
    return vExpressions;
}
Also used : ValueExpression(eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.ValueExpression) IValueExpression(eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IValueExpression) ArrayList(java.util.ArrayList) ValueExprType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueExprType)

Example 2 with ValueExpression

use of eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.ValueExpression in project hale by halestudio.

the class OmlRdfGenerator method getValueExpressionTypes.

// /**
// * Converts from OML Restriction to the JAXB PropertyValueRestrictionType
// *
// * @param restriction
// * @return
// */
// private PropValueRestrictionType getPropertyValueRestrictionType(Restriction restriction) {
// PropValueRestrictionType pvrType = new PropValueRestrictionType();
// if (restriction != null) {
// if (restriction.getComparator() != null) {
// pvrType.setComparator(getComparator(restriction.getComparator()));
// }
// if (restriction.getValue() != null) {
// pvrType.getValue().addAll(getValueExpressionTypes(restriction.getValue()));
// }
// }
// return pvrType;
// }
/**
 * Converts from List of ValueExpression to the Collection of ValueExprType
 *
 * @param value
 * @return
 */
private Collection<? extends ValueExprType> getValueExpressionTypes(List<IValueExpression> values) {
    if (values != null) {
        ArrayList<ValueExprType> veTypes = new ArrayList<ValueExprType>(values.size());
        ValueExprType veType;
        ValueExpression expression;
        Iterator<?> iterator = values.iterator();
        while (iterator.hasNext()) {
            expression = (ValueExpression) iterator.next();
            veType = getValueExprType(expression);
            veTypes.add(veType);
        }
        return veTypes;
    }
    return new ArrayList<ValueExprType>();
}
Also used : ValueExpression(eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.ValueExpression) IValueExpression(eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IValueExpression) ArrayList(java.util.ArrayList) ValueExprType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueExprType)

Example 3 with ValueExpression

use of eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.ValueExpression in project hale by halestudio.

the class OmlRdfReader method getValueExpression.

/**
 * Conversts from the list of <ValueExprType> to the list of ValueExpression
 *
 * @param valueExpr
 * @return
 */
private List<IValueExpression> getValueExpression(List<ValueExprType> valueExpr) {
    List<IValueExpression> omlExpressions = new ArrayList<IValueExpression>(valueExpr.size());
    ValueExpression omlExpr;
    Iterator<ValueExprType> iterator = valueExpr.iterator();
    while (iterator.hasNext()) {
        ValueExprType jaxbExpr = iterator.next();
        if (jaxbExpr.getLiteral() != null) {
            omlExpr = new ValueExpression(jaxbExpr.getLiteral());
            if (jaxbExpr.getMax() != null) {
                omlExpr.setMax(jaxbExpr.getMax());
            }
            if (jaxbExpr.getMin() != null) {
                omlExpr.setMin(jaxbExpr.getMin());
            }
            // TODO implement set Apply
            // omlExpr.setApply(getFunction(jaxbExpr.getApply()));
            omlExpressions.add(omlExpr);
        }
    }
    return omlExpressions;
}
Also used : IValueExpression(eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IValueExpression) ValueExpression(eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.ValueExpression) IValueExpression(eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IValueExpression) ArrayList(java.util.ArrayList) ValueExprType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueExprType)

Aggregations

ValueExpression (eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.ValueExpression)3 IValueExpression (eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IValueExpression)3 ValueExprType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueExprType)3 ArrayList (java.util.ArrayList)3