Transformations
Transformations are supported in multiple parts of the configuration. Transformations do not affect data sources, they are applied on-the-fly as part of the encoding. Filter expressions do not take transformations into account, they have to be based on the source values.
Name | Default | Description | Type | Since |
---|---|---|---|---|
rename | Rename a property. | string | v2.0 | |
remove | IN_COLLECTION (until version 3.0: OVERVIEW ) skips the property only for the Features resource, ALWAYS always skips it, NEVER never skips it. | string | v2.0 | |
flatten | Flattens object or array properties using the given separator. For arrays the property name is formed by the original property name followed by pairs of separator and array position. For objects the property name is formed by concatenating the original property separated by the given separator. Can only be applied on the feature level in the provider or using the wildcard property name * otherwise. | string | v2.0 | |
removeNullValues | true | Remove properties with value null , including properties transformed with nullify . Can only be applied on the feature level in the provider or using the wildcard property name * otherwise. | boolean | v4.0 |
objectReduceFormat | Reduces an object to a string using the same syntax as stringFormat but with additional replacements for the object property names. | string | v3.6 | |
objectReduceSelect | Reduces an object to one of its properties, the value is the desired property name. | string | v3.6 | |
objectRemoveSelect | Removes an object, if the property with the name in the value is null . | string | v3.6 | |
objectMapFormat | Maps an object to another object, the value is map where the keys are the new property names. The values use the same syntax as stringFormat but with additional replacements for the source object property names. | object | v3.6 | |
arrayReduceFormat | Reduces a value array to a string using the same syntax as stringFormat but with additional replacements for the array indexes. | string | v3.6 | |
stringFormat | Format a value, where {{value}} is replaced with the actual value and {{serviceUrl}} is replaced with the API landing page URI. Additonal operations can be applied to {{value}} by chaining them with | , see the examples below. | string | v2.0 | |
dateFormat | Format date(-time) values with the given pattern, e.g. dd.MM.yyyy for German notation. | string | v2.0 | |
codelist | Maps the value according to the given codelist. If the value is not found in the codelist or the codelist does not exist, the original value is passed through. Not applicable for properties containing objects. It is no longer recommended to specify codelist transformations in the feature provider or in the service. Instead, codelists associated with a property should be specified through the constraints of the property. Only the use in constraints enables the control of the representation of the values via the profile query parameter. | string | v2.0 | |
map | Maps the value according to the given map. If the value does not have a matching entry , the original value is passed through. A fallback mapping can be provided with the key * . | object | v2.0 | |
nullify | Maps all values matching the list of regular expressions to null . Not applicable for properties containing objects. | array | v2.0 |
stringFormat
Examples for https://example.com/id/kinder/kita/{{value}}
inserts the value into the URI template.
{{value | replace:'\\s*[0-9].*$':''}}
removes all white space and numbers at the end (e.g. to remove a street number)
{{value | replace:'^[^0-9]*':''}}
removes everything before the first digit
{{value | toUpper}}
transforms the value to upper case
{{value | toLower}}
transforms the value to lower case
{{value | urlEncode}}
encodes special characters in the text for usage as aprt of an URI
[{{value}}](https://de.wikipedia.org/wiki/{{value | replace:' ':'_' | urlencode}})
transforms a value into a markdown link to a Wikipedia entry