use of eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ClassType 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.model.generated.oml.ClassType 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.model.generated.oml.ClassType 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.model.generated.oml.ClassType in project hale by halestudio.
the class OmlRdfGenerator method getClassType.
/**
* Converts from OML FeatureClass to the JAXB ClassType
*
* @param feature
* @return
*/
private ClassType getClassType(FeatureClass feature) {
ClassType cType = new ClassType();
IAbout about = null;
if (feature != null) {
if (feature.getAbout() != null) {
about = feature.getAbout();
}
if (feature.getLabel() != null) {
cType.getLabel().addAll(feature.getLabel());
}
if (about != null) {
cType.setAbout(about.getAbout());
}
if (feature.getTransformation() != null) {
cType.setTransf(getTransf(feature.getTransformation()));
}
if (feature.getAttributeTypeCondition() != null) {
cType.getAttributeTypeCondition().addAll(getConditions(feature.getAttributeTypeCondition()));
}
if (feature.getAttributeValueCondition() != null) {
cType.getAttributeValueCondition().addAll(getConditions(feature.getAttributeValueCondition()));
}
if (feature.getAttributeOccurenceCondition() != null) {
cType.getAttributeOccurenceCondition().addAll(getConditions(feature.getAttributeOccurenceCondition()));
}
}
return cType;
}
use of eu.esdihumboldt.hale.io.oml.internal.model.generated.oml.ClassType in project hale by halestudio.
the class OmlRdfGenerator method getEntityType.
/**
* converts from IEntity to the Jaxb generated EntityType
*
* @param entity
* @return
*/
private JAXBElement<? extends EntityType> getEntityType(IEntity entity) {
JAXBElement<? extends EntityType> eType = null;
if (entity != null) {
if (entity instanceof Property) {
// instantiate as PropertyType
Property property = (Property) entity;
PropertyType pType = getPropertyType(property);
eType = new JAXBElement<PropertyType>(new QName("http://www.omwg.org/TR/d7/ontology/alignment", "Property"), PropertyType.class, pType);
} else if (entity instanceof FeatureClass) {
// instantiate as ClassType
FeatureClass feature = (FeatureClass) entity;
ClassType cType = getClassType(feature);
eType = new JAXBElement<ClassType>(new QName("http://www.omwg.org/TR/d7/ontology/alignment", "Class"), ClassType.class, cType);
} else if (entity instanceof Relation) {
// instantiate as RelationType
// TODO add implementation, for the next release
} else if (entity instanceof PropertyQualifier) {
// instantiate as PropertyQualifierType
// TODO add implementation, will get the examples from MDV
}
}
return eType;
}
Aggregations