hed-validator v4.0.0
NOTE: This was inadvertently released to NPM as version 5.0.0 due to a typo in the package.json
. That release has been pulled. Please use this release instead.
This fourth major version of hed-validator is a substantial rewrite of the code and interface. It provides feature-completeness, including full compliance with the current version of the HED-3G specification. Support for earlier generations of HED and syntax-only validation has been removed.
Previous versions did not properly implement definition or temporal tag validation. This version completely reimplements the validation code, fixing these and other bugs. The validator now fails as soon as it finds an error, rather than trying to return all errors. This reduces spurious errors that make no sense.
Reliability is now assured by overlapping sets of testcases. The original JavaScript-based tests were completely rewritten to use JSON-based datasets and templated scripts, while the specification itself also provides a rich set of JSON-based tests, shared with the Python-based HED validator, that ensures conformance with the HED-3G standard.
API
The API has been completely remodeled and greatly reduced compared to version 3 of this validator. The original APIs, which allowed direct access to the validator's parsing, schema-loading, and validation code, have been removed entirely. The API to validate entire BIDS datasets at once has also been removed, due to issues that arose when validating large BIDS datasets using that model.
The version 4.0.0 API only supports validating BIDS-format files, specifically JSON and TSV files. The API is as follows:
BidsSidecar
- JSON sidecarsBidsJsonFile
- Non-sidecar JSON filesBidsTsvFile
- TSV filesBidsHedIssue
- The generated issues returned from the validator, type-compatible with the BIDSIssue
type.buildBidsSchemas(datasetDescription)
- Anasync
function which returns aSchemas
object (this type is not part of the public API and should be treated as opaque).datasetDescription
is aBidsJsonFile
object representingdataset_description.json
.
The constructors of BidsSidecar
and BidsJsonFile
take three arguments as part of the public API:
- The name of the file.
- An object representing the file itself.
- The parsed contents of the JSON file in object form.
The constructor of BidsTsvFile
takes four arguments as part of the public API:
- The name of the file.
- An object representing the file itself.
- The parsed contents of the TSV file (preferably as either a string of the entire file contents, or as a
Map
, with the column names as keys and the column values in an array as values). - (Optional) The merged sidecar contents in object form.
The constructor of BidsHedIssue
should not be called from external code. buildBidsSchemas()
may throw IssueError
objects (another opaque internal type), which should be passed, along with the file object of the dataset_description.json
BidsJsonFile
, to the static method BidsHedIssue.fromHedIssues()
, which will return an array of BidsHedIssue
objects. This is a bug in the interface that will be fixed in a future release.
Validation is performed by calling the BidsFile.validate(schemas)
method on any file object (BidsSidecar
, BidsJsonFile
, and BidsTsvFile
are all subclasses of BidsFile
), passing the Schemas
object returned by buildBidsSchemas()
. This method returns an array of BidsHedIssue
objects corresponding to the validation issues found.
Further changes to the API may be considered in a future release.
What's Changed
- Updated the config to include score 2.0.0 by @VisLab in #204
- Added develop branch to github ci action by @VisLab in #207
- Rewrite of tokenizer and introduction of object-based test cases by @VisLab in #208
- Working on separating the data from the tests by @VisLab in #209
- Reorganized the tests, eliminating internal log by @VisLab in #210
- General cleanup of schemas and schema parsing by @happy5214 in #211
- Update tokenizer -- removed extra delimiter tests in parser by @VisLab in #212
- Update tokenizer to handle (, x by @VisLab in #213
- Remove HED 2 support and reorganize code by @happy5214 in #216
- Updating of the tests by @VisLab in #215
- Added additional tests to bidsTests.spec by @VisLab in #217
- Started on the parsedHedTag tests by @VisLab in #218
- First pass at the update of the hed tag parsing by @VisLab in #219
- Rewrote jsonTests to eliminate the local log and simplify by @VisLab in #220
- Minor cleanup and change of bids/validator class names back by @VisLab in #221
- First pass at pulling unit validation down to tag level by @VisLab in #222
- First pass at value class validation in ParsedHedTag by @VisLab in #223
- Next pass at refactoring -- eliminating redundancies in validator section by @VisLab in #224
- Updated the validator -- now ready to work on definitions by @VisLab in #225
- Progressing on validation of special tags using a JSON specification of properties by @VisLab in #226
- Update tokenizer with more checks for special tags in sting parser by @VisLab in #227
- Refactored special and added more tests by @VisLab in #228
- Revised validator by @VisLab in #234
- Removal of unused portions of code by @VisLab in #235
- Added the spec-tests to the coverage by @VisLab in #236
- Added handling of duplicates across onset rows by @VisLab in #237
- Corrected handling of delay with temporal tag by @VisLab in #238
- Duration should be allowed in files without timeline by @VisLab in #239
- Updated action to correct code-climate complaint by @VisLab in #240
- Simplified the group checking and added separate definition syntax ch… by @VisLab in #243
- Create and use setters for private fields in SchemaTag by @happy5214 in #241
- revised the docs -- first pass by @VisLab in #245
- Second pass at fixing the readthedocs errors by @VisLab in #246
- Additional corrections of jsDoc for readthedocs by @VisLab in #247
- Delete unused RegexClass class by @happy5214 in #244
- Reorganized the source code under src/ by @VisLab in #248
- Removed sphinx-js because of security violations by @VisLab in #249
- Remove "sphinx" dev dependency by @happy5214 in #250
- Move issues to top level of src/ by @happy5214 in #251
- Delete last two skipped tests (in HED utility tests) by @happy5214 in #252
- Add Dependabot configuration by @happy5214 in #254
- Bump typedoc from 0.25.13 to 0.27.6 by @dependabot in #255
- Bump husky from 9.0.11 to 9.1.7 by @dependabot in #256
- Bump cross-fetch from 4.0.0 to 4.1.0 by @dependabot in #259
- Bump eslint-config-prettier from 9.1.0 to 10.0.1 by @dependabot in #258
- Bump semver from 7.6.0 to 7.6.3 by @dependabot in #257
- Bump unicode-name from 1.0.2 to 1.0.4 by @dependabot in #262
- Bump eslint-plugin-prettier from 5.1.3 to 5.2.3 by @dependabot in #263
- Bump date-fns from 3.6.0 to 4.1.0 by @dependabot in #264
- Bump typescript from 5.4.5 to 5.7.3 by @dependabot in #260
- Bump eslint from 8.22.0 to 9.18.0 by @dependabot in #261
- Bump date-and-time from 3.1.1 to 3.6.0 by @dependabot in #265
- Bump esbuild from 0.20.2 to 0.24.2 by @dependabot in #267
- Bump prettier from 3.2.5 to 3.4.2 by @dependabot in #266
- Ignore chai major version updates in Dependabot config by @happy5214 in #269
- Fix ESLint conf by @happy5214 in #271
- Bump chai from 4.3.6 to 4.5.0 by @dependabot in #270
- Fixed the date-time value issue confused with namespace by @VisLab in #272
- Bump eslint from 9.18.0 to 9.19.0 by @dependabot in #273
- Bump @eslint/js from 9.18.0 to 9.19.0 by @dependabot in #274
- Add JSON spec tests as separate GitHub action by @happy5214 in #275
- Updated the spec tests to handle version with multiple schemas by @VisLab in #276
- Bump semver from 7.6.3 to 7.7.0 by @dependabot in #277
- Removed BidsDataset and dependencies. by @VisLab in #279
- Bump typedoc from 0.27.6 to 0.27.7 by @dependabot in #280
- Bump eslint from 9.19.0 to 9.20.0 by @dependabot in #281
- Bump prettier from 3.4.2 to 3.5.0 by @dependabot in #282
- Bump esbuild from 0.24.2 to 0.25.0 by @dependabot in #284
- Walk-through -- changed order of parameters in files by @VisLab in #285
- Revamp issue handling by @happy5214 in #287
- Updated the error codes by @VisLab in #288
- Bump semver from 7.7.0 to 7.7.1 by @dependabot in #289
- Bump globals from 15.14.0 to 15.15.0 by @dependabot in #290
- Bump prettier from 3.5.0 to 3.5.1 by @dependabot in #291
- Bump eslint from 9.20.0 to 9.20.1 by @dependabot in #292
- Restructured reporting of errors in validators to support both errors and warnings by @VisLab in #293
- Now handles tag deprecated and extension warnings by @VisLab in #294
- Now handles warnings for missing SIDECAR keys by @VisLab in #295
- Bump @eslint/eslintrc from 3.2.0 to 3.3.0 by @dependabot in #296
- Bump typedoc from 0.27.7 to 0.27.8 by @dependabot in #297
- Bump prettier from 3.5.1 to 3.5.2 by @dependabot in #298
- Bump eslint from 9.20.1 to 9.21.0 by @dependabot in #300
- Finalize API and fix compatibility with BIDS by @happy5214 in #301
- Updated the schema data by @VisLab in #302
- A bunch of changes in preparation for the release of v4.0.0 by @happy5214 in #303
- Bump eslint-config-prettier from 10.0.1 to 10.0.2 by @dependabot in #304
- Bump prettier from 3.5.2 to 3.5.3 by @dependabot in #307
- Bump typedoc from 0.27.8 to 0.27.9 by @dependabot in #306
- Bump typescript from 5.7.3 to 5.8.2 by @dependabot in #305
- Bump globals from 15.15.0 to 16.0.0 by @dependabot in #308
- Update husky configuration by @happy5214 in #309
- Last-minute changes to BIDS modules before major release by @happy5214 in #310
- Move special issue parameters to static Map variable by @happy5214 in #311
- Version 4.0.0 by @happy5214 in #312
Full Changelog: v3.15.5...v4.0.0