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;
}
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;
}
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;
}
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;
}
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;
}
Aggregations