Conditions when validators raise errors

I’m just adding the last tests for Foreign Keys, and am going over possible errors. My interpretation is the following:

* All processors MUST halt if a if an error is raised when processing a Metadata document, or the Metadata document is invalid. (Note, a Metadata document may have recoverable errors, which generate warnings, but is still valid for the purposes of allowing a converter to continue using it).

* All processors MUST halt if the metadata is incompatible with a starting CSV, or now CSV if found as referenced from metadata.

* Warnings are raised for cell values not matching their datatype, and the error is noted in the Cell model.

* Validators MUST raise an error on Primary or Foreign Key violations or for cell errors (which are otherwise warnings).

This leaves the case where warnings are generated when processing a Metadata document (e.g., the value of `titles` isn’t a string, and is ignored). Tests currently treat this as a WarningValidationTest which do not expect an error to be raised, but warnings to be generated. However, strictly speaking, this makes the Metadata invalid (even though useable for generating JSON/RDF), and so perhaps should consider changing this to a NegativeValidationTests, where an error should be raised.

The simplest way for a processor to handle this is for a collect both warnings and errors, then if validating, raise an error if either warnings or errors is not empty. But, this should be clarified here, and in the spec.

Gregg Kellogg
gregg@greggkellogg.net

Received on Thursday, 18 June 2015 20:43:58 UTC