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

Implement CorrespondingRangeExpr - additional validation expression

Open DavidUnderdown opened this issue 9 years ago • 0 comments

In several digitisation projects we have come across the situation where it is required that there is a simple correspondence between two ranges. For example, a set of files is numbered in its originating department in some straightforward number range, when we accession those files into an existing series we cannot use that exact number range due to material within the series already having those numbers, but we do know that eg file numbers 1, 2, 3,...,100 should correspond to pieces 384,385,386,...,483. There is currently no simple way to validate the precise correspondence between the two ranges, though each could be checked independently to verify that each is with the desired range ie:

file_number: range(1,100) piece: range(384,483)

could each be satisfied with file_number = 1 and piece = 375, which is not what we actually want.

whereas something like:

file_number: correspondingRange(1,100,$piece,384,483)

would make the correspondence explicit.

There might be situations where some sort of interleaving was desirable, so optionally being able to specify a step size might be useful eg

file_number: correspondingRange(1,100,$piece,384,483,2)

would mean that file_numbers would correspond 1,2,3,...,100 to pieces 384,386,388,...,582 (meanwhile another 100 files would be assigned to the odd numbered pieces).

DavidUnderdown avatar May 16 '16 16:05 DavidUnderdown