Search in sources :

Example 1 with ComposedProperty

use of eu.esdihumboldt.commons.goml.omwg.ComposedProperty in project hale by halestudio.

the class AlignmentToModelAlignmentDigester method createAttribute.

private ModelAttributeMappingCell createAttribute(ICell original, Property sourceEntity, Property targetEntity, Map<String, SchemaElement> sourceFeatures, Map<String, SchemaElement> targetFeatures) {
    // FIXME what about composed properties?
    if (sourceEntity instanceof ComposedProperty || targetEntity instanceof ComposedProperty) {
        // $NON-NLS-1$
        report.setFailed(original, "Composed properties not supported");
        return null;
    }
    List<FeatureClass> filter = sourceEntity.getDomainRestriction();
    if (filter != null && !filter.isEmpty()) {
        // $NON-NLS-1$
        report.setWarning(original, "Filters on attributive functions currently not supported in the RIF export");
    }
    String function = sourceEntity.getTransformation().getService().getLocation();
    if (!RenameAttributeFunction.class.getName().equals(function)) {
        // $NON-NLS-1$ //$NON-NLS-2$
        report.setWarning(original, "Function " + function + " not recognized");
    }
    IDetailedAbout sourceAbout = DetailedAbout.getDetailedAbout(sourceEntity.getAbout(), true);
    IDetailedAbout targetAbout = DetailedAbout.getDetailedAbout(targetEntity.getAbout(), true);
    try {
        return new ModelAttributeMappingCell(createAttributePath(sourceAbout, sourceFeatures), createAttributePath(targetAbout, targetFeatures));
    } catch (TranslationException e) {
        report.setFailed(original, e.getMessage());
        return null;
    }
}
Also used : ModelAttributeMappingCell(com.onespatial.jrc.tns.oml_to_rif.model.alignment.ModelAttributeMappingCell) ComposedProperty(eu.esdihumboldt.commons.goml.omwg.ComposedProperty) IDetailedAbout(eu.esdihumboldt.commons.goml.rdf.IDetailedAbout) TranslationException(com.onespatial.jrc.tns.oml_to_rif.api.TranslationException) FeatureClass(eu.esdihumboldt.commons.goml.omwg.FeatureClass)

Aggregations

TranslationException (com.onespatial.jrc.tns.oml_to_rif.api.TranslationException)1 ModelAttributeMappingCell (com.onespatial.jrc.tns.oml_to_rif.model.alignment.ModelAttributeMappingCell)1 ComposedProperty (eu.esdihumboldt.commons.goml.omwg.ComposedProperty)1 FeatureClass (eu.esdihumboldt.commons.goml.omwg.FeatureClass)1 IDetailedAbout (eu.esdihumboldt.commons.goml.rdf.IDetailedAbout)1