Wiki source code of 4 General Notes for Implementers
Show last authors
| author | version | line-number | content |
|---|---|---|---|
| 1 | {{box title="**Contents**"}} | ||
| 2 | {{toc/}} | ||
| 3 | {{/box}} | ||
| 4 | |||
| 5 | This section discusses a number of topics other than the exchange of [[data sets>>doc:sdmx:Glossary.Data set.WebHome]] in [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]] and [[SDMX-EDI>>doc:sdmx:Glossary.SDMX-EDI.WebHome]]. Supported only in [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]], these topics include the use of the [[reference metadata>>doc:sdmx:Glossary.Reference metadata.WebHome]] mechanism in [[SDMX>>doc:sdmx:Glossary.Statistical data and metadata exchange.WebHome]], the use of [[Structure Sets>>doc:sdmx:Glossary.Structure set.WebHome]] and [[Reporting Taxonomies>>doc:sdmx:Glossary.Reporting taxonomy.WebHome]], the use of Processes, a discussion of time and data-typing, and some of the conventional mechanisms within the [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]] Structure message regarding versioning and external referencing. | ||
| 6 | |||
| 7 | This section does not go into great detail on these topics, but provides a useful overview of these features to assist implementors in further use of the parts of the specification which are relevant to them. | ||
| 8 | |||
| 9 | == 4.1 Representations == | ||
| 10 | |||
| 11 | There are several different [[representations>>doc:sdmx:Glossary.Representation.WebHome]] in [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]], taken from XML Schemas and common programming languages. The table below describes the various [[representations>>doc:sdmx:Glossary.Representation.WebHome]] which are found in [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]], and their equivalents. | ||
| 12 | |||
| 13 | (% style="width:912.294px" %) | ||
| 14 | |(% style="width:172px" %)**SDMX-ML Data Type**|(% style="width:204px" %)**XML Schema Data Type**|(% style="width:189px" %)**.NET Framework Type**|(% style="width:342px" %)((( | ||
| 15 | **Java Data Type ** | ||
| 16 | ))) | ||
| 17 | |(% style="width:172px" %)String|(% style="width:204px" %)xsd:string|(% style="width:189px" %)System.String|(% style="width:342px" %)java.lang.String | ||
| 18 | |(% style="width:172px" %)Big Integer|(% style="width:204px" %)xsd:integer|(% style="width:189px" %)System.Decimal|(% style="width:342px" %)java.math.BigInteg er | ||
| 19 | |(% style="width:172px" %)Integer|(% style="width:204px" %)xsd:int|(% style="width:189px" %)System.Int32|(% style="width:342px" %)int | ||
| 20 | |(% style="width:172px" %)Long|(% style="width:204px" %)xsd.long|(% style="width:189px" %)System.Int64|(% style="width:342px" %)long | ||
| 21 | |(% style="width:172px" %)Short|(% style="width:204px" %)xsd:short|(% style="width:189px" %)System.Int16|(% style="width:342px" %)short | ||
| 22 | |(% style="width:172px" %)Decimal|(% style="width:204px" %)xsd:decimal|(% style="width:189px" %)System.Decimal|(% style="width:342px" %)java.math.BigDecim al | ||
| 23 | |(% style="width:172px" %)Float|(% style="width:204px" %)xsd:float|(% style="width:189px" %)System.Single|(% style="width:342px" %)float | ||
| 24 | |(% style="width:172px" %)Double|(% style="width:204px" %)xsd:double|(% style="width:189px" %)System.Double|(% style="width:342px" %)double | ||
| 25 | |(% style="width:172px" %)Boolean|(% style="width:204px" %)xsd:boolean|(% style="width:189px" %)System.Boolean|(% style="width:342px" %)boolean | ||
| 26 | |(% style="width:172px" %)URI|(% style="width:204px" %)xsd:anyURI|(% style="width:189px" %)System.Uri|(% style="width:342px" %)Java.net.URI or java.lang.String | ||
| 27 | |(% style="width:172px" %)DateTime|(% style="width:204px" %)xsd:dateTime|(% style="width:189px" %)System.DateTime|(% style="width:342px" %)javax.xml.datatype .XMLGregorianCalen dar | ||
| 28 | |(% style="width:172px" %)Time|(% style="width:204px" %)xsd:time|(% style="width:189px" %)System.DateTime|(% style="width:342px" %)javax.xml.datatype .XMLGregorianCalen dar | ||
| 29 | |(% style="width:172px" %)GregorianYear|(% style="width:204px" %)xsd:gYear|(% style="width:189px" %)System.DateTime|(% style="width:342px" %)javax.xml.datatype .XMLGregorianCalen dar | ||
| 30 | |(% style="width:172px" %)GregorianMonth|(% style="width:204px" %)xsd:gYearMonth|(% style="width:189px" %)System.DateTime|(% style="width:342px" %)javax.xml.datatype .XMLGregorianCalen dar | ||
| 31 | |(% style="width:172px" %)GregorianDay|(% style="width:204px" %)xsd:date|(% style="width:189px" %)System.DateTime|(% style="width:342px" %)javax.xml.datatype .XMLGregorianCalen dar | ||
| 32 | |(% style="width:172px" %)((( | ||
| 33 | Day, MonthDay, Month | ||
| 34 | )))|(% style="width:204px" %)xsd:g*|(% style="width:189px" %)System.DateTime|(% style="width:342px" %)javax.xml.datatype .XMLGregorianCalen dar | ||
| 35 | |(% style="width:172px" %)Duration|(% style="width:204px" %)xsd:duration |(% style="width:189px" %)System.TimeSpa|(% style="width:342px" %)javax.xml.datatype | ||
| 36 | |(% style="width:172px" %) |(% style="width:204px" %) |(% style="width:189px" %)n|(% style="width:342px" %).Duration | ||
| 37 | |||
| 38 | There are also a number of [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]] data types which do not have these direct correspondences, often because they are composite [[representations>>doc:sdmx:Glossary.Representation.WebHome]] or restrictions of a broader data type. For most of these, there are simple types which can be referenced from the [[SDMX>>doc:sdmx:Glossary.Statistical data and metadata exchange.WebHome]] schemas, for others a derived simple type will be necessary: | ||
| 39 | |||
| 40 | * AlphaNumeric (common:AlphaNumericType, string which only allows A-z and 0-9) | ||
| 41 | * Alpha (common:AlphaType, string which only allows A-z) | ||
| 42 | * Numeric (common:NumericType, string which only allows 0-9, but is not numeric so that is can having leading zeros) | ||
| 43 | * Count (xs:integer, a sequence with an interval of “1”) | ||
| 44 | * InclusiveValueRange (xs:decimal with the minValue and maxValue [[facets>>doc:sdmx:Glossary.Facet.WebHome]] supplying the bounds) | ||
| 45 | * ExclusiveValueRange (xs:decimal with the minValue and maxValue [[facets>>doc:sdmx:Glossary.Facet.WebHome]] supplying the bounds) | ||
| 46 | * Incremental (xs:decimal with a specified interval; the interval is typically enforced outside of the XML validation) | ||
| 47 | * TimeRange (common:TimeRangeType, start DateTime + Duration,) | ||
| 48 | * ObservationalTimePeriod (common: ObservationalTimePeriodType, a union of StandardTimePeriod and TimeRange). | ||
| 49 | * StandardTimePeriod (common: StandardTimePeriodType, a union of BasicTimePeriod and TimeRange). | ||
| 50 | * BasicTimePeriod (common: BasicTimePeriodType, a union of GregorianTimePeriod and DateTime) | ||
| 51 | * GregorianTimePeriod (common:GregorianTimePeriodType, a union of GregorianYear, GregorianMonth, and GregorianDay) | ||
| 52 | * ReportingTimePeriod (common:ReportingTimePeriodType, a union of ReportingYear, ReportingSemester, ReportingTrimester, ReportingQuarter, ReportingMonth, ReportingWeek, and ReportingDay). ReportingYear (common:ReportingYearType) | ||
| 53 | * ReportingSemester (common:ReportingSemesterType) | ||
| 54 | * ReportingTrimester (common:ReportingTrimesterType) | ||
| 55 | * ReportingQuarter (common:ReportingQuarterType) | ||
| 56 | * ReportingMonth (common:ReportingMonthType) | ||
| 57 | * ReportingWeek (common:ReportingWeekType) | ||
| 58 | * ReportingDay (common:ReportingDayType) | ||
| 59 | * XHTML (common:StructuredText, allows for multi-lingual text content that has XHTML markup) | ||
| 60 | * KeyValues (common:DataKeyType) | ||
| 61 | * IdentifiableReference (types for each identifiable object) | ||
| 62 | * DataSetReference (common:DataSetReferenceType) | ||
| 63 | * AttachmentConstraintReference (common:AttachmentConstraintReferenceType) | ||
| 64 | |||
| 65 | Data types also have a set of [[facets>>doc:sdmx:Glossary.Facet.WebHome]]: | ||
| 66 | |||
| 67 | * isSequence = true | false (indicates a sequentially increasing value) | ||
| 68 | * minLength = positive integer (# of characters/digits) | ||
| 69 | * maxLength = positive integer (# of characters/digits) | ||
| 70 | * startValue = [[decimal>>doc:sdmx:Glossary.Decimals.WebHome]] (for numeric sequence) | ||
| 71 | * endValue = [[decimal>>doc:sdmx:Glossary.Decimals.WebHome]] (for numeric sequence) | ||
| 72 | * interval = [[decimal>>doc:sdmx:Glossary.Decimals.WebHome]] (for numeric sequence) | ||
| 73 | * timeInterval = duration | ||
| 74 | * startTime = BasicTimePeriod (for time range) | ||
| 75 | * endTime = BasicTimePeriod (for time range) | ||
| 76 | * minValue = [[decimal>>doc:sdmx:Glossary.Decimals.WebHome]] (for numeric range) | ||
| 77 | * maxValue = [[decimal>>doc:sdmx:Glossary.Decimals.WebHome]] (for numeric range) | ||
| 78 | * [[decimal>>doc:sdmx:Glossary.Decimals.WebHome]] = Integer (# of digits to right of [[decimal>>doc:sdmx:Glossary.Decimals.WebHome]] point) | ||
| 79 | * pattern = (a regular expression, as per W3C XML Schema) | ||
| 80 | * isMultiLingual = boolean (for specifying text can occur in more than one language) | ||
| 81 | |||
| 82 | Note that [[code lists>>doc:sdmx:Glossary.Code list.WebHome]] may also have textual [[representations>>doc:sdmx:Glossary.Representation.WebHome]] assigned to them, in addition to their enumeration of codes.s | ||
| 83 | |||
| 84 | == 4.2 Time and Time Format == | ||
| 85 | |||
| 86 | === 4.2.1 Introduction === | ||
| 87 | |||
| 88 | First, it is important to recognize that most observation times are a period. SDMX specifies precisely how Time is handled. | ||
| 89 | |||
| 90 | The representation of time is broken into a hierarchical collection of representations. A data structure definition can use of any of the representations in the hierarchy as the representation of time. This allows for the time dimension of a particular data structure definition allow for only a subset of the default representation. | ||
| 91 | |||
| 92 | The hierarchy of time formats is as follows (**bold** indicates a category which is made up of multiple formats, //italic// indicates a distinct format): | ||
| 93 | |||
| 94 | * **Observational Time Period** | ||
| 95 | ** **Standard Time Period** | ||
| 96 | *** **Basic Time Period** | ||
| 97 | **** **Gregorian Time Period** | ||
| 98 | **** //Date Time// | ||
| 99 | *** **Reporting Time Period** | ||
| 100 | ** //Time Range// | ||
| 101 | |||
| 102 | The details of these time period categories and of the distinct formats which make them up are detailed in the sections to follow. | ||
| 103 | |||
| 104 | === 4.2.2 Observational Time Period === | ||
| 105 | |||
| 106 | This is the superset of all time [[representations>>doc:sdmx:Glossary.Representation.WebHome]] in [[SDMX>>doc:sdmx:Glossary.Statistical data and metadata exchange.WebHome]]. This allows for time to be expressed as any of the allowable formats. | ||
| 107 | |||
| 108 | === 4.2.3 Standard Time Period === | ||
| 109 | |||
| 110 | This is the superset of any predefined [[time period>>doc:sdmx:Glossary.Time period.WebHome]] or a distinct point in time. A [[time period>>doc:sdmx:Glossary.Time period.WebHome]] consists of a distinct start and end point. If the start and end of a period are expressed as date instead of a complete date time, then it is implied that the start of the period is the beginning of the start day (i.e. 00:00:00) and the end of the period is the end of the end day (i.e. 23:59:59). | ||
| 111 | |||
| 112 | === 4.2.4 Gregorian Time Period === | ||
| 113 | |||
| 114 | A Gregorian [[time period>>doc:sdmx:Glossary.Time period.WebHome]] is always represented by a Gregorian year, year-month, or day. These are all based on ISO 8601 dates. The [[representation>>doc:sdmx:Glossary.Representation.WebHome]] in [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]] messages and the period covered by each of the Gregorian [[time periods>>doc:sdmx:Glossary.Time period.WebHome]] are as follows: | ||
| 115 | |||
| 116 | **Gregorian Year:** | ||
| 117 | Representation: xs:gYear (YYYY) | ||
| 118 | Period: the start of January 1 to the end of December 31 | ||
| 119 | |||
| 120 | **Gregorian Year Month**: | ||
| 121 | Representation: xs:gYearMonth (YYYY-MM) | ||
| 122 | Period: the start of the first day of the month to end of the last day of the month | ||
| 123 | |||
| 124 | **Gregorian Day**: | ||
| 125 | Representation: xs:date (YYYY-MM-DD) | ||
| 126 | Period: the start of the day (00:00:00) to the end of the day (23:59:59) | ||
| 127 | |||
| 128 | === 4.2.5 Date Time === | ||
| 129 | |||
| 130 | This is used to unambiguously state that a date-time represents an observation at a single point in time. Therefore, if one wants to use [[SDMX>>doc:sdmx:Glossary.Statistical data and metadata exchange.WebHome]] for data which is measured at a distinct point in time rather than being reported over a period, the date-time [[representation>>doc:sdmx:Glossary.Representation.WebHome]] can be used. | ||
| 131 | |||
| 132 | [[Representation>>doc:sdmx:Glossary.Representation.WebHome]]: xs:dateTime (YYYY-MM-DDThh:mm:ss){{footnote}}The seconds can be reported fractionally{{/footnote}} | ||
| 133 | |||
| 134 | === 4.2.6 Standard Reporting Period === | ||
| 135 | |||
| 136 | Standard reporting periods are periods of time in relation to a reporting year. Each of these standard reporting periods has a duration (based on the ISO 8601 definition) associated with it. The general format of a reporting period is as follows: | ||
| 137 | |||
| 138 | [REPORTING_YEAR]-[PERIOD_INDICATOR][PERIOD_VALUE] | ||
| 139 | |||
| 140 | Where: | ||
| 141 | REPORTING_YEAR represents the reporting year as four digits (YYYY) PERIOD_INDICATOR identifies the type of period which determines the duration of the period | ||
| 142 | PERIOD_VALUE indicates the actual period within the year | ||
| 143 | |||
| 144 | The following section details each of the standard reporting periods defined in [[SDMX>>doc:sdmx:Glossary.Statistical data and metadata exchange.WebHome]]: | ||
| 145 | |||
| 146 | **Reporting Year**: | ||
| 147 | Period Indicator: A | ||
| 148 | Period Duration: P1Y (one year) | ||
| 149 | Limit per year: 1 | ||
| 150 | Representation: common:ReportingYearType (YYYY-A1, e.g. 2000-A1) | ||
| 151 | |||
| 152 | **Reporting Semester:** | ||
| 153 | Period Indicator: S | ||
| 154 | Period Duration: P6M (six months) | ||
| 155 | Limit per year: 2 | ||
| 156 | Representation: common:ReportingSemesterType (YYYY-Ss, e.g. 2000-S2) | ||
| 157 | |||
| 158 | **Reporting Trimester:** | ||
| 159 | Period Indicator: T | ||
| 160 | Period Duration: P4M (four months) | ||
| 161 | Limit per year: 3 | ||
| 162 | Representation: common:ReportingTrimesterType (YYYY-Tt, e.g. 2000-T3) | ||
| 163 | |||
| 164 | **Reporting Quarter:** | ||
| 165 | Period Indicator: Q | ||
| 166 | Period Duration: P3M (three months) | ||
| 167 | Limit per year: 4 | ||
| 168 | Representation: common:ReportingQuarterType (YYYY-Qq, e.g. 2000-Q4) | ||
| 169 | |||
| 170 | **Reporting Month**: | ||
| 171 | Period Indicator: M | ||
| 172 | Period Duration: P1M (one month) | ||
| 173 | Limit per year: 1 | ||
| 174 | Representation: common:ReportingMonthType (YYYY-Mmm, e.g. 2000-M12) Notes: The reporting month is always represented as two digits, therefore 1-9 are 0 padded (e.g. 01). This allows the values to be sorted chronologically using textual sorting methods. | ||
| 175 | |||
| 176 | **Reporting Week**: | ||
| 177 | Period Indicator: W | ||
| 178 | Period Duration: P7D (seven days) | ||
| 179 | Limit per year: 53 | ||
| 180 | Representation: common:ReportingWeekType (YYYY-Www, e.g. 2000-W53) | ||
| 181 | Notes: There are either 52 or 53 weeks in a reporting year. This is based on the ISO 8601 definition of a week (Monday - Saturday), where the first week of a reporting year is defined as the week with the first Thursday on or after the reporting year start day.{{footnote}}ISO 8601 defines alternative definitions for the first week, all of which produce equivalent results. Any of these definitions could be substituted so long as they are in relation to the reporting year start day.{{/footnote}} The reporting week is always represented as two digits, therefore 1-9 are 0 padded (e.g. 01). This allows the values to be sorted chronologically using textual sorting methods. | ||
| 182 | |||
| 183 | **Reporting Day**: | ||
| 184 | Period Indicator: D | ||
| 185 | Period Duration: P1D (one day) | ||
| 186 | Limit per year: 366 | ||
| 187 | Representation: common:ReportingDayType (YYYY-Dddd, e.g. 2000-D366) Notes: There are either 365 or 366 days in a reporting year, depending on whether the reporting year includes leap day (February 29). The reporting day is always represented as three digits, therefore 1-99 are 0 padded (e.g. 001). | ||
| 188 | |||
| 189 | This allows the values to be sorted chronologically using textual sorting methods. | ||
| 190 | |||
| 191 | The meaning of a reporting year is always based on the start day of the year and requires that the reporting year is expressed as the year at the start of the period. This start day is always the same for a reporting year, and is expressed as a day and a month (e.g. July 1). Therefore, the reporting year 2000 with a start day of July 1 begins on July 1, 2000. | ||
| 192 | |||
| 193 | A specialized [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] (reporting year start day) exists for the purpose of communicating the reporting year start day. This [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] has a fixed identifier (REPORTING_YEAR_START_DAY) and a fixed [[representation>>doc:sdmx:Glossary.Representation.WebHome]] (xs:gMonthDay) so that it can always be easily identified and processed in a data message. Although this [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] exists in specialized sub-class, it functions the same as any other [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] outside of its identification and [[representation>>doc:sdmx:Glossary.Representation.WebHome]]. It must takes its identity from a (% style="color:#e74c3c" %)[[concept>>doc:sdmx:Glossary.Concept.WebHome]](%%) and state its relationship with other [[components>>doc:sdmx:Glossary.Component.WebHome]] of the [[data structure definition>>doc:sdmx:Glossary.Data structure definition.WebHome]]. The ability to state this relationship allows this reporting year start day [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] to exist at the appropriate levels of a data message. In the absence of this [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]], the reporting year start date is assumed to be January 1; therefore if the reporting year coincides with the calendar year, this [[Attribute>>doc:sdmx:Glossary.Attribute.WebHome]] is not necessary. | ||
| 194 | |||
| 195 | Since the duration and the reporting year start day are known for any reporting period, it is possible to relate any reporting period to a distinct calendar period. The actual Gregorian calendar period covered by the reporting period can be computed as follows (based on the standard format of [REPROTING_YEAR][PERIOD_INDICATOR][PERIOD_VALUE] and the reporting year start day as [REPORTING_YEAR_START_DAY]): | ||
| 196 | |||
| 197 | **~1. Determine [REPORTING_YEAR_BASE]:** | ||
| 198 | Combine [REPORTING_YEAR] of the reporting period value (YYYY) with [REPORTING_YEAR_START_DAY] (MM-DD) to get a date (YYYY-MM-DD). | ||
| 199 | This is the [REPORTING_YEAR_START_DATE] | ||
| 200 | **a) If the [PERIOD_INDICATOR] is W: | ||
| 201 | ~1. If [REPORTING_YEAR_START_DATE] is a Friday, Saturday, or Sunday:** | ||
| 202 | Add^^3^^ (P3D, P2D, or P1D respectively) to the [REPORTING_YEAR_START_DATE]. The result is the [REPORTING_YEAR_BASE]. | ||
| 203 | |||
| 204 | 2. **If [REPORTING_YEAR_START_DATE] is a Monday, Tuesday, Wednesday, or Thursday:** | ||
| 205 | Add^^3^^ (P0D, -P1D, -P2D, or -P3D respectively) to the [REPORTING_YEAR_START_DATE]. The result is the [REPORTING_YEAR_BASE]. | ||
| 206 | b) **Else:** | ||
| 207 | The [REPORTING_YEAR_START_DATE] is the [REPORTING_YEAR_BASE] | ||
| 208 | |||
| 209 | **2. Determine [PERIOD_DURATION]:** | ||
| 210 | |||
| 211 | a) If the [PERIOD_INDICATOR] is A, the [PERIOD_DURATION] is P1Y. | ||
| 212 | b) If the [PERIOD_INDICATOR] is S, the [PERIOD_DURATION] is P6M. | ||
| 213 | c) If the [PERIOD_INDICATOR] is T, the [PERIOD_DURATION] is P4M. | ||
| 214 | d) If the [PERIOD_INDICATOR] is Q, the [PERIOD_DURATION] is P3M. | ||
| 215 | e) If the [PERIOD_INDICATOR] is M, the [PERIOD_DURATION] is P1M. | ||
| 216 | f) If the [PERIOD_INDICATOR] is W, the [PERIOD_DURATION] is P7D. | ||
| 217 | g) If the [PERIOD_INDICATOR] is D, the [PERIOD_DURATION] is P1D. | ||
| 218 | |||
| 219 | **3. Determine [PERIOD_START]:** | ||
| 220 | |||
| 221 | Subtract one from the [PERIOD_VALUE] and multiply this by the [PERIOD_DURATION]. Add{{footnote}}The rules for adding durations to a date time are described in the W3C XML Schema specification. See http://www.w3.org/TR/xmlschema-2/#adding-durations-to-dateTimes for further details.{{/footnote}} this to the [REPORTING_YEAR_BASE]. The result is the [PERIOD_START]. | ||
| 222 | |||
| 223 | **4. Determine the [PERIOD_END]:** | ||
| 224 | Multiply the [PERIOD_VALUE] by the [PERIOD_DURATION]. Add{{footnote}}The rules for adding durations to a date time are described in the W3C XML Schema specification. See http://www.w3.org/TR/xmlschema-2/#adding-durations-to-dateTimes for further details.{{/footnote}} this to the [REPORTING_YEAR_BASE] add{{footnote}}The rules for adding durations to a date time are described in the W3C XML Schema specification. See http://www.w3.org/TR/xmlschema-2/#adding-durations-to-dateTimes for further details.{{/footnote}} -P1D. The result is the [PERIOD_END]. | ||
| 225 | |||
| 226 | For all of these ranges, the bounds include the beginning of the [PERIOD_START] (i.e. 00:00:00) and the end of the [PERIOD_END] (i.e. 23:59:59). | ||
| 227 | |||
| 228 | **Examples:** | ||
| 229 | |||
| 230 | **2010-Q2, REPORTING_YEAR_START_DAY = ~-~-07-01 (July 1)** | ||
| 231 | ~1. [REPORTING_YEAR_START_DATE] = 2010-07-01 | ||
| 232 | b) [REPORTING_YEAR_BASE] = 2010-07-01 | ||
| 233 | [PERIOD_DURATION] = P3M | ||
| 234 | (2-1) * P3M = P3M | ||
| 235 | 2010-07-01 + P3M = 2010-10-01 | ||
| 236 | [PERIOD_START] = 2010-10-01 | ||
| 237 | 4. 2 * P3M = P6M | ||
| 238 | 2010-07-01 + P6M = 2010-13-01 = 2011-01-01 | ||
| 239 | 2011-01-01 + -P1D = 2010-12-31 | ||
| 240 | [PERIOD_END] = 2011-12-31 | ||
| 241 | |||
| 242 | The actual calendar range covered by 2010-Q2 (assuming the reporting year begins July 1) is 2010-10-01T00:00:00/2010-12-31T23:59:59 | ||
| 243 | |||
| 244 | **2011-W36, REPORTING_YEAR_START_DAY = ~-~-07-01 (July 1)** | ||
| 245 | ~1. [REPORTING_YEAR_START_DATE] = 2010-07-01 | ||
| 246 | a) 2011-07-01 = Friday | ||
| 247 | 2011-07-01 + P3D = 2011-07-04 | ||
| 248 | [REPORTING_YEAR_BASE] = 2011-07-04 | ||
| 249 | 2. [PERIOD_DURATION] = P7D | ||
| 250 | 3. (36-1) * P7D = P245D | ||
| 251 | 2011-07-04 + P245D = 2012-03-05 | ||
| 252 | [PERIOD_START] = 2012-03-05 | ||
| 253 | 4. 36 * P7D = P252D | ||
| 254 | 2011-07-04 + P252D =2012-03-12 | ||
| 255 | 2012-03-12 + -P1D = 2012-03-11 | ||
| 256 | [PERIOD_END] = 2012-03-11 | ||
| 257 | |||
| 258 | The actual calendar range covered by 2011-W36 (assuming the reporting year begins July 1) is 2012-03-05T00:00:00/2012-03-11T23:59:59 | ||
| 259 | |||
| 260 | === 4.2.7 Distinct Range === | ||
| 261 | |||
| 262 | In the case that the reporting period does not fit into one of the prescribe periods above, a distinct time range can be used. The value of these ranges is based on the ISO 8601 time interval format of start/duration. Start can be expressed as either an ISO 8601 date or a date-time, and duration is expressed as an ISO 8601 duration. However, the duration can only be postive. | ||
| 263 | |||
| 264 | === 4.2.8 Time Format === | ||
| 265 | |||
| 266 | In version 2.0 of [[SDMX>>doc:sdmx:Glossary.Statistical data and metadata exchange.WebHome]] there is a recommendation to use the [[time format>>doc:sdmx:Glossary.Time format.WebHome]] [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] to gives additional information on the way time is represented in the message. Following an appraisal of its usefulness this is no longer required. However, it is still possible, if required , to include the [[time format>>doc:sdmx:Glossary.Time format.WebHome]] [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] in [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]]. | ||
| 267 | |||
| 268 | (% style="width:716.835px" %) | ||
| 269 | |(% style="width:197px" %)**Code**|(% style="width:517px" %)**Format** | ||
| 270 | |(% style="width:197px" %)**OTP**|(% style="width:517px" %)Observational [[Time Period>>doc:sdmx:Glossary.Time period.WebHome]]: Superset of all [[SDMX>>doc:sdmx:Glossary.Statistical data and metadata exchange.WebHome]] [[time formats>>doc:sdmx:Glossary.Time format.WebHome]] (Gregorian [[Time Period>>doc:sdmx:Glossary.Time period.WebHome]], Reporting [[Time Period>>doc:sdmx:Glossary.Time period.WebHome]], and Time Range) | ||
| 271 | |(% style="width:197px" %)**STP**|(% style="width:517px" %)Standard [[Time Period>>doc:sdmx:Glossary.Time period.WebHome]]: Superset of Gregorian and Reporting [[Time Periods>>doc:sdmx:Glossary.Time period.WebHome]] | ||
| 272 | |(% style="width:197px" %)**GTP**|(% style="width:517px" %)Superset of all Gregorian [[Time Periods>>doc:sdmx:Glossary.Time period.WebHome]] and date-time | ||
| 273 | |(% style="width:197px" %)**RTP**|(% style="width:517px" %)Superset of all Reporting [[Time Periods>>doc:sdmx:Glossary.Time period.WebHome]] | ||
| 274 | |(% style="width:197px" %)**TR**|(% style="width:517px" %)Time Range: Start time and duration (YYYY-MMDD(Thh:mm:ss)?/) | ||
| 275 | |(% style="width:197px" %)**GY**|(% style="width:517px" %)Gregorian Year (YYYY) | ||
| 276 | |(% style="width:197px" %)**GTM**|(% style="width:517px" %)Gregorian Year Month (YYYY-MM) | ||
| 277 | |(% style="width:197px" %)**GD**|(% style="width:517px" %)Gregorian Day (YYYY-MM-DD) | ||
| 278 | |(% style="width:197px" %)**DT**|(% style="width:517px" %)Distinct Point: date-time (YYYY-MM-DDThh:mm:ss) | ||
| 279 | |(% style="width:197px" %)**RY**|(% style="width:517px" %)Reporting Year (YYYY-A1) | ||
| 280 | |(% style="width:197px" %)**RS**|(% style="width:517px" %)Reporting Semester (YYYY-Ss) | ||
| 281 | |(% style="width:197px" %)**RT**|(% style="width:517px" %)Reporting Trimester (YYYY-Tt) | ||
| 282 | |(% style="width:197px" %)**RQ**|(% style="width:517px" %)Reporting Quarter (YYYY-Qq) | ||
| 283 | |(% style="width:197px" %)**RM**|(% style="width:517px" %)Reporting Month (YYYY-Mmm) | ||
| 284 | |(% style="width:197px" %)**[[Code>>doc:sdmx:Glossary.Code.WebHome]]**|(% style="width:517px" %)**Format** | ||
| 285 | |(% style="width:197px" %)**RW**|(% style="width:517px" %)Reporting Week (YYYY-Www) | ||
| 286 | |(% style="width:197px" %)**RD**|(% style="width:517px" %)Reporting Day (YYYY-Dddd) | ||
| 287 | |||
| 288 | **Table 1: SDMX-ML Time Format Codes** | ||
| 289 | |||
| 290 | === 4.2.9 Transformation between SDMX-ML and SDMX-EDI === | ||
| 291 | |||
| 292 | When converting [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]] [[data structure definitions>>doc:sdmx:Glossary.Data structure definition.WebHome]] to [[SDMX-EDI>>doc:sdmx:Glossary.SDMX-EDI.WebHome]] [[data structure definitions>>doc:sdmx:Glossary.Data structure definition.WebHome]], only the identifier of the [[time format>>doc:sdmx:Glossary.Time format.WebHome]] [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] will be retained. The [[representation>>doc:sdmx:Glossary.Representation.WebHome]] of the [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] will be converted from the [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]] format to the fixed [[SDMX-EDI>>doc:sdmx:Glossary.SDMX-EDI.WebHome]] [[code list>>doc:sdmx:Glossary.Code list.WebHome]]. If the [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]] [[data structure definition>>doc:sdmx:Glossary.Data structure definition.WebHome]] does not define a [[time format>>doc:sdmx:Glossary.Time format.WebHome]] [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]], then one will be automatically created with the identifier "TIME_FORMAT". | ||
| 293 | |||
| 294 | When converting [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]] data to [[SDMX-EDI>>doc:sdmx:Glossary.SDMX-EDI.WebHome]], the source [[time format>>doc:sdmx:Glossary.Time format.WebHome]] [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] will be irrelevant. Since the [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]] time [[representation>>doc:sdmx:Glossary.Representation.WebHome]] types are not ambiguous, the target [[time format>>doc:sdmx:Glossary.Time format.WebHome]] can be determined from the source time value directly. For example, if the [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]] time is 2000-Q2 the [[SDMX-EDI>>doc:sdmx:Glossary.SDMX-EDI.WebHome]] format will always be 608/708 (depending on whether the target series contains one observation or a range of observations). | ||
| 295 | |||
| 296 | When converting a [[data structure definition>>doc:sdmx:Glossary.Data structure definition.WebHome]] originating in [[SDMX-EDI>>doc:sdmx:Glossary.SDMX-EDI.WebHome]], the [[time format>>doc:sdmx:Glossary.Time format.WebHome]] [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] should be ignored, as it serves no purpose in [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]]. | ||
| 297 | |||
| 298 | When converting data from [[SDMX-EDI>>doc:sdmx:Glossary.SDMX-EDI.WebHome]] to [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]], the source [[time format>>doc:sdmx:Glossary.Time format.WebHome]] is only necessary to determine the format of the target time value. For example, a source [[time format>>doc:sdmx:Glossary.Time format.WebHome]] of will result in a target time in the format YYYY-Ss whereas a source format of will result in a target time value in the format YYYY-Qq. | ||
| 299 | |||
| 300 | === 4.2.10 Time Zones === | ||
| 301 | |||
| 302 | In alignment with ISO 8601, [[SDMX>>doc:sdmx:Glossary.Statistical data and metadata exchange.WebHome]] allows the specification of a time zone on all [[time periods>>doc:sdmx:Glossary.Time period.WebHome]] and on the reporting year start day. If a time zone is provided on a reporting year start day, then the same time zone (or none) should be reported for each reporting [[time period>>doc:sdmx:Glossary.Time period.WebHome]]. If the reporting year start day and the reporting period time zone differ, the time zone of the reporting period will take precedence. Examples of each format with time zones are as follows (time zone indicated in bold): | ||
| 303 | |||
| 304 | * Time Range (start date): 2006-06-05**-05:00**/P5D | ||
| 305 | * Time Range (start date-time): 2006-06-05T00:00:00**-05:00**/P5D | ||
| 306 | * Gregorian Year: 2006**-05:00** | ||
| 307 | * Gregorian Month: 2006-06**-05:00** | ||
| 308 | * Gregorian Day: 2006-06-05**-05:00** | ||
| 309 | * Distinct Point: 2006-06-05T00:00:00**-05:00** | ||
| 310 | * Reporting Year: 2006-A1**-05:00** | ||
| 311 | * Reporting Semester: 2006-S2**-05:00** | ||
| 312 | * Reporting Trimester: 2006-T2**-05:00** | ||
| 313 | * Reporting Quarter: 2006-Q3**-05:00** | ||
| 314 | * Reporting Month: 2006-M06**-05:00** | ||
| 315 | * Reporting Week: 2006-W23**-05:00** | ||
| 316 | * Reporting Day: 2006-D156**-05:00** | ||
| 317 | * Reporting Year Start Day: 07-01**-05:00** | ||
| 318 | |||
| 319 | According to ISO 8601, a date without a time-zone is considered "local time". [[SDMX>>doc:sdmx:Glossary.Statistical data and metadata exchange.WebHome]] assumes that local time is that of the sender of the message. In this version of [[SDMX>>doc:sdmx:Glossary.Statistical data and metadata exchange.WebHome]], an optional field is added to the sender definition in the header for specifying a time zone. This field has a default value of 'Z' (UTC). This determination of local time applies for all dates in a message. | ||
| 320 | |||
| 321 | === 4.2.11 Representing Time Spans Elsewhere === | ||
| 322 | |||
| 323 | It has been possible since [[SDMX>>doc:sdmx:Glossary.Statistical data and metadata exchange.WebHome]] 2.0 for a [[Component>>doc:sdmx:Glossary.Component.WebHome]] to specify a [[representation>>doc:sdmx:Glossary.Representation.WebHome]] of a time span. Depending on the format of the data message, this resulted in either an element with 2 XML [[attributes>>doc:sdmx:Glossary.Attribute.WebHome]] for holding the start time and the duration or two separate XML [[attributes>>doc:sdmx:Glossary.Attribute.WebHome]] based on the underlying [[Component>>doc:sdmx:Glossary.Component.WebHome]] identifier. For example if REF_PERIOD were given a [[representation>>doc:sdmx:Glossary.Representation.WebHome]] of time span, then in the Compact data format, it would be represented by two XML [[attributes>>doc:sdmx:Glossary.Attribute.WebHome]]; REF_PERIODStartTime (holding the start) and REF_PERIOD (holding the duration). If a new simple type is introduced in the [[SDMX>>doc:sdmx:Glossary.Statistical data and metadata exchange.WebHome]] schemas that can hold ISO 8601 time intervals, then this will no longer be necessary. What was represented as this: | ||
| 324 | |||
| 325 | <Series REF_PERIODStartTime="2000-01-01T00:00:00" REF_PERIOD="P2M"/> | ||
| 326 | |||
| 327 | can now be represented with this: | ||
| 328 | |||
| 329 | <Series REF_PERIOD="2000-01-01T00:00:00/P2M"/> | ||
| 330 | |||
| 331 | === 4.2.12 Notes on Formats === | ||
| 332 | |||
| 333 | There is no ambiguity in these formats so that for any given value of time, the [[category>>doc:sdmx:Glossary.Category.WebHome]] of the period (and thus the intended [[time period>>doc:sdmx:Glossary.Time period.WebHome]] range) is always clear. It should also be noted that by utilizing the ISO 8601 format, and a format loosely based on it for the report periods, the values of time can easily be sorted chronologically without additional parsing. | ||
| 334 | |||
| 335 | === 4.2.13 Effect on Time Ranges === | ||
| 336 | |||
| 337 | All [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]] data messages are capable of functioning in a manner similar to [[SDMX-EDI>>doc:sdmx:Glossary.SDMX-EDI.WebHome]] if the [[Dimension>>doc:sdmx:Glossary.Dimension.WebHome]] at the observation level is time: the [[time period>>doc:sdmx:Glossary.Time period.WebHome]] for the first observation can be stated and the rest of the observations can omit the time value as it can be derived from the start time and the frequency. Since the frequency can be determined based on the actual format of the time value for everything but distinct points in time and time ranges, this makes is even simpler to process as the interval between time ranges is known directly from the time value. | ||
| 338 | |||
| 339 | === 4.2.14 Time in Query Messages === | ||
| 340 | |||
| 341 | When querying for time values, the value of a time parameter can be provided as any of the Observational [[Time Period>>doc:sdmx:Glossary.Time period.WebHome]] formats and must be paired with an operator. In addition, an explicit value for the reporting year start day can be provided, or this can be set to "Any". This section will detail how systems processing query messages should interpret these parameters. | ||
| 342 | |||
| 343 | Fundamental to processing a time value parameter in a query message is understanding that all [[time periods>>doc:sdmx:Glossary.Time period.WebHome]] should be handled as a distinct range of time. Since the time parameter in the query is paired with an operator, this is also effectively represents a distinct range of time. Therefore, a system processing the query must simply match the data where the [[time period>>doc:sdmx:Glossary.Time period.WebHome]] for requested parameter is encompassed by the [[time period>>doc:sdmx:Glossary.Time period.WebHome]] resulting from value of the query parameter. The following table details how the operators should be interpreted for any [[time period>>doc:sdmx:Glossary.Time period.WebHome]] provided as a parameter. | ||
| 344 | |||
| 345 | (% style="width:1024.29px" %) | ||
| 346 | |(% style="width:238px" %)**Operator**|(% style="width:782px" %)**Rule** | ||
| 347 | |(% style="width:238px" %)Greater Than|(% style="width:782px" %)Any data after the last moment of the period | ||
| 348 | |(% style="width:238px" %)Less Than|(% style="width:782px" %)Any data before the first moment of the period | ||
| 349 | |(% style="width:238px" %)Greater Than or Equal To|(% style="width:782px" %)((( | ||
| 350 | Any data on or after the first moment of the period | ||
| 351 | ))) | ||
| 352 | |(% style="width:238px" %)Less Than or Equal To|(% style="width:782px" %)Any data on or before the last moment of the period | ||
| 353 | |(% style="width:238px" %)Equal To|(% style="width:782px" %)Any data which falls on or after the first moment of the period and before or on the last moment of the period | ||
| 354 | |||
| 355 | Reporting [[Time Periods>>doc:sdmx:Glossary.Time period.WebHome]] as query parameters are handled based on whether the value of the reportingYearStartDay XML [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] is an explicit month and day or "Any": | ||
| 356 | |||
| 357 | If the time parameter provides an explicit month and day value for the reportingYearStartDay XML [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]], then the parameter value is converted to a distinct range and processed as any other [[time period>>doc:sdmx:Glossary.Time period.WebHome]] would be processed. | ||
| 358 | |||
| 359 | If the reportingYeartStartDay XML [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] has a value of "Any", then any data within the bounds of the reporting period for the year is matched, regardless of the actual start day of the reporting year. In addition, data reported against a normal calendar period is matched if it falls within the bounds of the time parameter based on a reporting year start day of January 1. When determining whether another reporting period falls within the bounds of a report period query parameter, one will have to take into account the actual [[time period>>doc:sdmx:Glossary.Time period.WebHome]] to compare weeks and days to higher order report periods. This will be demonstrated in the examples to follow. | ||
| 360 | |||
| 361 | Note that the reportingYearStartDay XML [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] on the time value parameter is only used to qualify a reporting period value for the given time value parameter. The usage of this is different than using the [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] value parameter for the actual reporting year start day [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]]. In the case that the [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] value parameters is used for the reporting year start day data structure [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]], it will be treated as any other [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] value parameter; data will be filtered to that which matches the values specified for the given [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]]. For example, if the [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] value parameter references the reporting year start day [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] and specifies a value of "07-01", then only data which has this [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] with the value "07-01" will be returned. In terms of processing any time value parameters, the value supplied in the [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] value parameter will be irrelevant. | ||
| 362 | |||
| 363 | **Examples:** | ||
| 364 | |||
| 365 | **Gregorian Period** | ||
| 366 | Query Parameter: Greater than 2010 | ||
| 367 | Literal Interpretation: Any data where the start period occurs after 2010-1231T23:59:59. | ||
| 368 | |||
| 369 | Example Matches: | ||
| 370 | |||
| 371 | * 2011 or later | ||
| 372 | * 2011-01 or later | ||
| 373 | * 2011-01-01 or later | ||
| 374 | * 2011-01-01/P[Any Duration] or any later start date | ||
| 375 | * 2011-[Any reporting period] (any reporting year start day) | ||
| 376 | * 2010-S2 (reporting year start day ~-~-07-01 or later) | ||
| 377 | * 2010-T3 (reporting year start day ~-~-07-01 or later) | ||
| 378 | * 2010-Q3 or later (reporting year start day ~-~-07-01 or later) | ||
| 379 | * 2010-M07 or later (reporting year start day ~-~-07-01 or later) | ||
| 380 | * 2010-W28 or later (reporting year start day ~-~-07-01 or later) | ||
| 381 | * 2010-D185 or later (reporting year start day ~-~-07-01 or later) | ||
| 382 | |||
| 383 | **Reporting Period with explicit start day** | ||
| 384 | |||
| 385 | Query Parameter: Greater than or equal to 2009-Q3, reporting year start day = "-07-01" | ||
| 386 | Literal Interpretation: Any data where the start period occurs on after 2010-0101T00:00:00 (Note that in this case 2009-Q3 is converted to the explicit date range of 2010-01-01/2010-03-31 because of the reporting year start day value). Example Matches: Same as previous example | ||
| 387 | |||
| 388 | **Reporting Period with "Any" start day** | ||
| 389 | Query Parameter: Greater than or equal to 2010-Q3, reporting year start day = "Any" | ||
| 390 | Literal Interpretation: Any data with a reporting period where the start period is on or after the start period of 2010-Q3 for the same reporting year start day, or and data where the start period is on or after 2010-07-01. Example Matches: | ||
| 391 | |||
| 392 | * 2011 or later | ||
| 393 | * 2010-07 or later | ||
| 394 | * 2010-07-01 or later | ||
| 395 | * 2010-07-01/P[Any Duration] or any later start date | ||
| 396 | * 2011-[Any reporting period] (any reporting year start day) | ||
| 397 | * 2010-S2 (any reporting year start day) | ||
| 398 | * 2010-T3 (any reporting year start day) | ||
| 399 | * 2010-Q3 or later (any reporting year start day) | ||
| 400 | * 2010-M07 or later (any reporting year start day) | ||
| 401 | * 2010-W27 or later (reporting year start day ~-~-01-01){{footnote}}2010-Q3 (with a reporting year start day of --01-01) starts on 2010-07-01. This is day 4 of week 26, therefore the first week matched is week 27.{{/footnote}} | ||
| 402 | * 2010-D182 or later (reporting year start day ~-~-01-01) | ||
| 403 | * 2010-W28 or later (reporting year start day ~-~-07-01){{footnote}}2010-Q3 (with a reporting year start day of --07-01) starts on 2011-01-01. This is day 6 of week 27, therefore the first week matched is week 28.{{/footnote}} | ||
| 404 | * 2010-D185 or later (reporting year start day ~-~-07-01) | ||
| 405 | |||
| 406 | == 4.3 Structural Metadata Querying Best Practices == | ||
| 407 | |||
| 408 | When querying for [[structural metadata>>doc:sdmx:Glossary.Structural metadata.WebHome]], the ability to state how references should be resolved is quite powerful. However, this mechanism is not always necessary and can create an undue burden on the systems processing the queries if it is not used properly. | ||
| 409 | |||
| 410 | Any [[structural metadata>>doc:sdmx:Glossary.Structural metadata.WebHome]] object which contains a reference to an object can be queried based on that reference. For example, a categorisation references both a [[category>>doc:sdmx:Glossary.Category.WebHome]] and the object is it categorising. As this is the case, one can query for categorisations which categorise a particular object or which categorise against a particular [[category>>doc:sdmx:Glossary.Category.WebHome]] or [[category scheme>>doc:sdmx:Glossary.Category scheme.WebHome]]. This mechanism should be used when the referenced object is known. | ||
| 411 | |||
| 412 | When the referenced object is not known, then the reference resolution mechanism could be used. For example, suppose one wanted to find all [[category schemes>>doc:sdmx:Glossary.Category scheme.WebHome]] and the related categorisations for a given [[maintenance agency>>doc:sdmx:Glossary.Maintenance agency.WebHome]]. In this case, one could query for the [[category scheme>>doc:sdmx:Glossary.Category scheme.WebHome]] by the [[maintenance agency>>doc:sdmx:Glossary.Maintenance agency.WebHome]] and specify that parent and sibling references should be resolved. This would result in the categorisations which reference the [[categories>>doc:sdmx:Glossary.Category.WebHome]] in the matched schemes to be returned, as well as the object which they categorise. | ||
| 413 | |||
| 414 | == 4.4 Versioning and External Referencing == | ||
| 415 | |||
| 416 | Within the [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]] Structure Message, there is a pattern for versioning and external referencing which should be pointed out. The identifiers are qualified by their [[version>>doc:Glossary.Version.WebHome]] numbers – that is, an object with an Agency of “A”, and ID of “X” and a [[version>>doc:Glossary.Version.WebHome]] of “1.0” is a different object than one with an Agency of “A’, an ID of “X”, and a [[version>>doc:Glossary.Version.WebHome]] of “1.1”. | ||
| 417 | |||
| 418 | The production [[versions>>doc:Glossary.Version.WebHome]] of identifiable objects/resources are assumed to be static – that is, they have their isFinal [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] set to ‘true”. Once in production, and object cannot change in any way, or it must be versioned. For cases where an object is not static, the isFinal [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] must have a value of “false”, but non-final objects should not be used outside of a specific system designed to accommodate them. For most purposes, all objects should be declared final before use in production. | ||
| 419 | |||
| 420 | This mechanism is an “early binding” one – everything with a versioned identity is a known quantity, and will not change. It is worth pointing out that in some cases relationships are essentially one-way references: an illustrative case is that of [[Categories>>doc:sdmx:Glossary.Category.WebHome]]. While a [[Category>>doc:sdmx:Glossary.Category.WebHome]] may be referenced by many [[dataflows>>doc:sdmx:Glossary.Dataflow.WebHome]] and [[metadata flows>>doc:sdmx:Glossary.Metadataflow.WebHome]], the addition of more references from flow objects does not [[version>>doc:Glossary.Version.WebHome]] the [[Category>>doc:sdmx:Glossary.Category.WebHome]]. This is because the flows are not properties of the [[Categories>>doc:sdmx:Glossary.Category.WebHome]] – they merely make references to it. If the name of a [[Category>>doc:sdmx:Glossary.Category.WebHome]] changed, or its subCategories changed, then versioning would be necessary. | ||
| 421 | |||
| 422 | Versioning operates at the level of versionable and maintainable objects in the [[SDMX information model>>doc:sdmx:Glossary.SDMX Information Model.WebHome]]. If any of the children of objects at these levels change, then the objects themselves are versioned. | ||
| 423 | |||
| 424 | One area which is much impacted by this versioning scheme is the ability to reference external objects. With the many dependencies within the various structural objects in [[SDMX>>doc:sdmx:Glossary.Statistical data and metadata exchange.WebHome]], it is useful to have a scheme for external referencing. This is done at the level of maintainable objects (DSDs, [[code lists>>doc:sdmx:Glossary.Code list.WebHome]], [[concept schemes>>doc:sdmx:Glossary.Concept scheme.WebHome]], etc.) In an [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]] Structure Message, whenever an “[[isExternalReference>>doc:sdmx:Glossary.isExternalReference.WebHome]]” [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] is set to true, then the application must resolve the address provided in the associated “uri” [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] and use the [[SDMX-ML>>doc:sdmx:Glossary.SDMX-ML.WebHome]] Structure Message stored at that location for the full definition of the object in question. Alternately, if a registry “urn” [[attribute>>doc:sdmx:Glossary.Attribute.WebHome]] has been provided, the registry can be used to supply the full details of the object. | ||
| 425 | |||
| 426 | Because the version number is part of the identifier for an object, [[versions>>doc:Glossary.Version.WebHome]] are a necessary part of determining that a given resource is the one which was called for. It should be noted that whenever a [[version>>doc:Glossary.Version.WebHome]] number is not supplied, it is assumed to be “1.0”. (The “x.x” versioning notation is conventional in practice with [[SDMX>>doc:sdmx:Glossary.Statistical data and metadata exchange.WebHome]], but not required.) | ||
| 427 | |||
| 428 | {{putFootnotes/}} |