I am rewriting and publishing an existing dataset as a Data Package (https://gitlab.com/ezwelty/glathida), and it includes decimal place limits on several numeric fields. For now, I have enforced this using a pattern constraint:
"pattern": "^\\-?[0-9]*(\\.[0-9]{0,7})?$"
Unfortunately, this practice violates the schema, which currently insists that pattern only apply to post-cast values of string fields (#428). I understand the complexity that is avoided by the decision, but also regret the huge potential for specificity that is lost. I wish pattern was applied to the field values as stored in the text file (csv, json, or otherwise).
Otherwise, I see no other option than adding a specific decimal place constraint for number fields.
I am rewriting and publishing an existing dataset as a Data Package (https://gitlab.com/ezwelty/glathida), and it includes decimal place limits on several numeric fields. For now, I have enforced this using a
patternconstraint:Unfortunately, this practice violates the schema, which currently insists that
patternonly apply to post-cast values ofstringfields (#428). I understand the complexity that is avoided by the decision, but also regret the huge potential for specificity that is lost. I wishpatternwas applied to the field values as stored in the text file (csv, json, or otherwise).Otherwise, I see no other option than adding a specific decimal place constraint for
numberfields.