Skip to content

Commit ee2369a

Browse files
committed
Finished refactoring and resolved TODOs. Also made implementation
agnostic as far as possible.
1 parent e838af6 commit ee2369a

File tree

1 file changed

+22
-15
lines changed

1 file changed

+22
-15
lines changed

csv-schema-1.0.html

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1633,43 +1633,50 @@ <h2>Identifiers</h2>
16331633
<section>
16341634
<h1>Errors and Warnings</h1>
16351635
<p>
1636-
Running the validator will produce a report. First of all the validator checks that the schema itself is syntactically correct. If not, a <a>Schema Error</a> is produced,
1637-
and no validation of the actual data occurs. If the schema check is successful then data validation begins. A report is produced for each <a>Column Validation Expression</a>
1638-
that fails validation. This is generally considered a <a>Validation Error</a>, unless the <a>Warning Directive</a> has been used to convert errors within that
1639-
<a title="Column Rules">Column Rule</a> into a <a>Validation Warning</a>.
1636+
An implementation MUST first check that the provided CSV Schema(s) are syntactically correct. If not, a <a>Schema Error</a> is produced,
1637+
and no further validation SHOULD of the CSV Schema(s) or provided CSV files(s) should be undertaken. If the schema check is successful then an implementation
1638+
MAY continue with further CSV Schema(s) and CSV file validation.</p>
1639+
<p>If an implementation performs validation of a CSV file against a CSV Schema, a report SHOULD be produced for each <a>Column Validation Expression</a>
1640+
that fails validation; This is generally considered a <a>Validation Error</a>, unless the <a>Warning Directive</a> has been used reduce the severity of an error within a specific
1641+
<a title="Column Rules">Column Rule</a> to a <a>Validation Warning</a>.
16401642
</p>
16411643
<section>
16421644
<h2>Schema Errors</h2>
16431645
<p>
1644-
A <dfn>Schema Error</dfn> is caused by syntax errors in the definition of the schema itself. This might be an incorrect <a>Version Declaration</a> or a mismatch between the
1646+
A <dfn>Schema Error</dfn> is caused by syntax errors in the definition of the CSV Schema. These might include for example: an incorrect <a>Version Declaration</a>, or a mismatch between the
16451647
number specified for <a>Total Columns Directive</a> and the actual number of <a title="Column Definition">Column Definitions</a> given in the <a>Body</a> of the Schema.
16461648
Schema Errors would also be produced by mismatched <a title="Parenthesized Expression">Parenthesized Expressions</a>,
16471649
unrecognised <a title="Column Validation Expression">Column Validation Expressions</a> and <a title="Explicit Context Expression">Explicit Context Expressions</a> which do not
16481650
match an actual <a>Column Identifier</a>.
16491651
</p>
16501652
<p>
1651-
The Schema Error will be logged in the output report, and execution will terminate without attempting to validate the data against the schema.
1653+
An implementation MUST report a Schema Error.
16521654
</p>
16531655
</section>
16541656
<section>
16551657
<h2>Validation Errors</h2>
16561658
<p>
1657-
If column data does not validate successfully against a <a title="Column Rules">Column Rule</a> a <dfn>Validation Error</dfn> will be produced and logged in the output report.
1658-
In general a Validation Error does not terminate execution, all data will be processed, and all errors logged. When Validation Errors have been encountered the validator will
1659-
give a non-zero return code TODO specify. The <a>Warning Directive</a> may be used within a Column Rule to specify that what would normally be a Validation Error should be
1659+
If column data does not validate successfully against a <a title="Column Rules">Column Rule</a>, an implementation SHOULD report a <dfn>Validation Error</dfn>.
1660+
It is implementation defined whether a Validation Error terminates execution, or whether execution continues. If execution continues, any further errors SHOULD be reported.</p>
1661+
<p><b>NOTE</b> The <a>Warning Directive</a> may be used within a Column Rule to specify that what would normally be a Validation Error should be
16601662
treated only as a <a>Validation Warning</a>.
16611663
</p>
16621664
<p>
16631665
A <dfn>Validation Warning</dfn> can be used when you wish to highlight unexpected values that are encountered in the data, but for some reason they are not to be considered
1664-
failures of validation. For example within archival documents the date has been recorded as an "impossible" date such as 30 February or 31 April. A transcriber has correctly
1665-
entered the data as seen on the original document, but it is not a valid date. You may wish to highlight these cases for additional QA, but it cannot be considered an error.
1666+
failures of validation. For example within archival documents the date may have been recorded as an <em>impossible</em> date, such as 30 February or 31 April. A transcriber has correctly
1667+
entered the data as seen on the original document, but yet it is not a valid date. You may wish to highlight these cases for additional QA, but it should not be considered an error.
16661668
</p>
16671669
</section>
16681670
</section>
1669-
1670-
TODO a note on file uri handling on different platforms etc!
1671-
TODO a note on mime-type and file-naming .csvs
1672-
1671+
<section class="appendix">
1672+
<h2>The text/csv-schema Media Type</h2>
1673+
<p>This Appendix specifies the media type for CSV Schema Version 1.0. CSV Schema is a language for describing and validating CSV files, as specified in the main body of this document. This media type has being submitted to the IESG (Internet Engineering Steering Group) for review, approval, and registration with IANA (Internet Assigned Numbers Authority.)</p>
1674+
<p>The <code>text/csv-schema</code> media type, is intended to be used for transmitting schemas written in the CSV Schema language.</p>
1675+
<section>
1676+
<h3>File Extensions</h3>
1677+
<p>The suggested file extension for use when naming CSV Schema files is <code>.csvs</code>.</p>
1678+
</section>
1679+
</section>
16731680
<section class="appendix">
16741681
<h2>CSV Schema Grammar</h2>
16751682
<section id="ebnf">

0 commit comments

Comments
 (0)