-
Notifications
You must be signed in to change notification settings - Fork 120
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
Exclusive minimum and maximum values are not supported as numeric constraints #856
Exclusive minimum and maximum values are not supported as numeric constraints #856
Comments
I had a similar use case, where I want to indicate that the width of a bounding box can be close 0, but not 0. As you describe, I solved this by providing a very small number with an arbitrary fine precision: "minimum": 1e-15 # same as 0.000000000000001 While two new properties |
Thanks for the feedback. Perhaps this can be revisited in V2, which was recently opened for discussion? Because the addition of exclusiveMinimum and exclusiveMaximum as constraints would create better alignment with |
To clarify my earlier comments Dec 11 and Dec 23. JSON Draft 4 and OAS Schema properties exclusiveMinimum and exclusiveMaximum are Boolean types. A default value of FALSE indicates inclusive minimum and inclusive maximum, respectively, preserves the V1 interpretation. In contrast, A value of TRUE specifies that minimum and maximum are interpreted as exclusive minimum and inclusive maximum, respectively. |
@roll the accepted #11 implementation adds I personally think this is a good implementation, but it differs from what @rjgladish proposes in #856 (comment), where those fields are boolean types that affect the behaviour of |
@peterdesmet
So basically we just stick to the current JSON Schema version (as Table Schema inherits a lot from there) |
In version 1 of Frictionless Tabular Schema , numeric constraints are limited to closed intervals, i.e. [,], [minimum,], [,maximum], or [minimum, maximum].
However, some observational measurement limits are best expressed as minimum and maximum values that approach a limit.
E.g. minimum temperature measurements should be greater than absolute zero
(0,] Kelvin,
(−273.15,] °C,
(−459.67,] °F
Absent closed interval support, limits must be approximated using arbitrary finite precision, such as 0.000000000001 K, -273.149999999999 °C, and so on. Also, Frictionless min/max constraints that corresponding to SQL "greater than" or "less than" checks get messy. Although this workaround is mostly adequate for integer min/mix, it's messy.
The addition of two optional constraint properties to express open minimum and maximum intervals with exclusive values with permit schema to describe closed interval constraint conditions [minimumEx,], [,maximumEx], and [minimumEx,maximumEx], and half-open intervals, e.g. (minimum, maximumEx], [minimumEx, maximum)
Since it would be optional, it would minimally impact older software, but it would require a new schema.
On the negative side, software that is unaware of exclusive constraints only look for inclusive constraints.
The text was updated successfully, but these errors were encountered: