General information about validation
Validation types
The validation has 3 types:
- Tabular validation - this validation begins from the csv file and tries to locate associated metadata as defined in Metadata-localization.
- Metadata validation - this validation begins from the metadata file and then validates all the csv files referenced from this metadata file.
- Overriding validation - this is combination of both previous cases. If the validator is provided with both
metadata file
and alsotabular data files
it will not continue to locate any metadata for tabular data files and moreover it will override the references in metadata file table descriptors (property url) to the IRIs of thetabular data files
you have provided in the exact same order you provided.
Overriding example
Lets consider we have a metadata file called countries.json
with following content:
{
"@context": "http://www.w3.org/ns/csvw",
"tables": [{
"url": "countries.csv"
}, {
"url": "country_slice.csv",
}]
}
So firstly, if you want to process such metadata file as overriding you need to provide correct number of tabular data files. In case metadata file
containing table descriptor you need to provide on tabular data file, in case of containing table group descriptor you need to provide same number tabular data files
as there are tables descriptors in the property tables
of the table group descriptor.
In this case you need to provide exactly 2 tabular data files
. Lets say they are called overriding1.csv
and overriding2.csv
and are located at the same location as the countries.json
.
So when you start the overriding validation the validator will override the references like this:
{
"@context": "http://www.w3.org/ns/csvw",
"tables": [{
"url": "overriding1.csv"
}, {
"url": "overriding2.csv",
}]
}
and continue validating as if starting from metadataFile with the contain as above.
This can be useful if you want to quickly validate multiple csv files against one schema but do not want to rewrite the references in metadata file
.
For more info about metadata localization you can read the documentation here.