Changes for page SDMX 2.1 Standards. Section 6. Technical Notes
Last modified by Artur on 2025/08/19 10:43
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -381,39 +381,37 @@ 381 381 382 382 The details of these time period categories and of the distinct formats which make them up are detailed in the sections to follow. 383 383 384 -=== =4.2.2 Observational Time Period ====384 +=== 4.2.2 Observational Time Period === 385 385 386 386 This is the superset of all time representations in SDMX. This allows for time to be expressed as any of the allowable formats. 387 387 388 -=== =4.2.3 Standard Time Period ====388 +=== 4.2.3 Standard Time Period === 389 389 390 390 This is the superset of any predefined time period or a distinct point in time. A time period 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). 391 391 392 -=== =4.2.4 Gregorian Time Period ====392 +=== 4.2.4 Gregorian Time Period === 393 393 394 394 A Gregorian time period is always represented by a Gregorian year, year-month, or day. These are all based on ISO 8601 dates. The representation in SDMX-ML messages and the period covered by each of the Gregorian time periods are as follows: 395 395 396 -**Gregorian Year:** 397 - 396 +**Gregorian Year:** 398 398 Representation: xs:gYear (YYYY) 398 +Period: the start of January 1 to the end of December 31 399 399 400 -Period: the start of January 1 to the end of December 31 **Gregorian Year Month**: 401 - 400 +**Gregorian Year Month**: 402 402 Representation: xs:gYearMonth (YYYY-MM) 402 +Period: the start of the first day of the month to end of the last day of the month 403 403 404 -Period: the start of the first day of the month to end of the last day of the month **Gregorian Day**: 405 - 404 +**Gregorian Day**: 406 406 Representation: xs:date (YYYY-MM-DD) 407 - 408 408 Period: the start of the day (00:00:00) to the end of the day (23:59:59) 409 409 410 -=== =4.2.5 Date Time ====408 +=== 4.2.5 Date Time === 411 411 412 412 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 for data which is measured at a distinct point in time rather than being reported over a period, the date-time representation can be used. 413 413 414 414 Representation: xs:dateTime (YYYY-MM-DDThh:mm:ss)[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)^^~[1~]^^>>path:#_ftn1]] 415 415 416 -=== =4.2.6 Standard Reporting Period ====414 +=== 4.2.6 Standard Reporting Period === 417 417 418 418 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: 419 419 ... ... @@ -420,75 +420,52 @@ 420 420 [REPORTING_YEAR]-[PERIOD_INDICATOR][PERIOD_VALUE] 421 421 422 422 Where: 423 - 424 424 REPORTING_YEAR represents the reporting year as four digits (YYYY) PERIOD_INDICATOR identifies the type of period which determines the duration of the period 425 - 426 426 PERIOD_VALUE indicates the actual period within the year 427 427 428 428 The following section details each of the standard reporting periods defined in SDMX: 429 429 430 -**Reporting Year**: 431 - 432 - Period Indicator: A 433 - 426 +**Reporting Year**: 427 +Period Indicator: A 434 434 Period Duration: P1Y (one year) 435 - 436 436 Limit per year: 1 430 +Representation: common:ReportingYearType (YYYY-A1, e.g. 2000-A1) 437 437 438 -Representation: common:ReportingYearType (YYYY-A1, e.g. 2000-A1) **Reporting Semester:** 439 - 440 - Period Indicator: S 441 - 432 +**Reporting Semester:** 433 +Period Indicator: S 442 442 Period Duration: P6M (six months) 443 - 444 444 Limit per year: 2 436 +Representation: common:ReportingSemesterType (YYYY-Ss, e.g. 2000-S2) 445 445 446 -Representation: common:ReportingSemesterType (YYYY-Ss, e.g. 2000-S2) **Reporting Trimester:** 447 - 448 - Period Indicator: T 449 - 438 +**Reporting Trimester:** 439 +Period Indicator: T 450 450 Period Duration: P4M (four months) 451 - 452 452 Limit per year: 3 442 +Representation: common:ReportingTrimesterType (YYYY-Tt, e.g. 2000-T3) 453 453 454 -Representation: common:ReportingTrimesterType (YYYY-Tt, e.g. 2000-T3) **Reporting Quarter:** 455 - 456 - Period Indicator: Q 457 - 444 +**Reporting Quarter:** 445 +Period Indicator: Q 458 458 Period Duration: P3M (three months) 459 - 460 460 Limit per year: 4 448 +Representation: common:ReportingQuarterType (YYYY-Qq, e.g. 2000-Q4) 461 461 462 -Representation: common:ReportingQuarterType (YYYY-Qq, e.g. 2000-Q4) **Reporting Month**: 463 - 450 +**Reporting Month**: 464 464 Period Indicator: M 465 - 466 466 Period Duration: P1M (one month) 467 - 468 468 Limit per year: 1 469 - 470 470 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. 471 471 472 472 **Reporting Week**: 473 - 474 474 Period Indicator: W 475 - 476 476 Period Duration: P7D (seven days) 477 - 478 478 Limit per year: 53 479 - 480 480 Representation: common:ReportingWeekType (YYYY-Www, e.g. 2000-W53) 481 - 482 482 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.[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)^^~[2~]^^>>path:#_ftn2]](%%) 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. 483 483 484 484 **Reporting Day**: 485 - 486 486 Period Indicator: D 487 - 488 488 Period Duration: P1D (one day) 489 - 490 490 Limit per year: 366 491 - 492 492 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). 493 493 494 494 This allows the values to be sorted chronologically using textual sorting methods. ... ... @@ -499,143 +499,109 @@ 499 499 500 500 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]): 501 501 502 -1. **Determine [REPORTING_YEAR_BASE]:** 503 - 477 +**~1. Determine [REPORTING_YEAR_BASE]:** 504 504 Combine [REPORTING_YEAR] of the reporting period value (YYYY) with [REPORTING_YEAR_START_DAY] (MM-DD) to get a date (YYYY-MM-DD). 505 - 506 506 This is the [REPORTING_YEAR_START_DATE] 507 - 508 -**a) If the [PERIOD_INDICATOR] is W:** 509 - 510 -1. 511 -11. 512 -111. 513 -1111. **If [REPORTING_YEAR_START_DATE] is a Friday, Saturday, or Sunday:** 514 - 480 +**a) If the [PERIOD_INDICATOR] is W: 481 +~1. If [REPORTING_YEAR_START_DATE] is a Friday, Saturday, or Sunday:** 515 515 Add^^3^^ (P3D, P2D, or P1D respectively) to the [REPORTING_YEAR_START_DATE]. The result is the [REPORTING_YEAR_BASE]. 516 516 517 -1. 518 -11. 519 -111. 520 -1111. **If [REPORTING_YEAR_START_DATE] is a Monday, Tuesday, Wednesday, or Thursday:** 521 - 484 +2. **If [REPORTING_YEAR_START_DATE] is a Monday, Tuesday, Wednesday, or Thursday:** 522 522 Add^^3^^ (P0D, -P1D, -P2D, or -P3D respectively) to the [REPORTING_YEAR_START_DATE]. The result is the [REPORTING_YEAR_BASE]. 486 +b) **Else:** 487 +The [REPORTING_YEAR_START_DATE] is the [REPORTING_YEAR_BASE] 523 523 524 - b)**Else:**489 +**2. Determine [PERIOD_DURATION]:** 525 525 526 -The [REPORTING_YEAR_START_DATE] is the [REPORTING_YEAR_BASE]. 491 +a) If the [PERIOD_INDICATOR] is A, the [PERIOD_DURATION] is P1Y. 492 +b) If the [PERIOD_INDICATOR] is S, the [PERIOD_DURATION] is P6M. 493 +c) If the [PERIOD_INDICATOR] is T, the [PERIOD_DURATION] is P4M. 494 +d) If the [PERIOD_INDICATOR] is Q, the [PERIOD_DURATION] is P3M. 495 +e) If the [PERIOD_INDICATOR] is M, the [PERIOD_DURATION] is P1M. 496 +f) If the [PERIOD_INDICATOR] is W, the [PERIOD_DURATION] is P7D. 497 +g) If the [PERIOD_INDICATOR] is D, the [PERIOD_DURATION] is P1D. 527 527 528 -1. **Determine [PERIOD_DURATION]:** 529 -11. 530 -111. If the [PERIOD_INDICATOR] is A, the [PERIOD_DURATION] is P1Y. 531 -111. If the [PERIOD_INDICATOR] is S, the [PERIOD_DURATION] is P6M. 532 -111. If the [PERIOD_INDICATOR] is T, the [PERIOD_DURATION] is P4M. 533 -111. If the [PERIOD_INDICATOR] is Q, the [PERIOD_DURATION] is P3M. 534 -111. If the [PERIOD_INDICATOR] is M, the [PERIOD_DURATION] is P1M. 535 -111. If the [PERIOD_INDICATOR] is W, the [PERIOD_DURATION] is P7D. 536 -111. If the [PERIOD_INDICATOR] is D, the [PERIOD_DURATION] is P1D. 537 -1. **Determine [PERIOD_START]:** 538 - 499 +**3. Determine [PERIOD_START]:** 539 539 Subtract one from the [PERIOD_VALUE] and multiply this by the [PERIOD_DURATION]. Add[[(% class="wikiinternallink wikiinternallink wikiinternallink wikiinternallink wikiinternallink" %)^^~[3~]^^>>path:#_ftn3]](%%) this to the [REPORTING_YEAR_BASE]. The result is the [PERIOD_START]. 540 540 541 -1. **Determine the [PERIOD_END]:** 542 - 502 +**4. Determine the [PERIOD_END]:** 543 543 Multiply the [PERIOD_VALUE] by the [PERIOD_DURATION]. Add^^3^^ this to the [REPORTING_YEAR_BASE] add^^3^^ -P1D. The result is the [PERIOD_END]. 544 544 545 545 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). 546 546 547 -**Examples: 507 +**Examples:** 548 548 549 549 **2010-Q2, REPORTING_YEAR_START_DAY = ~-~-07-01 (July 1)** 550 - 551 551 ~1. [REPORTING_YEAR_START_DATE] = 2010-07-01 552 - 553 553 b) [REPORTING_YEAR_BASE] = 2010-07-01 554 - 555 -1. [PERIOD_DURATION] = P3M 556 -1. (2-1) * P3M = P3M 557 - 512 +[PERIOD_DURATION] = P3M 513 +(2-1) * P3M = P3M 558 558 2010-07-01 + P3M = 2010-10-01 559 - 560 560 [PERIOD_START] = 2010-10-01 561 - 562 562 4. 2 * P3M = P6M 563 - 564 564 2010-07-01 + P6M = 2010-13-01 = 2011-01-01 565 - 566 566 2011-01-01 + -P1D = 2010-12-31 567 - 568 568 [PERIOD_END] = 2011-12-31 569 569 570 570 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 571 571 572 572 **2011-W36, REPORTING_YEAR_START_DAY = ~-~-07-01 (July 1)** 573 - 574 574 ~1. [REPORTING_YEAR_START_DATE] = 2010-07-01 575 - 576 576 a) 2011-07-01 = Friday 577 - 578 578 2011-07-01 + P3D = 2011-07-04 579 - 580 580 [REPORTING_YEAR_BASE] = 2011-07-04 581 - 582 -1. [PERIOD_DURATION] = P7D 583 -1. (36-1) * P7D = P245D 584 - 528 +2. [PERIOD_DURATION] = P7D 529 +3. (36-1) * P7D = P245D 585 585 2011-07-04 + P245D = 2012-03-05 586 - 587 587 [PERIOD_START] = 2012-03-05 588 - 589 589 4. 36 * P7D = P252D 590 - 591 591 2011-07-04 + P252D =2012-03-12 592 - 593 593 2012-03-12 + -P1D = 2012-03-11 594 - 595 595 [PERIOD_END] = 2012-03-11 596 596 597 597 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 598 598 599 -=== =4.2.7 Distinct Range ====539 +=== 4.2.7 Distinct Range === 600 600 601 601 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. 602 602 603 -=== =4.2.8 Time Format ====543 +=== 4.2.8 Time Format === 604 604 605 605 In version 2.0 of SDMX there is a recommendation to use the time format attribute 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 attribute in SDMX-ML. 606 606 607 -|**Code**|**Format** 608 -|**OTP**|Observational Time Period: Superset of all SDMX time formats (Gregorian Time Period, Reporting Time Period, and Time Range) 609 -|**STP**|Standard Time Period: Superset of Gregorian and Reporting Time Periods 610 -|**GTP**|Superset of all Gregorian Time Periods and date-time 611 -|**RTP**|Superset of all Reporting Time Periods 612 -|**TR**|Time Range: Start time and duration (YYYY-MMDD(Thh:mm:ss)?/<duration>) 613 -|**GY**|Gregorian Year (YYYY) 614 -|**GTM**|Gregorian Year Month (YYYY-MM) 615 -|**GD**|Gregorian Day (YYYY-MM-DD) 616 -|**DT**|Distinct Point: date-time (YYYY-MM-DDThh:mm:ss) 617 -|**RY**|Reporting Year (YYYY-A1) 618 -|**RS**|Reporting Semester (YYYY-Ss) 619 -|**RT**|Reporting Trimester (YYYY-Tt) 620 -|**RQ**|Reporting Quarter (YYYY-Qq) 621 -|**RM**|Reporting Month (YYYY-Mmm) 622 -|**Code**|**Format** 623 -|**RW**|Reporting Week (YYYY-Www) 624 -|**RD**|Reporting Day (YYYY-Dddd) 547 +(% style="width:1049.29px" %) 548 +|**Code**|(% style="width:926px" %)**Format** 549 +|**OTP**|(% style="width:926px" %)Observational Time Period: Superset of all SDMX time formats (Gregorian Time Period, Reporting Time Period, and Time Range) 550 +|**STP**|(% style="width:926px" %)Standard Time Period: Superset of Gregorian and Reporting Time Periods 551 +|**GTP**|(% style="width:926px" %)Superset of all Gregorian Time Periods and date-time 552 +|**RTP**|(% style="width:926px" %)Superset of all Reporting Time Periods 553 +|**TR**|(% style="width:926px" %)Time Range: Start time and duration (YYYY-MMDD(Thh:mm:ss)?/<duration>) 554 +|**GY**|(% style="width:926px" %)Gregorian Year (YYYY) 555 +|**GTM**|(% style="width:926px" %)Gregorian Year Month (YYYY-MM) 556 +|**GD**|(% style="width:926px" %)Gregorian Day (YYYY-MM-DD) 557 +|**DT**|(% style="width:926px" %)Distinct Point: date-time (YYYY-MM-DDThh:mm:ss) 558 +|**RY**|(% style="width:926px" %)Reporting Year (YYYY-A1) 559 +|**RS**|(% style="width:926px" %)Reporting Semester (YYYY-Ss) 560 +|**RT**|(% style="width:926px" %)Reporting Trimester (YYYY-Tt) 561 +|**RQ**|(% style="width:926px" %)Reporting Quarter (YYYY-Qq) 562 +|**RM**|(% style="width:926px" %)Reporting Month (YYYY-Mmm) 563 +|**Code**|(% style="width:926px" %)**Format** 564 +|**RW**|(% style="width:926px" %)Reporting Week (YYYY-Www) 565 +|**RD**|(% style="width:926px" %)Reporting Day (YYYY-Dddd) 625 625 626 - 567 +**Table 1: SDMX-ML Time Format Codes** 627 627 628 -=== =4.2.9 Transformation between SDMX-ML and SDMX-EDI ====569 +=== 4.2.9 Transformation between SDMX-ML and SDMX-EDI === 629 629 630 630 When converting SDMX-ML data structure definitions to SDMX-EDI data structure definitions, only the identifier of the time format attribute will be retained. The representation of the attribute will be converted from the SDMX-ML format to the fixed SDMX-EDI code list. If the SDMX-ML data structure definition does not define a time format attribute, then one will be automatically created with the identifier "TIME_FORMAT". 631 631 632 -When converting SDMX-ML data to SDMX-EDI, the source time format attribute will be irrelevant. Since the SDMX-ML time representation types are not ambiguous, the target time format can be determined from the source time value directly. For example, if the SDMX-ML time is 2000-Q2 the SDMX-EDI format will always be 608/708 (depending on whether the target series contains one observation or a range of observations) 573 +When converting SDMX-ML data to SDMX-EDI, the source time format attribute will be irrelevant. Since the SDMX-ML time representation types are not ambiguous, the target time format can be determined from the source time value directly. For example, if the SDMX-ML time is 2000-Q2 the SDMX-EDI format will always be 608/708 (depending on whether the target series contains one observation or a range of observations). 633 633 634 634 When converting a data structure definition originating in SDMX-EDI, the time format attribute should be ignored, as it serves no purpose in SDMX-ML. 635 635 636 636 When converting data from SDMX-EDI to SDMX-ML, the source time format is only necessary to determine the format of the target time value. For example, a source time format 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. 637 637 638 -=== =4.2.10=579 +=== 4.2.10 Time Zones === 639 639 640 640 In alignment with ISO 8601, SDMX allows the specification of a time zone on all time periods 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. 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): 641 641 ... ... @@ -656,7 +656,7 @@ 656 656 657 657 According to ISO 8601, a date without a time-zone is considered "local time". SDMX assumes that local time is that of the sender of the message. In this version of SDMX, 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. 658 658 659 -=== =4.2.11=600 +=== 4.2.11 Representing Time Spans Elsewhere === 660 660 661 661 It has been possible since SDMX 2.0 for a Component to specify a representation of a time span. Depending on the format of the data message, this resulted in either an element with 2 XML attributes for holding the start time and the duration or two separate XML attributes based on the underlying Component identifier. For example if REF_PERIOD were given a representation of time span, then in the Compact data format, it would be represented by two XML attributes; REF_PERIODStartTime (holding the start) and REF_PERIOD (holding the duration). If a new simple type is introduced in the SDMX schemas that can hold ISO 8601 time intervals, then this will no longer be necessary. What was represented as this: 662 662 ... ... @@ -666,30 +666,29 @@ 666 666 667 667 <Series REF_PERIOD="2000-01-01T00:00:00/P2M"/> 668 668 669 -=== =4.2.12=610 +=== 4.2.12 Notes on Formats === 670 670 671 671 There is no ambiguity in these formats so that for any given value of time, the category of the period (and thus the intended time period 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. 672 672 673 -=== =4.2.13=614 +=== 4.2.13 Effect on Time Ranges === 674 674 675 675 All SDMX-ML data messages are capable of functioning in a manner similar to SDMX-EDI if the Dimension at the observation level is time: the time period 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. 676 676 677 -=== =4.2.14 Time in Query Messages ====618 +=== 4.2.14 Time in Query Messages === 678 678 679 679 When querying for time values, the value of a time parameter can be provided as any of the Observational Time Period 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. 680 680 681 681 Fundamental to processing a time value parameter in a query message is understanding that all time periods 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 for requested parameter is encompassed by the time period resulting from value of the query parameter. The following table details how the operators should be interpreted for any time period provided as a parameter. 682 682 683 -|**Operator**|**Rule** 684 -|Greater Than|Any data after the last moment of the period 685 -|Less Than|Any data before the first moment of the period 686 -|Greater Than or Equal To|((( 687 -Any data on or after the first moment of 688 - 689 -the period 624 +(% style="width:1024.29px" %) 625 +|(% style="width:238px" %)**Operator**|(% style="width:782px" %)**Rule** 626 +|(% style="width:238px" %)Greater Than|(% style="width:782px" %)Any data after the last moment of the period 627 +|(% style="width:238px" %)Less Than|(% style="width:782px" %)Any data before the first moment of the period 628 +|(% style="width:238px" %)Greater Than or Equal To|(% style="width:782px" %)((( 629 +Any data on or after the first moment of the period 690 690 ))) 691 -|Less Than or Equal To|Any data on or before the last moment of the period 692 -|Equal To|Any data which falls on or after the first moment of the period and before or on the last moment of the period 631 +|(% style="width:238px" %)Less Than or Equal To|(% style="width:782px" %)Any data on or before the last moment of the period 632 +|(% 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 693 693 694 694 Reporting Time Periods as query parameters are handled based on whether the value of the reportingYearStartDay XML attribute is an explicit month and day or "Any": 695 695