Wiki source code of 10 RepresentationMap
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{box title="**Contents**"}} | ||
| 2 | {{toc/}} | ||
| 3 | {{/box}} | ||
| 4 | |||
| 5 | == 10.1 Scope == | ||
| 6 | |||
| 7 | A RepresentationMap describes a mapping between source [[value>>doc:IMElements.value.WebHome]](s) and target [[value>>doc:IMElements.value.WebHome]](s) where the values are restricted to those in a [[Codelist>>doc:sdmx:Glossary 2\.1.Code list.WebHome]], [[ValueList>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.VersionableArtefact.MaintainableArtefact.EnumeratedList.ValueList.WebHome]] or be of a certain data [[type>>doc:IMElements.type.WebHome]], e.g., Integer. | ||
| 8 | |||
| 9 | The RepresentationMap maps information from one or more sources, where the values for each source are used in combination to derive the output [[value>>doc:IMElements.value.WebHome]] for one or more targets. Each source [[value>>doc:IMElements.value.WebHome]] may match a substring of the original data (using startIndex and/or endIndex) or define a pattern matching rule described by a regular expression. The target [[value>>doc:IMElements.value.WebHome]] is provided as an absolute string, although it can make use of regular expression groups to carry across values from the source string to the target string without having to explicitly state the [[value>>doc:IMElements.value.WebHome]] to carry. An example is a regular expression which states ‘match a [[value>>doc:IMElements.value.WebHome]] starting with AB followed by anything, where the anything is marked a capture group’, the target can state ‘take the anything [[value>>doc:IMElements.value.WebHome]] and postfix it with AB’ thus enabling the mapping of ABX to XAB and ABY to YAB. | ||
| 10 | |||
| 11 | The absence of an output for an input is interpreted as ‘no output [[value>>doc:IMElements.value.WebHome]] for the given source [[value>>doc:IMElements.value.WebHome]](s)’. | ||
| 12 | |||
| 13 | === 10.1.1 Class Diagram – Relationship === | ||
| 14 | |||
| 15 | [[image:image65.png]] | ||
| 16 | |||
| 17 | **Figure 39: Representation Map** | ||
| 18 | |||
| 19 | === 10.1.2 Explanation of the Diagram === | ||
| 20 | |||
| 21 | ==== 10.1.2.1 Narrative ==== | ||
| 22 | |||
| 23 | The RepresentationMap is a //[[MaintainableArtefact>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.VersionableArtefact.MaintainableArtefact.WebHome]]//. It maps one or more source values to one or more target values, where values that are being mapped are defined by the //ValueRepresentation//. A //ValueRepresentation// is an abstract container which is either a [[Codelist>>doc:sdmx:Glossary 2\.1.Code list.WebHome]], [[ValueList>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.VersionableArtefact.MaintainableArtefact.EnumeratedList.ValueList.WebHome]] or a FacetValueType. Source and target values are in a list where the list order is important as the RepresentationMapping sourceValues and targetValues must match the order. It is permissible to mix types for both source and target values, allowing for example a [[Codelist>>doc:sdmx:Glossary 2\.1.Code list.WebHome]] to map to an Integer (which is a FacetValueType). The list of source or targets can also be mixed, for example a [[Codelist>>doc:sdmx:Glossary 2\.1.Code list.WebHome]] in conjunction with a FacetValueType and [[ValueList>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.VersionableArtefact.MaintainableArtefact.EnumeratedList.ValueList.WebHome]] and can be defined as the source of a mapping, thus 1917 allowing rules such as ‘When CL_AREA=UK AND AGE=26 CURRENCY=$’. | ||
| 24 | |||
| 25 | ==== 10.1.2.2 Definitions ==== | ||
| 26 | |||
| 27 | (% style="width:974.835px" %) | ||
| 28 | |**Class**|**Feature**|(% style="width:576px" %)**Description** | ||
| 29 | |RepresentationMap|((( | ||
| 30 | Inherits from | ||
| 31 | //[[MaintainableArtefact>>doc:IMElements.AnnotableArtefact.IdentifiableArtefact.NameableArtefact.VersionableArtefact.MaintainableArtefact.WebHome]]// | ||
| 32 | )))|(% style="width:576px" %)Links source and target representations, whose values may conform to a linked [[Codelist>>doc:sdmx:Glossary 2\.1.Code list.WebHome]], ValueList or enumerated type such as Integer. | ||
| 33 | | |source|(% style="width:576px" %)Association to one or more [[Codelist>>doc:sdmx:Glossary 2\.1.Code list.WebHome]], ValueList, or FacetValue – mixed types are permissible | ||
| 34 | | |target|(% style="width:576px" %)Association to one or more [[Codelist>>doc:sdmx:Glossary 2\.1.Code list.WebHome]], ValueList, or FacetValue – mixed types are permissible | ||
| 35 | |RepresentationMapping|((( | ||
| 36 | Inherits from | ||
| 37 | //[[AnnotableArtefact>>doc:IMElements.AnnotableArtefact.WebHome]]// | ||
| 38 | )))|(% style="width:576px" %)Describes how the source value(s) map to the target value(s) | ||
| 39 | | |[[validFrom>>doc:IMElements.validFrom.WebHome]]|(% style="width:576px" %)Optional period describing when the mapping is applicable | ||
| 40 | | |[[validTo>>doc:IMElements.validTo.WebHome]]|(% style="width:576px" %)Optional period describing which the mapping is no longer applicable. | ||
| 41 | | |sourceValues|(% style="width:576px" %)Input value for source in the RepresentationMap | ||
| 42 | | |targetValues|(% style="width:576px" %)Output value for each mapped target in the RepresentationMap | ||
| 43 | |MappedValue| |(% style="width:576px" %)Describes an input value that is part of the sourceValues in a RepresentationMapping | ||
| 44 | | |[[value>>doc:IMElements.value.WebHome]]|(% style="width:576px" %)The value to compare the source data with | ||
| 45 | | |isRegEx|(% style="width:576px" %)If true, the value field should be treated as a regular expression when comparing with the source data | ||
| 46 | | |startIndex|(% style="width:576px" %)If provided, a substring of the source data should be taken, starting from this index (starting at zero) before comparing with the //value// field for matching | ||
| 47 | | |endIndex|(% style="width:576px" %)If provided, a substring of the source data should be taken, ending at this index (starting at zero) before comparing with the //value// field for matching | ||
| 48 | |TargetValue| |(% style="width:576px" %)Describes the target value that is part of the targetValues of a RepresentationMapping | ||
| 49 | | |[[value>>doc:IMElements.value.WebHome]]|(% style="width:576px" %)Represents a value for the targetValues of a RepresenationMapping |