csv-schema icon indicating copy to clipboard operation
csv-schema copied to clipboard

Clarification: @optional means full, empty, or partially full?

Open mhGLEIF opened this issue 7 years ago • 2 comments

Another trivial clarification, I'm afraid 🙁

I am using @optional currently in a csvs to mean a column may hold one of

  • any of the allowed values defined for that column (in all cells)
  • any of the allowed values defined for that column (in some of the cells with the rest empty)
  • no values (totally empty column, just a header and n blank cells)

Is that the intended meaning? It seems to be from the way the validator works?

It's not totally clear to me from the doc if a partially empty column is OK:

http://digital-preservation.github.io/csv-schema/csv-schema-1.1.html#column-definitions-examples

Is there a different directive for this?

mhGLEIF avatar Jan 03 '19 12:01 mhGLEIF

Testing is always row-by-row, so yes a partially empty column would be fine - @optional is effectively equivalent to adding "or empty" to your column test.

I see if I can think of some clearer wording.

DavidUnderdown avatar Jan 03 '19 15:01 DavidUnderdown

Thanks for clarifying. So "column" is shorthand for "the cell in this column in this row". As I surmised.

mhGLEIF avatar Jan 04 '19 08:01 mhGLEIF