Skip to content

Transformation Scheme

A Transformation Scheme is a VTL program: an ordered set of Transformations, each assigning the result of a VTL expression to a result. The scheme can reference the other VTL schemes it depends on (mappings, name personalisations, custom types, rulesets and user defined operators). Documents start ref: "TransformationScheme=AGENCY:ID(1.0)".

Simple form

The smallest complete Transformation Scheme has a VTL version and one Transformation. A Transformation is never written in the ID: "name" short form, every Transformation is written as an object (see Items).

format: "fusion-yaml(1.0.0)"
ref: "TransformationScheme=SDMX:TRANSFORMATIONS(1.0)"
name: "TRANSFORMATIONS Name"
vtlVersion: "1.0"
items:
- T2:
    name: "N2"
    result: "r2"
    expression: "e2"
Trimmed from transformationscheme/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 Transformations, in scheme order, each keyed by its id (see items).
    • name – the localised name of the Transformation.
    • result – the VTL result (the left hand side of the assignment). Required.
    • expression – the VTL expression (the right hand side of the assignment). Required.

Complex form

format: "fusion-yaml(1.0.0)"
ref: "TransformationScheme=SDMX:TRANSFORMATIONS(1.0)"
name: "TRANSFORMATIONS Name"
vtlmappingscheme: "SDMX:VMS(1.0.0)"
namepersonalisationscheme: "SDMX:NPS(1.0.0)"
customtypescheme: "SDMX:CTR(1.0.0)"
rulesetSchemes:
- "SDMX:RS1(1.0.0)"
- "SDMX:RS2(2.0.0)"
userDefinedOperatorSchemes:
- "SDMX:UDO1(1.0.0)"
- "SDMX:UDO2(2.0.0)"
vtlVersion: "1.0"
items:
- T1:
    name: "N1"
    persistent: true
    result: "r1"
    expression: "e1"
- T2:
    name: "N2"
    result: "r2"
    expression: "e2"
Source: transformationscheme/testComplete.yaml

  • The VTL Mapping Scheme, Name Personalisation Scheme and Custom Type Scheme are each a single reference, keyed by the lower case class of the referenced structure (vtlmappingscheme, namepersonalisationscheme, customtypescheme) with a short URN value.
  • The Ruleset Schemes and User Defined Operator Schemes can be many, so they are written under the fixed field names rulesetSchemes and userDefinedOperatorSchemes. The values are short URNs with no class prefix, as the class is implied by the field. One reference is written as a scalar, several as an array (see value or array):

    rulesetSchemes: "SDMX:RS1(1.0.0)"
    
  • persistent: true is written on a Transformation whose result is persistent (<- rather than := in VTL). A non-persistent Transformation has no persistent field (booleans are written only when true).

  • A Transformation 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
vtlmappingscheme Short URN of a VTL Mapping Scheme The scheme references a VTL Mapping Scheme
namepersonalisationscheme Short URN of a Name Personalisation Scheme The scheme references a Name Personalisation Scheme
customtypescheme Short URN of a Custom Type Scheme The scheme references a Custom Type Scheme
rulesetSchemes Short URN, or array of short URNs, of Ruleset Schemes The scheme references at least one Ruleset Scheme
userDefinedOperatorSchemes Short URN, or array of short URNs, of User Defined Operator Schemes The scheme references at least one User Defined Operator Scheme
vtlVersion String The VTL version is set (always, unless a stub)
items Array of Transformations The scheme has at least one Transformation

Transformation 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 Transformation has a description
uri String The Transformation has a URI
persistent true The Transformation is persistent
result String Always (required)
expression String Always (required)
annotations Array, see annotations The Transformation has annotations
links Array, see links The Transformation has links

Items are always objects

Transformations always carry a result and an expression, so they never qualify for the - ID: "name" simple item form; the Transformation bean reports itself as never simple.