use of eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueConditionType in project hale by halestudio.
the class OmlRdfGenerator method getValueConditions.
/**
* Converts from the list of restrictions to the collection of the
* ValueConditionType
*
* @param restrictions
* @return
*/
private Collection<? extends ValueConditionType> getValueConditions(List<Restriction> restrictions) {
if (restrictions != null) {
ArrayList<ValueConditionType> vcTypes = new ArrayList<ValueConditionType>(restrictions.size());
ValueConditionType vcType;
Restriction restriction;
Iterator<?> iterator = restrictions.iterator();
while (iterator.hasNext()) {
restriction = (Restriction) iterator.next();
vcType = getValueConditionType(restriction);
vcTypes.add(vcType);
}
return vcTypes;
}
return new ArrayList<ValueConditionType>();
}
use of eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueConditionType in project hale by halestudio.
the class OmlRdfGenerator method getValueConditionType.
/**
* converts from OML Restriction to the JAXB ValueConditionType
*
* @param restriction
* @return
*/
private ValueConditionType getValueConditionType(Restriction restriction) {
ValueConditionType vcType = new ValueConditionType();
vcType.setRestriction(getRestrictionType(restriction));
if (restriction.getSeq() != null) {
vcType.setSeq(restriction.getSeq());
}
return vcType;
}
use of eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ValueConditionType in project hale by halestudio.
the class OmlRdfReader method getValueCondition.
/**
* Converts from List<ValueConditionType> to List<Restriction>
*
* @param valueCondition
* @return
*/
private List<Restriction> getValueCondition(List<ValueConditionType> valueCondition) {
List<Restriction> restrictions = new ArrayList<Restriction>(valueCondition.size());
Iterator<ValueConditionType> iterator = valueCondition.iterator();
Restriction restriction;
List<ValueExprType> valueExpr = null;
while (iterator.hasNext()) {
ValueConditionType condition = iterator.next();
// get List<ValueExpressionType>
if (condition.getRestriction() != null && condition.getRestriction().getValue() != null) {
valueExpr = condition.getRestriction().getValue();
}
if ((valueExpr == null || valueExpr.size() == 0) && condition.getRestriction().getValueClass() != null) {
valueExpr = condition.getRestriction().getValueClass().getValue();
}
// TODO:clear with MdV
// restriction = new Restriction(null,
// getValueExpression(valueExpr));
restriction = new Restriction(getValueExpression(valueExpr));
if (condition.getRestriction() != null && condition.getRestriction().getComparator() != null) {
restriction.setComparator(getComparator(condition.getRestriction().getComparator()));
}
// add Sequence ID if it exists
if (condition.getSeq() != null) {
restriction.setSeq(condition.getSeq());
}
// TODO add Property onAttribute
restrictions.add(restriction);
}
return restrictions;
}
Aggregations