Custom check: time intervals

Problem

Some datasets contain time intervals or period such as 2018-01-16/2018-04-20. It would be useful to be able to constrain their values, for example to be sure that the first date comes before the second date or that both are actual time values.

Context

Time intervals are specified in ISO 8601: https://en.wikipedia.org/wiki/ISO_8601#Time_intervals

Table Schema specs use ISO 8601 for time field types but haven't implemented time intervals (yet?): https://specs.frictionlessdata.io/table-schema/#time

Custom checks can be written for Validata using underlying frictionless-py features:

Ideas

  • Add a time interval / period field type in Table Schema
  • Using a library which implements ISO 8601 time interval to create a custom check