-
Notifications
You must be signed in to change notification settings - Fork 46
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should we allow fuzzy dates and use of ISO8601 notation for durationInDays #723
Comments
There is a blog post at https://www.open-contracting.org/2018/06/08/territory-map-storing-sharing-open-contracting-data/ which explores some aspects of modelling dates in OCDS and design principles that have been applied to date. |
I've just read your post. Was wondering if you've considered optionally using the format attribute, using same as for duration, we can keep Just bouncing some ideas. |
Thanks @mpostelnicu: useful reflections. Whilst I can see specifying a format working quite nicely in XML idiom (value and attributes), it feels less familiar/easy to model in JSON. It also does place more burden on the user to process data more heavily before use for the common use case of comparing dates etc. On duration though, I like the idea of a backwards compatible |
In the Open Contracts Prishtina platform there is a 'contract year' field, populated as follows:
Relaxing date validation to permit just |
The French essential procurement data standard specifies the contract length in months. So far, to convert the data to OCDS, we multiply number of months by 30.5. |
In EU eForms, periods of time are expressed in straight days, months or years. Examples: <cbc:DurationMeasure unitCode="DAY">150</cbc:DurationMeasure>
<cbc:DurationMeasure unitCode="MONTH">6</cbc:DurationMeasure>
<cbc:DurationMeasure unitCode="YEAR">4</cbc:DurationMeasure> Mapping this data to OCDS requires multiplying the months by 30 and the years by 365. Over long periods of time (e.g concessions of 50 years), a period converted this way can be off by a week. |
Should this issue be in the 1.2.0 strict milestone given that it's about relaxing validation requirements and/or adding new fields? |
I probably meant to add it to 1.2 and misclicked. |
@odscjen @duncandewhurst In your work with the EU eForms mapping, have you seen anything that changes the direction of this issue - to relax validation for date fields, and add an ISO 8601 formatted |
Nope. In eForms, dates are expressed in ISO8601 format and durations as described in #723 (comment). |
So far this issue has gathered the following demand:
@jpmckinney based on the 'two publishers rule of thumb', I think that we leave relaxing date validation for now. I think that we can leave ISO8601 durations too, since the current workarounds don't seem to be causing any problems. Sound good? |
I agree that a plain year is semantically different from a date in the case provided, where the year is more like a unit of aggregation. (For dates far in the past, the year might be the only known value, but we aren't dealing with such uncertainty.) For duration, ultimately, any analysis will presumably want to compare apples to apples and therefore convert the values to a common unit, which is probably going to be "day". (Indeed, ease of use is the point of the linked blog post.) Also, in practice, I don't think buyers are setting durations of e.g. "3 years" and expecting the contract to end at the precise offset, including leap days (and leap seconds). So, I think multiplying by 365 for years is fine. There are 30.416̅ days in an average month, but I think multiplying by 30 is also fine (and avoids having to round the product), because buyers aren't trying to be that precise when setting durations in months. Since the issue was not created based on external demand, and since the demand remains largely theoretical, I'll close. |
This issue is for discussion of possible changes that could be made in future versions of OCDS to the handling of dates. We want to identify if there are use cases that would benefit from this, and how it would impact users and applications.
The current situation and future considerations
Dates and times
Whenever OCDS includes a date, we ask for a full ISO
date-time
consisting of:I.e. Year, Month, Day, Hour, Minutes, Seconds and Timezone
This means that if a source system only has a date recorded, it has to set a time and timezone.
This was based on the understanding that in general:
However, this does mean that OCDS may not always fully represent what is in a source system, such that if a source system has only a date, the addition of a time when generating OCDS data is adding information that was not in the source. This may provide a justification for relaxing our validation of date fields to allow simply
YYYY-MM-DD
in future.Duration in Days
OCDS 1.1 introduced the
durationInDays
field to thePeriod
object to accommodate cases where the length of a period is known, but the exactstartDate
orendDate
are not, or are not specified.A question has been raised of whether the 'days' requirement is expressive enough, and whether the full ISO 8601 durations syntax could be supported
This would allow expression of concepts such as 'Two Months', which, when an actual
startDate
orendDate
is known, can be expanded to exact number of days, rather than the fuzzy number of days expressed with a duration given initially in days (which has to make assumptions about the average length of a month).Questions for input
We would welcome input on use cases from either publishers or data users that need (a) fuzzy dates; (b) complex durations.
We would welcome reflections on whether there are backwards compatible changes that can be made here to accommodate any such use cases.
The text was updated successfully, but these errors were encountered: