digital-preservation / csv-schema

CSV Schema
http://digital-preservation.github.io/csv-schema
Mozilla Public License 2.0
100 stars 33 forks source link

repeat rules (within a single column) #14

Open DavidUnderdown opened 7 years ago

DavidUnderdown commented 7 years ago

We specify in the Scanning and Transcription Framework that some fields could potentially be a list of uuids (of "related" images, either where an image of a double page spread is split into two single pages, or where a very large master has to be imaged as a set of "tiles" of the original). At present this can only be done using regex, it would be simpler if there was a uuidList test in CSV Schema Language 1.2, which would test for a comma-separated list of uuids ie uuid1,uuid2,...uuidn

adamretter commented 7 years ago

@DavidUnderdown I think it would be better to generalise this, so that you can have other repeating rules also. For example how about something like:

repeat(1, *, uuid)

The first argument would be the minimum (0 to n), the second argument would be the maximum (0+n to *), and the third argument would be an expression. Multiple expressions could be used as the third argument by placing them in brackets.

For an exact number of repeats, you could just set the minimum and maximum to the same values.

DavidUnderdown commented 7 years ago

Good thinking batman - renamed issue to reflect this