Codelists
Codelists allow to map property values to a different value. This is useful especially for HTML representations.
Configuration
The following table describes the structure of the code list files.
| Name | Default | Description | Type | Since |
|---|---|---|---|---|
label | id | Human readable label. | string | v2.0 |
description | null | A description of the codelist. | string | v4.3 |
entries | {} | Map with the original value as key and the new value as value. For a codelist that is just an enumeration, list the values in enum instead, each value is then mapped to itself. | object | v2.0 |
enum | [] | For a codelist that is just an enumeration, the list of values. Each value is added to entries with itself as the new value; a value that is already a key in entries keeps the value from entries. | array | v4.9 |
sourceType | TEMPLATES | Always TEMPLATES. | string | v2.0 |
fallback | the value | Optional default value. | string | v2.0 |
For the target values in entries and for fallback also stringFormat transformations can be used. If the transformed value is intended for HTML output, then Markdown markup can also be used, this will be formatted in the HTML output.
Example
Based on the INSPIRE codelist EnvironmentalDomain, maps values like soil to the German label of the entry in the INSPIRE codelist registry.
---
label: Umweltbereich, für den Umweltziele festgelegt werden können.
entries:
air: Luft
climateAndClimateChange: Klima und Klimawandel
healthProtection: Gesundheitsschutz
landUse: Bodennutzung
naturalResources: natürliche Ressourcen
natureAndBiodiversity: Natur und biologische Vielfalt
noise: Lärm
soil: Boden
sustainableDevelopment: nachhaltige Entwicklung
waste: Abfall
water: Wasser
If the codelist is just an enumeration of values without separate labels, the values can be listed in enum instead of entries. Each value is then also its own label:
---
label: Gebäudefunktion
enum:
- Wohngebäude
- Bürogebäude
- Lagerhalle
Storage
Codelists reside in the Store as values with type codelists.
Codelists have a path instead of an id. That means for example values/codelists/bar.yml would be referenced as bar, but you could additionally define values/codelists/foo/bar.yml. To reference that codelist somewhere else in the configuration you would need to use foo/bar.