[okfn-labs] JSON table schema + CSV

Paul Walsh paulywalsh at gmail.com
Wed Dec 3 07:46:14 UTC 2014


I’m working on a JSON table schema validator (spec <http://dataprotocols.org/json-table-schema/>). 

My original intention was to port this Node implementation <https://github.com/okfn/json-table-schema-validator> to Python, but on closer inspection, the Node module does not cover enough of the spec, so I’m no longer “porting”, but writing an implementation using that as an existing example of one.

My goal is to fully cover the spec, and my primary use case right now is validating CSV files against JSON table schemas. 

CSV as the data source raises issues with several of the types in the spec whose representation is object or array (object/json, array, geopoint, geojson). I’m not aware of any implementations that handle this (correct me if I’m wrong). 

I see two directions:

1. Don’t try to handle these types when source is CSV (e.g.: A CSV source could not have a field that is type geopoint)
2. Have a spec that describes how implementations MAY parse a CSV field as object or array, pre-validation. Something like:
    * TO_ARRAY (INTRAFIELD_SEPARATOR = '|’), e.g.: value|value|value
    * TO_OBJECT (INTRAFIELD_SEPARATOR = '**', INTRAFIELD_ASSIGNMENT = '='): e.g.: key=value**key=value**key=value

Any thoughts?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/okfn-labs/attachments/20141203/5d6ef5e2/attachment-0003.html>

More information about the okfn-labs mailing list