Wiki source code of 9 Structure Map

Version 8.3 by Helena on 2025/05/19 13:55

Show last authors
1 {{box title="**Contents**"}}
2 {{toc/}}
3 {{/box}}
4
5 == 9.1 Scope ==
6
7 A StructureMap allows mapping between Data Structures or [[Dataflows>>doc:xwiki:Glossary.Dataflow.WebHome]]. It ultimately (% style="color:#2ecc71" %)maps(%%) one DataStructureDefinition to another (source to target) although it can do this via the [[Dataflow>>doc:xwiki:Glossary.Dataflow.WebHome]] or directly against the DataStructureDefinition.
8
9 The StructureMap defines how the //structure// of a source DataStructureDefinition relates to the //structure// of the target DataStructureDefinition. The term //structure //in this instance refers to the [[Dimensions>>doc:xwiki:Glossary.Dimension.WebHome]] and [[Attributes>>doc:xwiki:Glossary.Attribute.WebHome]] (collectively called [[Components>>doc:xwiki:Glossary.Component.WebHome]]). An example relationship is source REF_AREA [[Dimension>>doc:xwiki:Glossary.Dimension.WebHome]] (% style="color:#2ecc71" %)maps(%%) to target COUNTRY [[Dimension>>doc:xwiki:Glossary.Dimension.WebHome]]. When converting data, systems should interpret this, as ‘data reported against REF_AREA in the source [[dataset>>doc:xwiki:Glossary.Data set.WebHome]], should be converted to data against COUNTRY in the target [[dataset>>doc:xwiki:Glossary.Data set.WebHome]]’. StructureMaps can make use of the RepresentationMap to describe how the reported value (% style="color:#2ecc71" %)map(%%), if there is a mapping to be done on the value, for example source REF_AREA.US may (% style="color:#2ecc71" %)map(%%) to COUNTRY.USA. In the case of mapping Dates, the EpochMap or DatePatternMap is used and maintained in the StructureMap that uses it.
10
11 === 9.1.1 Class Diagram – Relationship ===
12
13 [[image:SDMX 3-0-0 SECTION 2 FINAL-1.0 (1)_en_7ada20ba.jpg||height="274" width="617"]]
14
15 **Figure 37: Relationship Class diagram of the Structure Map**
16
17 === 9.1.2 Explanation of the Diagram ===
18
19 ==== 9.1.2.1 Narrative ====
20
21 The StructureMap is a //MaintainableArtefact//. The StructureMap can either (% style="color:#2ecc71" %)map(%%) a source and target DataStructureDefinition or a source and target [[Dataflow>>doc:xwiki:Glossary.Dataflow.WebHome]], it cannot mix source and target types. The StructureMap contains zero or more ComponentMaps.
22
23 Each ComponentMap (% style="color:#2ecc71" %)maps(%%) one or more //Component//s from the source DataStructureDefinition to one or more //Component//s in the target DataStructureDefinition{{footnote}}Source and target Data Structure Definition are either directly linked from the StructureMap or indirectly via the linked source and target Dataflow{{/footnote}}. In addition, the StructureMap contains zero or more FixedValueMaps. In this case, one or more //Component//s, from the source or target DataStructureDefinition, (% style="color:#2ecc71" %)map(%%) to a fixed value.
24
25 The rules pertaining to how reported values (% style="color:#2ecc71" %)map(%%), are maintained in either a RepresentationMap, EpochMap, or DatePatternMap. A ComponentMap can only reference one of these mapping types to define how the reported values relate from source [[Dataset>>doc:xwiki:Glossary.Data set.WebHome]] to the target [[Dataset>>doc:xwiki:Glossary.Data set.WebHome]]. If a ComponentMap has more than 1 source or target, a RepresentationMap must be used to describe how the values (% style="color:#2ecc71" %)map(%%), as it is the only (% style="color:#2ecc71" %)map(%%) which can define multiple source and target values in combination.
26
27 If the ComponentMap does not reference any (% style="color:#2ecc71" %)map(%%) type to describe how the values (% style="color:#2ecc71" %)map(%%) in a [[Dataset>>doc:xwiki:Glossary.Data set.WebHome]], then the values from the source [[Dataset>>doc:xwiki:Glossary.Data set.WebHome]] are copied to the target [[Dataset>>doc:xwiki:Glossary.Data set.WebHome]] verbatim, with no mapping rules being applied.
28
29 A RepresentationMap is a separate Maintainable structure. EpochMap and DatePatternMap are maintained in the same StructureMap and are referenced locally from the ComponentMap. EpochMap and DatePatternMap are maintained outside of the ComponentMap and can therefore be reused by multiple ComponentMaps.
30
31 === 9.1.3 Class Diagram – Epoch Mapping and Date Pattern Mapping ===
32
33 [[image:SDMX 3-0-0 SECTION 2 FINAL-1.0 (1)_en_b4db7365.jpg||height="376" width="609"]]
34
35 **Figure 38: Relationship Class diagram of the EpochMap and DatePatternMap**
36
37 === 9.1.4 Explanation of the Diagram ===
38
39 ==== 9.1.4.1 Narrative ====
40
41 The EpochMap and DatePatternMap are both //IdentifiableArtefact//. An EpochMap and DatePatternMap both provide the ability to (% style="color:#2ecc71" %)map(%%) source to target date formats. The EpochMap describes the source date as the number of epochs since a point in time, where the duration of each epoch is defined, e.g., number of milliseconds since 1970. The DatePatternMap describes the source date as a pattern for example MM-YYYY, accompanied by the appropriate locale.
42
43 Both mappings describe the target date as a frequency Identifier. The frequency identifier is given either a fixed value, e.g., ‘A’ or a reference to a [[Dimension>>doc:xwiki:Glossary.Dimension.WebHome]] or [[Attribute>>doc:xwiki:Glossary.Attribute.WebHome]] in the target DataStructureDefinition of the StructureMap, e.g. ‘FREQ’. In the latter case, the frequency id is derived at run time when the output series and observations are generated. Dates (% style="color:#2ecc71" %)mapped(%%) using the frequency lookup can therefore be (% style="color:#2ecc71" %)mapped(%%) using different frequencies depending on the series or observation being converted.
44
45 If the Frequency Identifier aligns with standard [[SDMX>>doc:xwiki:Glossary.Statistical data and metadata exchange.WebHome]] frequencies the output date format can be derived using standard [[SDMX>>doc:xwiki:Glossary.Statistical data and metadata exchange.WebHome]] date formatting (e.g., A=YYYY, Q=YYYY-Qn). If the [[SDMX>>doc:xwiki:Glossary.Statistical data and metadata exchange.WebHome]] standard formatting is not desired or if the frequency Id is not a standard [[SDMX>>doc:xwiki:Glossary.Statistical data and metadata exchange.WebHome]] frequency [[Code>>doc:xwiki:Glossary.Code.WebHome]], the FrequencyFormatMapping can be used to describe the relationship between the frequency Id and the output date format, e.g., A01=YYYY.
46
47 ==== 9.1.4.2 Definitions ====
48
49 (% style="width:869.294px" %)
50 |(% style="width:196px" %)**Class**|(% style="width:233px" %)**Feature**|(% style="width:436px" %)**Description**
51 |(% style="width:196px" %)StructureMap|(% style="width:233px" %)(((
52 Inherits from
53 //MaintainableArtefact//
54 )))|(% style="width:436px" %)Links a source and target structure where there is a semantic equivalence between the source and the target structures.
55 |(% style="width:196px" %) |(% style="width:233px" %)+sourceStructure|(% style="width:436px" %)Association to the source Data Structure.
56 |(% style="width:196px" %) |(% style="width:233px" %)+targetStructure|(% style="width:436px" %)Association to the target Data Structure
57 |(% style="width:196px" %) |(% style="width:233px" %)+sourceStructureUsage|(% style="width:436px" %)Association to the source Dataflow.
58 |(% style="width:196px" %) |(% style="width:233px" %)+targetStructureUsage|(% style="width:436px" %)Association to the target Dataflow.
59 |(% style="width:196px" %)ComponentMap|(% style="width:233px" %)(((
60 Inherits from
61 //AnnotableArtefact//
62 )))|(% style="width:436px" %)Links source and target [[Component>>doc:xwiki:Glossary.Component.WebHome]](s) where there is a semantic equivalence between the source and the target Components.
63 |(% style="width:196px" %) |(% style="width:233px" %)+source|(% style="width:436px" %)Association to zero or more source Components.
64 |(% style="width:196px" %) |(% style="width:233px" %)+target|(% style="width:436px" %)Association to zero or more the target Components.
65 |(% style="width:196px" %) |(% style="width:233px" %)mappingRules|(% style="width:436px" %)Reference to either a RepresentationMap, an EpochMap or a DatePatternMap.
66 |(% style="width:196px" %)FixedValueMap|(% style="width:233px" %)(((
67 Inherits from
68 //AnnotableArtefact//
69 )))|(% style="width:436px" %)Links a [[Component>>doc:xwiki:Glossary.Component.WebHome]] (source or target) to a fixed value.
70 |(% style="width:196px" %) |(% style="width:233px" %)value|(% style="width:436px" %)The value that a [[Component>>doc:xwiki:Glossary.Component.WebHome]] will be fixed in a fixed [[component>>doc:xwiki:Glossary.Component.WebHome]] (% style="color:#2ecc71" %)map(%%).
71 |(% style="width:196px" %)//DateMap//|(% style="width:233px" %)(((
72 Inherits from
73 //IdentifiableArtefact//
74 )))|(% style="width:436px" %)
75 |(% style="width:196px" %) |(% style="width:233px" %)freqDimension|(% style="width:436px" %)The [[Dimension>>doc:xwiki:Glossary.Dimension.WebHome]] or [[Attribute>>doc:xwiki:Glossary.Attribute.WebHome]] of the target [[Data Structure Definition>>doc:xwiki:Glossary.Data structure definition.WebHome]] which will hold the frequency information for date conversion. Mutually exclusive with targetFrequencyId.
76 |(% style="width:196px" %) |(% style="width:233px" %)yearStart|(% style="width:436px" %)The date of the start of the year, enabling mapping from high frequency to lower frequency formats.
77 |(% style="width:196px" %) |(% style="width:233px" %)resolvePeriod|(% style="width:436px" %)Which point in time to resolve to when mapping from low frequency to high frequency periods.
78 |(% style="width:196px" %) |(% style="width:233px" %)mappedFrequencies|(% style="width:436px" %)A reference to a (% style="color:#2ecc71" %)map(%%) of frequency id to date pattern for output.
79 |(% style="width:196px" %)EpochMap|(% style="width:233px" %)(((
80 Inherits from
81 //DateMap//
82 )))|(% style="width:436px" %)
83 |(% style="width:196px" %) |(% style="width:233px" %)basePeriod|(% style="width:436px" %)Epoch zero starts on this period.
84 |(% style="width:196px" %) |(% style="width:233px" %)targetFrequencyId|(% style="width:436px" %)The frequency to convert the input date into. Mutually exclusive with freqDimension.
85 |(% style="width:196px" %) |(% style="width:233px" %)epochPeriod|(% style="width:436px" %)Describes the period of time that each epoch represents.
86 |(% style="width:196px" %)DatePatternMap|(% style="width:233px" %)Inherits from //DateMap//|(% style="width:436px" %)Described a source date based on a string pattern, and how it (% style="color:#2ecc71" %)maps(%%) to the target date.
87 |(% style="width:196px" %) |(% style="width:233px" %)locale|(% style="width:436px" %)The locale on which the input will be parsed according to the pattern.
88 |(% style="width:196px" %)DateMapping|(% style="width:233px" %) |(% style="width:436px" %)
89 |(% style="width:196px" %) |(% style="width:233px" %)sourcePattern|(% style="width:436px" %)Describes the source date using conventions for describing years, months, days, etc.
90 |(% style="width:196px" %) |(% style="width:233px" %)targetFrequencyId|(% style="width:436px" %)The frequency to convert the input date into. Mutually exclusive with freqDimension.
91 |(% style="width:196px" %)FrequencyFormatMap ping|(% style="width:233px" %)(((
92 Inherits from
93 //IdentifiableArtefact//
94 )))|(% style="width:436px" %)Describes the relationship between a frequency Id to the what the output date is formatted
95 |(% style="width:196px" %) |(% style="width:233px" %)frequencyId|(% style="width:436px" %)The string used to describe the frequency
96 |(% style="width:196px" %) |(% style="width:233px" %)datePattern|(% style="width:436px" %)The output date pattern for that frequency
97
98 ----
99
100 {{putFootnotes/}}