Skip to content

Custom Type Scheme

A Custom Type Scheme is a VTL scheme holding Custom Types, each of which describes how a VTL basic scalar type is represented in SDMX data (its SDMX data type, output format, null value and literal format). Documents start ref: "CustomTypeScheme=AGENCY:ID(1.0)".

Simple form

The smallest complete Custom Type Scheme has a VTL version and one Custom Type with its two required fields. A Custom Type is never written in the ID: "name" short form, every Custom Type is written as an object.

format: "fusion-yaml(1.0.0)"
ref: "CustomTypeScheme=SDMX:CUSTOM_TYPES(1.0)"
name: "CUSTOM_TYPES Name"
vtlVersion: "1.0"
items:
- CT2:
    name: "CT2 Name"
    vtlScalarType: "scaler2"
    dataType: "data2"
Trimmed from customtypescheme/testComplete.yaml

The document starts with the common header. The body fields are:

  • vtlVersion – the version of VTL the scheme is written in. Required for every VTL scheme that is not a stub.
  • items – the Custom Types, in scheme order, each keyed by its id (see items).
    • name – the localised name of the Custom Type.
    • vtlScalarType – the VTL basic scalar type being customised. Required.
    • dataType – the SDMX data type the VTL type is represented as. Required.

Complex form

A Custom Type can add its output format, null value and VTL literal format. The scheme has no references to other structures.

format: "fusion-yaml(1.0.0)"
ref: "CustomTypeScheme=SDMX:CUSTOM_TYPES(1.0)"
name: "CUSTOM_TYPES Name"
vtlVersion: "1.0"
items:
- CT1:
    name: "CT1 Name"
    vtlScalarType: "scaler"
    dataType: "data"
    outputFormat: "of"
    nullValue: "nv"
    vtlLiteralFormat: "lf"
- CT2:
    name: "CT2 Name"
    vtlScalarType: "scaler2"
    dataType: "data2"
Source: customtypescheme/testComplete.yaml

  • outputFormat, nullValue and vtlLiteralFormat are each written only when set, in that order.
  • A Custom Type may also carry a description, a URI, annotations and links, written in the positions given in the field reference below.

Field reference

Scheme fields, written after the common header:

Field Value Written when
partial true The scheme is a partial item scheme
vtlVersion String The VTL version is set (always, unless a stub)
items Array of Custom Types The scheme has at least one Custom Type

Custom Type fields (items[].<ID>):

Field Value Written when
name, name-<lang> String Always (en as name, other locales as name-<lang>)
description, description-<lang> String The Custom Type has a description
uri String The Custom Type has a URI
vtlScalarType String Always (required)
dataType String Always (required)
outputFormat String The output format is set
nullValue String The null value is set
vtlLiteralFormat String The VTL literal format is set
annotations Array, see annotations The Custom Type has annotations
links Array, see links The Custom Type has links

Custom Types never use the - ID: "name" simple item form, as the Custom Type bean reports itself as never simple.