Last modified by Helena K. on 2026/06/10 10:09

From version 2.1
edited by Helena K.
on 2025/06/16 13:40
Change comment: There is no comment for this version
To version 10.1
edited by Helena K.
on 2026/06/09 20:15
Change comment: There is no comment for this version

Summary

Details

Page properties
Tags
... ... @@ -1,0 +1,1 @@
1 +Artefact|Attribute|Code|Code list|Component|Concept scheme|Currency|Data set|Data structure definition|Dataflow|Dimension|Facet|Maintainable artefact|Measure|Nameable artefact|Representation|SDMX Information Model|Statistical data and metadata exchange|Structural metadata|Validation and transformation language
Content
... ... @@ -18,7 +18,7 @@
18 18  
19 19  This section does not explain the VTL language or any of the content published in the VTL guides. Rather, this is a description of how the VTL can be used in the SDMX context and applied to SDMX artefacts.
20 20  
21 -== 12.2 References to SDMX artefacts from VTL statements ==
21 +== 12.2 References to SDMX artefacts from VTL statements ==
22 22  
23 23  === 12.2.1 Introduction ===
24 24  
... ... @@ -78,8 +78,12 @@
78 78  * if the artefact is a Dimension, TimeDimension, Measure or DataAttribute (the object-id is the name of one of the artefacts above, which are data structure components)
79 79  * if the artefact is a Concept (the object-id is the name of the Concept)
80 80  
81 -For example, by using the URN, the VTL Transformation that sums two SDMX Dataflows DF1 and DF2 and assigns the result to a third persistent Dataflow DFR, assuming that DF1, DF2 and DFR are the maintainedobject-id of the three Dataflows, that their version is 1.0.0 and their Agency is AG, would be written as{{footnote}}Since these references to SDMX objects include non-permitted characters as per the VTL ID notation, they need to be included between single quotes, according to the VTL rules for irregular names.{{/footnote}}:
82 82  
82 +
83 +For example, by using the URN, the VTL Transformation that sums two SDMX Dataflows DF1 and DF2 and assigns the result to a third persistent Dataflow DFR, assuming that DF1, DF2 and DFR are the maintainedobject-id of the three Dataflows, that their version is 1.0.0 and their Agency is AG, would be written as
84 +
85 +{{footnote}}Since these references to SDMX objects include non-permitted characters as per the VTL ID notation, they need to be included between single quotes, according to the VTL rules for irregular names.{{/footnote}}:
86 +
83 83  > 'urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=AG:DFR(1.0.0)' <-
84 84  > 'urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=AG:DF1(1.0.0)' +
85 85  > 'urn:sdmx:org.sdmx.infomodel.datastructure.Dataflow=AG:DF2(1.0.0)'
... ... @@ -106,6 +106,8 @@
106 106  * As said, the container-object-id does not apply to the classes that can be referenced in VTL Transformations, therefore is not present in their URN
107 107  * The object-id does not exist for the artefacts belonging to the Dataflow, and Codelist classes, while it exists and cannot be omitted for the artefacts belonging to the classes Dimension, TimeDimension, Measure, DataAttribute and Concept, as for them the object-id is the main identifier of the artefact
108 108  
113 +
114 +
109 109  The simplified object identifier is obtained by omitting all the first part of the URN, including the special characters, till the first part not omitted.
110 110  
111 111  For example, the full formulation that uses the complete URN shown at the end of the previous paragraph:
... ... @@ -116,7 +116,7 @@
116 116  
117 117  by omitting all the non-essential parts would become simply:
118 118  
119 -> DFR  : =  DF1 + DF2
125 +> DFR : = DF1 + DF2
120 120  
121 121  The references to the Codelists can be simplified similarly. For example, given the non-abbreviated reference to the Codelist AG:CL_FREQ(1.0.0), which is{{footnote}}Single quotes are needed because this reference is not a VTL regular name. 19 Single quotes are not needed in this case because CL_FREQ is a VTL regular name.{{/footnote}}:
122 122  
... ... @@ -162,14 +162,16 @@
162 162  
163 163  === 12.2.5 References to SDMX artefacts from VTL Rulesets ===
164 164  
165 -The VTL Rulesets allow defining sets of reusable Rules that can be applied by some VTL operators, like the ones for validation and hierarchical roll-up. A "Rule" consists in a relationship between Values belonging to some Value Domains or taken by some Variables, for example: (i) when the Country is USA then the Currency is USD; (ii) the Benelux is composed by Belgium, Luxembourg, Netherlands.
171 +The VTL Rulesets allow defining sets of reusable Rules that can be applied by some VTL operators, like the ones for validation and hierarchical roll-up. A "Rule" consists in a relationship between Values belonging to some Value Domains or taken by some Variables, for example: when the Country is USA then the Currency is USD; (ii) the Benelux is composed by Belgium, Luxembourg, Netherlands.
166 166  
167 167  The VTL Rulesets have a signature, in which the Value Domains or the Variables on which the Ruleset is defined are declared, and a body, which contains the Rules.
168 168  
169 169  In the signature, given the mapping between VTL and SDMX better described in the following paragraphs, a reference to a VTL Value Domain becomes a reference to a SDMX Codelist, while a reference to a VTL Represented Variable becomes a reference to a SDMX Concept, assuming for it a definite representation{{footnote}}Rulesets of this kind cannot be reused when the referenced Concept has a different representation.{{/footnote}}.
170 170  
171 -In general, for referencing SDMX Codelists and Concepts, the conventions described in the previous paragraphs apply. In the Ruleset syntax, the elements that reference SDMX artefacts are called "valueDomain" and "variable" for the Datapoint Rulesets and "ruleValueDomain", "ruleVariable", "condValueDomain" "condVariable" for the Hierarchical Rulesets). The syntax of the Ruleset signature allows also to define aliases of the elements above, these aliases are valid only within the specific Ruleset definition statement and cannot be mapped to SDMX.{{footnote}}See also the section "VTL-DL Rulesets" in the VTL Reference Manual.{{/footnote}}
177 +In general, for referencing SDMX Codelists and Concepts, the conventions described in the previous paragraphs apply. In the Ruleset syntax, the elements that reference SDMX artefacts are called "valueDomain" and "variable" for the Datapoint Rulesets and "ruleValueDomain", "ruleVariable", "condValueDomain" "condVariable" for the Hierarchical Rulesets).
172 172  
179 +The syntax of the Ruleset signature allows also to define aliases of the elements above, these aliases are valid only within the specific Ruleset definition statement and cannot be mapped to SDMX.{{footnote}}See also the section "VTL-DL Rulesets" in the VTL Reference Manual.{{/footnote}}
180 +
173 173  In the body of the Rulesets, the Codes and in general all the Values can be written without any other specification, because the artefact, which the Values are referred (Codelist, Concept) to can be deduced from the Ruleset signature.
174 174  
175 175  == 12.3 Mapping between SDMX and VTL artefacts ==
... ... @@ -452,31 +452,26 @@
452 452  
453 453  > ‘DF2(1.0.0)/GDPPERCAPITA.USA’ <- expression11; ‘DF2(1.0.0)/GDPPERCAPITA.CANADA’ <- expression12;
454 454  > … … …
455 -> ‘DF2(1.0.0)/POPGROWTH.USA’ <- expression21;
463 +> ‘DF2(1.0.0)/POPGROWTH.USA’ <- expression21;
456 456  > ‘DF2(1.0.0)/POPGROWTH.CANADA’ <- expression22;
457 457  > … … …
458 458  
459 459  As said, it is assumed that these VTL derived Data Sets have the TIME_PERIOD as the only identifier. In the mapping from VTL to SMDX, the Dimensions INDICATOR and COUNTRY are added to the VTL data structure on order to obtain the SDMX one, with the following values respectively:
460 460  
461 -VTL dataset   INDICATOR value COUNTRY value
462 -
463 -> ‘DF2(1.0.0)/GDPPERCAPITA.USA’ GDPPERCAPITA USA
469 +> VTL dataset INDICATOR value COUNTRY value
470 +>
471 +> ‘DF2(1.0.0)/GDPPERCAPITA.USA’ GDPPERCAPITA USA
464 464  > ‘DF2(1.0.0)/GDPPERCAPITA.CANADA’ GDPPERCAPITA CANADA … … …
465 -> ‘DF2(1.0.0)/POPGROWTH.USA’  POPGROWTH USA
466 -> ‘DF2(1.0.0)/POPGROWTH.CANADA’ POPGROWTH CANADA
473 +>
474 +> ‘DF2(1.0.0)/POPGROWTH.USA’ POPGROWTH USA
475 +> ‘DF2(1.0.0)/POPGROWTH.CANADA’ POPGROWTH CANADA
467 467  > … … …
468 468  
469 469  It should be noted that the application of this many-to-one mapping from VTL to SDMX is equivalent to an appropriate sequence of VTL Transformations. These use the VTL operator “calc” to add the proper VTL identifiers (in the example, INDICATOR and COUNTRY) and to assign to them the proper values and the operator “union” in order to obtain the final VTL dataset (in the example DF2(1.0.0)), that can be mapped oneto-one to the homonymous SDMX Dataflow. Following the same example, these VTL Transformations would be:
470 470  
471 -> DF2bis_GDPPERCAPITA_USA := ‘DF2(1.0.0)/GDPPERCAPITA.USA’ [calc identifier INDICATOR := ”GDPPERCAPITA”, identifier COUNTRY := ”USA”];
472 -> DF2bis_GDPPERCAPITA_CANADA := ‘DF2(1.0.0)/GDPPERCAPITA.CANADA’ [calc identifier INDICATOR:=”GDPPERCAPITA”, identifier COUNTRY:=”CANADA”]; … … …
473 -> DF2bis_POPGROWTH_USA := ‘DF2(1.0.0)/POPGROWTH.USA’  [calc identifier INDICATOR := ”POPGROWTH”, identifier COUNTRY := ”USA”];
474 -> DF2bis_POPGROWTH_CANADA’ := ‘DF2(1.0.0)/POPGROWTH.CANADA’ [calc identifier INDICATOR := ”POPGROWTH”, identifier COUNTRY := ”CANADA”]; … … …
475 -> DF2(1.0) <- UNION  (DF2bis_GDPPERCAPITA_USA’,
476 -> DF2bis_GDPPERCAPITA_CANADA’,
480 +> DF2bis_GDPPERCAPITA_USA := ‘DF2(1.0.0)/GDPPERCAPITA.USA’ [calc identifier INDICATOR := ”GDPPERCAPITA”, identifier COUNTRY := ”USA”]; DF2bis_GDPPERCAPITA_CANADA := ‘DF2(1.0.0)/GDPPERCAPITA.CANADA’ [calc identifier INDICATOR:=”GDPPERCAPITA”, identifier COUNTRY:=”CANADA”];… … … DF2bis_POPGROWTH_USA := ‘DF2(1.0.0)/POPGROWTH.USA’ [calc identifier INDICATOR := ”POPGROWTH”, identifier COUNTRY := ”USA”]; DF2bis_POPGROWTH_CANADA’ := ‘DF2(1.0.0)/POPGROWTH.CANADA’ [calc identifier INDICATOR := ”POPGROWTH”, identifier COUNTRY := ”CANADA”];… … … DF2(1.0) <- UNION (DF2bis_GDPPERCAPITA_USA’, DF2bis_GDPPERCAPITA_CANADA’,
477 477  > … ,
478 -> DF2bis_POPGROWTH_USA’,
479 -> DF2bis_POPGROWTH_CANADA’
482 +> DF2bis_POPGROWTH_USA’, DF2bis_POPGROWTH_CANADA’
480 480  > …);
481 481  
482 482  In other words, starting from the datasets explicitly calculated through VTL (in the example ‘DF2(1.0)/GDPPERCAPITA.USA’ and so on), the first step consists in calculating other (non-persistent) VTL datasets (in the example DF2bis_GDPPERCAPITA_USA and so on) by adding the identifiers INDICATOR and COUNTRY with the desired values (//INDICATORvalue// and //COUNTRYvalue)//. Finally, all these non-persistent Data Sets are united and give the final result DF2(1.0){{footnote}}The result is persistent in this example but it can be also non persistent if needed.{{/footnote}}, which can be mapped one-to-one to the homonymous SDMX Dataflow having the dimension components TIME_PERIOD, INDICATOR and COUNTRY.
... ... @@ -534,7 +534,6 @@
534 534  
535 535  The VTL data types are sub-divided in scalar types (like integers, strings, etc.), which are the types of the scalar values, and compound types (like Data Sets, Components, Rulesets, etc.), which are the types of the compound structures. See below the diagram of the VTL data types, taken from the VTL User Manual:
536 536  
537 -
538 538  [[image:1750070288958-132.png]]
539 539  
540 540  **Figure 22 – VTL Data Types**
... ... @@ -570,7 +570,8 @@
570 570  The following table describes the default mapping for converting from the SDMX data types to the VTL basic scalar types.
571 571  
572 572  (% style="width:583.294px" %)
573 -|(% style="width:360px" %)SDMX data type (BasicComponentDataType)|(% style="width:221px" %)Default VTL basic scalar type
575 +|(% style="width:360px" %)SDMX data type
576 +(BasicComponentDataType)|(% style="width:221px" %)Default VTL basic scalar type
574 574  |(% style="width:360px" %)(((
575 575  String
576 576  (string allowing any character)
... ... @@ -605,7 +605,8 @@
605 605  Short
606 606  (corresponds to XML Schema xs:short datatype; between -32768 and -32767 (inclusive))
607 607  )))|(% style="width:221px" %)integer
608 -|(% style="width:360px" %)Decimal (corresponds to XML Schema xs:decimal datatype; subset of real numbers that can be represented as decimals)|(% style="width:221px" %)number
611 +|(% style="width:360px" %)Decimal
612 +(corresponds to XML Schema xs:decimal datatype; subset of real numbers that can be represented as decimals)|(% style="width:221px" %)number
609 609  |(% style="width:360px" %)(((
610 610  Float
611 611  (corresponds to XML Schema xs:float datatype; patterned after the IEEE single-precision 32-bit floating point type)
... ... @@ -655,7 +655,7 @@
655 655  GregorianTimePeriod
656 656  (superset of GregorianYear, GregorianYearMonth, and GregorianDay)
657 657  )))|(% style="width:221px" %)date
658 -|(% style="width:360px" %)GregorianYear (YYYY)|(% style="width:221px" %)date
662 +|(% style="width:360px" %)GregorianYear (YYYY)|(% style="width:221px" %)date
659 659  |(% style="width:360px" %)GregorianYearMonth / GregorianMonth (YYYY-MM)|(% style="width:221px" %)date
660 660  |(% style="width:360px" %)GregorianDay (YYYY-MM-DD)|(% style="width:221px" %)date
661 661  |(% style="width:360px" %)(((
... ... @@ -694,19 +694,19 @@
694 694  )))|(% style="width:221px" %)date
695 695  |(% style="width:360px" %)(((
696 696  TimeRange
697 -(YYYY-MM-DD(Thh:mm:ss)?/<duration>)
701 +(YYYY-MM-DD(Thh:mm:ss)?/)
698 698  )))|(% style="width:221px" %)time
699 699  |(% style="width:360px" %)(((
700 700  Month
701 -(~-~-MM; speicifies a month independent of a year; e.g. February is black history month in the United States)
705 +(MM; speicifies a month independent of a year; e.g. February is black history month in the United States)
702 702  )))|(% style="width:221px" %)string
703 703  |(% style="width:360px" %)(((
704 704  MonthDay
705 -(~-~-MM-DD; specifies a day within a month independent of a year; e.g. Christmas is December 25^^th^^; used to specify reporting year start day)
709 +(MM-DD; specifies a day within a month independent of a year; e.g. Christmas is December 25^^th^^; used to specify reporting year start day)
706 706  )))|(% style="width:221px" %)string
707 707  |(% style="width:360px" %)(((
708 708  Day
709 -(~-~--DD; specifies a day independent of a month or year; e.g. the 15^^th^^ is payday)
713 +(-DD; specifies a day independent of a month or year; e.g. the 15^^th^^ is payday)
710 710  )))|(% style="width:221px" %)string
711 711  |(% style="width:360px" %)(((
712 712  Time
1750067055028-964.png
Author
... ... @@ -1,1 +1,0 @@
1 -xwiki:XWiki.helena
Size
... ... @@ -1,1 +1,0 @@
1 -5.5 KB
Content
SUZ.Methodology.Code.MethodologyClass[0]
SKMS.Methodology.Code.MethodologyClass[0]
Index
... ... @@ -1,0 +1,1 @@
1 +12
© Semantic R&D Group, 2026