Search in sources :

Example 1 with IValueClass

use of eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IValueClass in project hale by halestudio.

the class OmlRdfGenerator method getValueClasses.

/**
 * Converts from list of the OML Classes to the list of the JAXB generated
 * classes
 *
 * @param valueClasses
 * @return
 */
private List<ValueClassType> getValueClasses(List<IValueClass> valueClasses) {
    List<ValueClassType> vcTypes = new ArrayList<ValueClassType>();
    if (valueClasses != null) {
        ValueClassType vcType = new ValueClassType();
        IValueClass vClass;
        Iterator<IValueClass> iterator = valueClasses.iterator();
        while (iterator.hasNext()) {
            vClass = iterator.next();
            if (vClass.getAbout() != null) {
                vcType.setAbout(vClass.getAbout());
            }
            if (vClass.getResource() != null) {
                vcType.setResource(vClass.getResource());
            }
            if (vClass.getValue() != null) {
                vcType.getValue().addAll(getValueExpressionTypes(vClass.getValue()));
            }
            vcTypes.add(vcType);
        }
    }
    return vcTypes;
}
Also used : IValueClass(eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IValueClass) ValueClassType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueClassType) ArrayList(java.util.ArrayList)

Example 2 with IValueClass

use of eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IValueClass in project hale by halestudio.

the class OmlRdfReader method getValueClass.

/**
 * Converts from List of JAXB Value Class objects to the list of the OML
 * objects
 *
 * @param valueClass
 * @return
 */
private List<IValueClass> getValueClass(List<ValueClassType> valueClass) {
    List<IValueClass> oValueClasses = new ArrayList<IValueClass>();
    IValueClass oValueClass = new ValueClass();
    Iterator<ValueClassType> iterator = valueClass.iterator();
    ValueClassType vcType;
    while (iterator.hasNext()) {
        vcType = iterator.next();
        // set about
        if (vcType.getAbout() != null) {
            ((ValueClass) oValueClass).setAbout(vcType.getAbout());
        }
        // set resource
        if (vcType.getResource() != null) {
            ((ValueClass) oValueClass).setResource(vcType.getResource());
        }
        // setValueExpression
        if (vcType.getValue() != null) {
            ((ValueClass) oValueClass).setValue(getValueExpression(vcType.getValue()));
        }
        oValueClasses.add(oValueClass);
    }
    return oValueClasses;
}
Also used : IValueClass(eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IValueClass) ValueClassType(eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueClassType) ArrayList(java.util.ArrayList) IValueClass(eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IValueClass) ValueClass(eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.ValueClass)

Aggregations

IValueClass (eu.esdihumboldt.hale.io.oml.internal.model.align.ext.IValueClass)2 ValueClassType (eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueClassType)2 ArrayList (java.util.ArrayList)2 ValueClass (eu.esdihumboldt.hale.io.oml.internal.goml.oml.ext.ValueClass)1