-
Notifications
You must be signed in to change notification settings - Fork 33
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
Validation expression for floating point numbers? #6
Comments
There isn't at present (nor had it been slated for inclusion in 1.1 which is just being worked on). However, I did just realise today that we may have a forthcoming project for which it would be useful. |
I forgot yesterday that the Range Expression takes a Numeric Literal, which allows decimals. No expression allows exponent (aka scientific) notification however. In CSV Schema 1.0 range must have both and upper and lower bound, in the forthcoming CSV Schema 1.1 you will be able to specify only a lower, or only an upper bound. Similar to the Length Expression, the end of the range that is not to be bounded will be represented by an asterisk, ie range(20.5,) would indicate that the value in that column must be at least 20.5, while range(,20.5) would indicate that the column value must be at most 20.5. |
@DavidUnderdown Thank you for your answers. I like the extension of the range expression. |
Looking over the full EBNF, we have a Positive Integer Expression, and a PositiveIntegerLiteral: but while we have a Numeric literal there is no Numeric Expression to allow a simple check that a column holds a real number expressed as a decimal. Range will take such values, so the Numeric Expression would be useful to allow a check that the data is of the correct type before trying the range (or we may want to have the range when it is numeric, and some other check, such as is("N/A") when the column has a non-numeric value). I'll see if we can get this in to 1.1 |
Sorry, we didn't get this into 1.1, but hopefully using range covers most of the necessary functionality. I'll leave this open for now. |
I'm looking for this as well. Best way currently to use a regexp? (e.g. |
That, or use of range as described above |
Thx @DavidUnderdown for confirming. |
Is there a way to describe that a column contains plain floating point numbers (except by using a regex pattern)? There is a
positiveInteger
validation expression so I would expect that there is also something likedecimal
ordouble
but could not find it.Thank you
The text was updated successfully, but these errors were encountered: