CSV on the Web validator according to the W3C recommendations. Validate your CSV files with associated metadata files and download the results in multiple formats (CSV,RDF)! We provide the full functionality with regards to the integration tests: https://w3c.github.io/csvw/tests/#manifest-validation More about W3C recommendations: https://www.w3.org/TR/tabular-data-primer/
$ dotnet add package CSVW-validator-libWelcome to Validate IT - your solution for validating CSV tabular data and metadata, adhering to CSV on the Web recommendations.
Features:
You can check all types of documentation (user, developer, administrator) here.
You can also check the main repository of this project.
You can find the main repository of the code base here.
// Create controller
IController controller = ControllerFactory.CreateController();
string remoteMetadataURL = "https://w3c.github.io/csvw/tests/test011/tree-ops.csv-metadata.json";
string remoteTabularURL = "https://w3c.github.io/csvw/tests/test011/tree-ops.csv";
string localMetadaPath = @"/data/my.csv";
string localTabularPath = @"/data/schema.json";
// starts remote tabular validation
IResult result1 = controller.ProcessTabularData(remoteTabularURL);
// start local tabular validation
IResult result2 = controller.ProcessTabularData(localTabularPath);
// start remote metadata validation
IResult result3 = controller.ProcessMetadata(remoteMetadataURL);
// start local metadata validation
IResult result4 = controller.ProcessMetadata(localMetadaPath);
// review validation result
switch (result1.GetValidationResultType)
{
case ValidationResultType.VALID:
Console.WriteLine("Validated files were valid!");
break;
case ValidationResultType.WARNING:
Console.WriteLine("Warnings occurred during the validation!");
break;
case ValidationResultType.ERROR:
Console.WriteLine("Errors occurred during the validaiton!");
break;
}
// iterate through general errors
foreach (var error in result1.GetValidationDetails.GeneralErrors)
{
Console.WriteLine(error.GetMessage(CultureInfo.CurrentCulture));
}
// foreach errors related to specific table
foreach(var tableDetails in result1.GetValidationDetails.TableValidationDetails)
{
foreach(var error in tableDetails.Errors)
{
Console.WriteLine(error.GetMessage(CultureInfo.CurrentCulture));
}
}
// write the results to a file
string resultPath = @"/data/result.csv";
IResultWriter csvResultWriter = ResultWriterFactory.CreateResultWriter(ResultFileFormat.CSV);
csvResultWriter.GenerateResult(resultPath, result1.GetValidationDetails);
This is student bachelor thesis project and we do not MAKE ANY PROFIT as it is fully open-source project.