Uploaded image for project: 'OASIS Open Data Protocol (OData) TC'
  1. OASIS Open Data Protocol (OData) TC
  2. ODATA-1394

Add full-fledged support for ISO 8601-1 duration

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Vocabularies
    • Labels:
      None
    • Environment:

      Proposed

    • Proposal:
      Hide

      Similar to Core.LocalDateTime add a new type definition based on Edm.String.

      Core.YearMonthDayDuration is a duration in years, months, and days that can be used to describe regularly recurring calendar events. Services MAY support arithmetic operations on Core.YearMonthDayDuration values and with Edm.Date values and MAY describe this via the term Capabilities.YearMonthDayDurationSupport.

      Show
      Similar to Core.LocalDateTime add a new type definition based on Edm.String . Core.YearMonthDayDuration is a duration in years, months, and days that can be used to describe regularly recurring calendar events. Services MAY support arithmetic operations on Core.YearMonthDayDuration values and with Edm.Date values and MAY describe this via the term Capabilities.YearMonthDayDurationSupport .

      Description

      Next version of OData [protocol |https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html] should support full-fledged duration for Edm.Duration .

      The [ABNF|https://docs.oasis-open.org/odata/odata/v4.01/os/abnf/odata-abnf-construction-rules.txt] today states duration value is

         [ SIGN ] "P" [ 1*DIGIT "D" ] [ "T" [ 1*DIGIT "H" ] [ 1*DIGIT "M" ] [ 1*DIGIT [ "." 1*DIGIT ] "S" ] ]
      i.e. no years or month as defined by W3C's XML dayTimeDuration.

      In contrast, ISO 8601-1 2019  5.5.2.2 allows to specify Years and Months.

      There are well understood libraries that do support the notion of ISO 8601-1, for example Joda's Period class https://www.joda.org/joda-time/key_period.html

      To notion of weeks or month as a duration makes it possible to model calendar recurrence patterns in a less custom way.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              chrispre Christof Sprenger
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: