use of eu.esdihumboldt.hale.io.oml.internal.goml.omwg.FeatureClass in project hale by halestudio.
the class OmlRdfGenerator method getDomainRestrictionTypes.
/**
* converts from the list of the FeatureClass to the collection of the
* FeatureClass
*
* @param domainRestriction
* @return
*/
private Collection<? extends DomainRestrictionType> getDomainRestrictionTypes(List<FeatureClass> features) {
if (features != null) {
ArrayList<DomainRestrictionType> drTypes = new ArrayList<DomainRestrictionType>(features.size());
DomainRestrictionType drType;
FeatureClass feature;
Iterator<?> iterator = features.iterator();
while (iterator.hasNext()) {
feature = (FeatureClass) iterator.next();
drType = getDomainRestrictionType(feature);
drTypes.add(drType);
}
return drTypes;
}
return new ArrayList<DomainRestrictionType>();
}
use of eu.esdihumboldt.hale.io.oml.internal.goml.omwg.FeatureClass 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.omwg.FeatureClass 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.omwg.FeatureClass 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.omwg.FeatureClass in project hale by halestudio.
the class OmlReader method setBeanLists.
private void setBeanLists(IEntity entity, List<NamedEntityBean> list, TypeIndex schema) {
if (entity.getAbout().getAbout().equals(Entity.NULL_ENTITY.getAbout().getAbout())) {
return;
}
if (entity instanceof ComposedFeatureClass) {
ComposedFeatureClass cfc = (ComposedFeatureClass) entity;
List<FeatureClass> coll = cfc.getCollection();
for (FeatureClass fc : coll) {
setBeanLists(fc, list, schema);
}
} else if (entity instanceof ComposedProperty) {
ComposedProperty cp = (ComposedProperty) entity;
List<Property> coll = cp.getCollection();
for (Property prop : coll) {
setBeanLists(prop, list, schema);
}
} else if (entity instanceof FeatureClass) {
// get the detailed about-information
IDetailedAbout about = DetailedAbout.getDetailedAbout(entity.getAbout(), false);
TypeBean typeBean = new TypeBean();
setTypeNameBean(typeBean, about, schema);
NamedEntityBean namedEntityBean = new NamedEntityBean();
namedEntityBean.setEntity(typeBean);
namedEntityBean.setName(null);
list.add(namedEntityBean);
} else if (entity instanceof Property) {
// get the detailed about-information
IDetailedAbout about = DetailedAbout.getDetailedAbout(entity.getAbout(), true);
PropertyBean prop = new PropertyBean();
List<ChildContextBean> childList = new ArrayList<ChildContextBean>();
List<String> props = about.getProperties();
for (String property : props) {
ChildContextBean ccb = new ChildContextBean();
ccb.setChildName(new QName(property));
childList.add(ccb);
}
setTypeNameBean(prop, about, schema);
prop.setProperties(childList);
NamedEntityBean namedEntityBean = new NamedEntityBean();
namedEntityBean.setEntity(prop);
namedEntityBean.setName(null);
list.add(namedEntityBean);
}
}
Aggregations