Value List¶
A Value List is a list of allowed values for a component, like a codelist but without the identification rules of
SDMX items: a value id need not be a valid SDMX id (it can be a symbol such as %), and values have no parents,
validity, URI or links. A value list document starts ref: "ValueList=AGENCY:ID(1.0)".
Simple form¶
The document is the common header followed by the values. Each value is written
as a single ID: "name" pair.
format: "fusion-yaml(1.0.0)"
ref: "ValueList=ACY:VL_SYMBOLS(1.0.0)"
name: "TEST"
items:
- £: "Pound"
- $: "Dollar"
- '%': "Percent"
- '&': "Ampersand"
Source: valuelist/testSymbols.yaml
itemsis the list of values, in the order they are held in the value list (values are not sorted).- Each value is written as
ID: "name", where the name is the English name.
Value ids are written as YAML keys and are only quoted when YAML requires it. Symbols that have a meaning in YAML,
such as % and &, are quoted ('%'); others, such as £ and $, are not.
Complex form¶
A value is written in the simple form only when it has nothing to say other than its id and its English name. It becomes an object, keyed by its id, as soon as it carries more information.
format: "fusion-yaml(1.0.0)"
ref: "ValueList=ACY:VL_SYMBOLS(1.0.0)"
name: "TEST"
items:
- $: "Dollar"
- '%':
name: "Percent"
name-fr: "Pourcentage"
description: "A value expressed per hundred"
annotations:
- id: "NOTE"
title: "Unit symbol"
Constructed from the field order in ValueListCanonicalWriter.
A value is written as a string when all of the following are true:
- it has exactly one name, and that name is in English;
- it has no description;
- it has no annotations.
Otherwise the value is written as an object holding name and name-<locale>, then description and
description-<locale> (as localised text), then annotations.
The value list does not use the shared item writer, it has its own simple-item test (in ValueListCanonicalWriter).
This is because a value item is not an identifiable: it has no URI and no links, so they are not part of the test or
of the object form.
Field reference¶
Body fields, written after the common header:
| Field | Value | Written when |
|---|---|---|
partial |
true |
The value list is partial. |
items |
Array of values, each ID: "name" or ID: {object} |
The value list has at least one value. |
Value object fields (items[].<ID>), used when the value is not simple:
| Field | Value | Written when |
|---|---|---|
name, name-<locale> |
String | The value has a name in that locale. |
description, description-<locale> |
String | The value has a description in that locale. |
annotations |
Array, see annotations | The value has annotations. |
Reading notes¶
- A value written as
ID: "name"is read as a value with a single English name. - A value object accepts only names, descriptions and annotations. Any other field (for example
uriorparent) is rejected.