SDMX Users Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Author Topic: startTime in generic format and conversion to other data formats  (Read 6885 times)

Duraid Abbas - UNESCO IS

  • Newbie
  • *
  • Posts: 6
    • View Profile
startTime in generic format and conversion to other data formats
« on: February 18, 2010, 07:42:47 AM »

Hi,

In version 2.0 The ValueType and ObsValueType in SDMXGenericData.xsd both have the attribute startTime which is used for Timespan. However, I'm not sure how the value of this attribute is treated upon conversion to other data formats.

For example the compact format uses xml attributes to store values and thus can only have one place for a given value.

Unfortunately non of the samples uses a value of type timespan. It would be useful to include that in future samples just to see how it works.

Thanks,

Duraid
« Last Edit: February 18, 2010, 07:45:50 AM by Duraid Abbas - UNESCO IS »
Logged
Re: startTime in generic format and conversion to other data formats
« Reply #1 on: March 12, 2010, 05:14:32 AM »

Hi Duraid -

This is certainly meant to be handled. Line 4309 of part 03A in the specification states:

"Timespan: This is a complex datatype, requiring both a startDate expressed as an xs:dateTime and a duration, expressed as an xs:duration type in the generated schemas. Depending on which type of generated schema is being discussed, these two fields will be either XML attributes or XML elements in the generated schema.
Note that Timespan may not be used as the representation of a key value (that is, as the representation of a dimension)."


The treatment of this in the compact format is not described (although it should be). There are two attributes created - one for the duration of the span (the actual component value) and one for the start time. For example, if you primary measure (OBS_VALUE) was defined as being a timespan, you would have an OBS_VALUE(xs:duration) attribute and an OBS_VALUEStartTime (common:TimePeriodType) attribute.

In reviewing the schema generation XSLTs distributed in the SDMX tools - this seems to be accounted for in the various formats. However is does not appear to be accounted for in the transformations of the data messages. This should be corrected and a bug will be filed.
Logged

Duraid Abbas - UNESCO IS

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: startTime in generic format and conversion to other data formats
« Reply #2 on: March 12, 2010, 10:56:05 AM »

Thank you J.

I see now. But it's certainly not the most consistent or elegant to have since all other value types can be represented in one string except of the timespan. This, of course, also complicates the design of APIs.

It would be nice to find a way to represent timespan in one string; maybe something similar to PeriodType. Don't you think so?

Thanks
Logged