Using an invalid column reference as a string provider does not produce a helpful error message
If a column expression uses an invalid column reference as a string provider the CSV Validator returns a Java null pointer exception, rather than an error message that explains that the column reference is invalid. eg if there is resource_uri column then doing in($resource_uri) in another column doesn't produce a useful error message, so it can be very hard to track down the problem in the schema (should this be checked when the schema is parsed?). Should also check what happens if this was used in an explicit context expression
A big omission from the CSV Schema spec is error conditions. Ideally there should be a code defined in the spec for each class of error, if you did that, we could implement that. The W3C XPath and XQuery specs are a useful example of a spec which defines error codes.
we define broadly the concept of schema errors v validation errors (and warnings), though admittedly this type of column name reference error is not included in the examples given for schema errors.
I can look at at least tightening those definitions up a little for 1.2
On a related note, if an incorrect column reference is used within a concat, this does not produce a Java null pointer exception, but the test simply fails. As the error report does not show the values from the referenced columns it can be hard to work out where there is an error as manually comparing the columns it is difficult to see why the concatenated value does not match as expected.
This is actually probably a duplicate to #118
I'm seeing 'invalid cross reference' as the error given. This seems pretty good to me?
Though I do also get the unhelpful message described when using concat...
That generally seems OK, but would be good to fix in the case of concat too
https://github.com/digital-preservation/csv-validator/pull/362