Polymorphism in application-schema
Support for polymorphism is included in Geoserver 2.0.2. Why do we need polymorphism support in app-schema? Some complex attributes are polymorphic by nature, which means they can have different types for different features.
Before polymorphism was supported, attribute types had to be specified in the mapping file, so could not vary across features. With polymorphism support, filter functions can now be used to specify conditions when determining the encoded type.
For example:
If MaterialCode is “rock”, er:material should be encoded as gsml:RockMaterial, otherwise it should be encoded as gsml:Mineral.
This can be expressed in the mapping file like this:
<AttributeMapping>
<targetAttribute>er:material</targetAttribute>
<sourceExpression>
<linkElement>
if_then_else(equalTo(MaterialCode, 'rock'), 'gsml:RockMaterial', 'gsml:Mineral')
</linkElement>
</sourceExpression>
</AttributeMapping>
Another common example is replacing null values with an xlink:href to a URI representing missing values:
<AttributeMapping>
<targetAttribute>er:startDate</targetAttribute>
<sourceExpression>
<linkElement>if_then_else(isNull(START_DATE), toXlinkHref('urn:ogc:def:nil:OGC::missing'),
'gml:TimeInstantPropertyType')
</linkElement>
</sourceExpression>
</AttributeMapping>
Read more about app-schema polymorphism support: polymorphism.
Vulnerability
- GeoServer 2.26.1 Release
- GeoServer 2.25.4 Release
- GeoServer 2.26.0 Release
- CVE-2024-36401 Remote Code Execution (RCE) vulnerability in evaluating property name expressions
- GeoServer 2.25.2 Release
- GeoServer 2.24.4 Release
- GeoServer 2.23.6 Release
- GeoServer 2.25.1 Release
- GeoServer 2.25.0 Release
- GeoServer 2.23.5 Release