Skip to content
This repository has been archived by the owner on May 28, 2024. It is now read-only.

Support validating a CSV file against a simple JSON schema #142

Closed
4 tasks done
ldodds opened this issue Feb 3, 2014 · 3 comments
Closed
4 tasks done

Support validating a CSV file against a simple JSON schema #142

ldodds opened this issue Feb 3, 2014 · 3 comments

Comments

@ldodds
Copy link
Collaborator

ldodds commented Feb 3, 2014

Allow a CSV file to be validated against a single JSON schema that describes the structure of the CSV.

Initially we should base this on JSON Table Schema, with some of the validation extension described here

There are several parts to this:

  • Generic field validation -- presence, length, pattern
  • Type mapping -- mapping to fixed set of datatypes (integer, float, URI, boolean), with errors if the values don't map
  • Date formatting mappings -- xsd:date, xsd:dateTime, xsd:time, xsd:year, others?
  • Type specific validation, e.g. minimum and maximum for date and number ranges

For the type mapping we can support a type key in the field definition which is an XML Schema URI. Initially we should aim to support integers, floats, URIs, date, date-time. To parse dates we can read a strftime format in a datePattern key.

@ldodds
Copy link
Collaborator Author

ldodds commented Feb 11, 2014

Other items to support:

  • support a unique constraint to check whether values in a column should be unique
  • add error/warnings if there are fewer columns in the data, than the schema
  • add error/warnings if there are more columns in the data, than the schema
  • if there are fewer columns in the data than in the schema, ensure we apply the validations from the missing columns, treating the column as empty. (Currently the code just skips the columns)
  • if there's a header in the data then check column names match the schema

@JeniT
Copy link
Member

JeniT commented Feb 11, 2014

Are we supporting optional columns?

@ldodds
Copy link
Collaborator Author

ldodds commented Feb 11, 2014

If something is not required and has no min length it should pass

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants