W3C home > Mailing lists > Public > public-csv-wg@w3.org > June 2015

Conditions when validators raise errors

From: Gregg Kellogg <gregg@greggkellogg.net>
Date: Thu, 18 Jun 2015 13:43:27 -0700
Message-Id: <9E314FCE-562F-45F7-AB88-2B58AA29143E@greggkellogg.net>
To: W3C CSV on the Web Working Group <public-csv-wg@w3.org>
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
Received on Thursday, 18 June 2015 20:43:58 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 18 June 2015 20:43:59 UTC