geosolutions-it / DATEX-Utilities

DATEX Utilities
https://datex2.eu/
1 stars 2 forks source link

Attribute mapping "npra:validity" return a WFS exception #30

Closed fouad-semaan closed 5 years ago

fouad-semaan commented 5 years ago

GeoServer WFS Exception:

ServiceExceptionReport xmlns="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.2.0" xsi:schemaLocation="http://www.opengis.net/ogc http://schemas.opengis.net/wfs/1.0.0/OGC-exception.xsd">
<ServiceException>
java.lang.RuntimeException: Failed to get property: {http://www.opengis.net/wfs/2.0}boundedBy Failed to get property: {http://www.opengis.net/wfs/2.0}boundedBy Exception occurred while computing bounds java.lang.RuntimeException: Error applying mapping with targetAttribute npra:situationRecord Error applying mapping with targetAttribute npra:situationRecord java.lang.RuntimeException: Error applying mapping with targetAttribute npra:validity Error applying mapping with targetAttribute npra:validity Could not extract collection from path.
</ServiceException>
</ServiceExceptionReport>

HALE Mapping for Validity

image

image

App-schema attribute mapping

                <AttributeMapping>
                    <targetAttribute>npra:validity</targetAttribute>
                    <sourceExpression>
                        <OCQL>collectionLink('validity')</OCQL>
                        <linkElement>npra:Validity</linkElement>
                        <linkField>FEATURE_LINK[2]</linkField>
                    </sourceExpression>
                    <isMultiple>true</isMultiple>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>FEATURE_LINK[1]</targetAttribute>
                    <sourceExpression>
                        <OCQL>nestedCollectionLink()</OCQL>
                    </sourceExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>npra:SituationRecord</targetAttribute>
                    <idExpression>
                        <OCQL>collectionId()</OCQL>
                    </idExpression>
                </AttributeMapping>
            </attributeMappings>
        </FeatureTypeMapping>
        <FeatureTypeMapping>
            <sourceDataStore>dataStore</sourceDataStore>
            <sourceType>geoJsonSituation</sourceType>
            <targetElement>npra:Validity</targetElement>
            <attributeMappings>
                <AttributeMapping>
                    <targetAttribute>FEATURE_LINK[2]</targetAttribute>
                    <sourceExpression>
                        <OCQL>nestedCollectionLink()</OCQL>
                    </sourceExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>npra:Validity</targetAttribute>
                    <idExpression>
                        <OCQL>collectionId()</OCQL>
                    </idExpression>
                </AttributeMapping>
                <AttributeMapping>
                    <targetAttribute>npra:validityStatus</targetAttribute>
                    <sourceExpression>
                        <OCQL>jsonSelect('validityStatus')</OCQL>
                    </sourceExpression>
                </AttributeMapping>
            </attributeMappings>
        </FeatureTypeMapping>
        <FeatureTypeMapping>
fouad-semaan commented 5 years ago

@nmco I controlled the geoJson and realized that "validity" is not a collection. Mapping directly the validity attributes under the situationReconrd collection, the WFS request works.