NeurodataWithoutBorders / nwbinspector

Tool to help inspect NWB files for compliance with NWB Best Practices
https://nwbinspector.readthedocs.io/
Other
17 stars 10 forks source link

[Feature]: Describe check functions with a general schema language #357

Open garrettmflynn opened 1 year ago

garrettmflynn commented 1 year ago

What would you like to see added to the NWBInspector?

To allow for consistent cross-language validation, it would be useful if it was possible for the checks implemented by the NWB Inspector to be specified using some JSON (or other) schema language.

According to @CodyCBakerPhD, this has been a request from a handful of other people in the NWB ecosystem. Particularly for me, this would be useful to implement a JavaScript validator used alongside webnwb to support client-side validation using a web interface.

From previous discussions about this issue, it sounded like it there would be some difficulties encoding some of the Python logic into a general schema language.

Do you have any interest in helping implement the feature?

Yes.

Code of Conduct

bendichter commented 1 year ago

Some of this is already done, e.g.

https://github.com/catalystneuro/neuroconv/blob/23a1fbba0d149beb6258ea59b0fbef8e732850df/src/neuroconv/schemas/base_metadata_schema.json#L147-L150

CodyCBakerPhD commented 1 year ago

Yeah checks with simple regex patterns and no false positive skip conditions are easy to translate to JSON

The problem is with the more intricate checks that rely on HDF5 links, Python class inheritance, or complex conditional logic for skipping false positives

bendichter commented 1 year ago

Yes, declarative JSON has its limits.