Skip to content

nasa/DCATUS-Validator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DCAT-US JSON Schema Validation Script

This script validates a JSON file against the DCAT-US Schema (v1) and outputs any validation errors in a validation-errors.json file.

Usage

Install dependencies:

npm install

Run the script by providing the path to the JSON file you want to validate:

node validate-dcat.js {input-file-path}

Example:

node validate-dcat.js ./data/dcat-file.json

Output

  • If the file is valid: A success message will be logged, and no errors will be written.
  • If the file is invalid: The script will log the errors, and a validation-errors.json file will be generated containing the following structure:
{
  "isValid": false,
  "amount": "<number_of_errors>",
  "errors": [
    {
      "dataPath": "<path_to_invalid_data>",
      "message": "<error_message>",
      "datasetIdentifier": "<dataset_identifier_if_applicable>"
    }
  ]
}

Notes

  • Updated GSA DCAT-US Schema to draft-07 from draft-04 to keep inline with GSA's schema.
  • Did not keep validation for "REDACTED" values.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published