-
Notifications
You must be signed in to change notification settings - Fork 109
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow datasets to specify HED versions or individual files as validation schema #1015
Allow datasets to specify HED versions or individual files as validation schema #1015
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @happy5214. I'll leave a full review of this to @rwblair ... and we should also probably wait with merging this until the PR bids-standard/bids-specification#527 is merged.
But I'll leave a few comments:
- You need to update https://github.com/bids-standard/bids-validator/blob/master/bids-validator/validators/json/schemas/dataset_description.json so that it includes
HEDVersion
- in [ENH] Add the ability of users to specify an explicit HED.xml schema for validation. bids-specification#527 we are discussing that
HEDVersion
should be a recommended field. So perhaps it'd be nice to make BIDS-validator warn users if they are using HED tags ... but not supplying anHEDVersion
field. - I think we should have a very basic example dataset with HED tags in https://github.com/bids-standard/bids-examples/ ... it could be as simple as a single subject single session EEG ... with HED tags in the events.json. One idea could be to update https://github.com/bids-standard/bids-examples/tree/master/eeg_matchingpennies which is a very basic example.
edit: tagging @VisLab for attention
- Add warning issue for missing HEDVersion field. - Add field to JSON schema.
The issues listed have been addressed (or will be after bids-standard/bids-examples#191 is merged). I left in the local schema code for now, but I can remove it if anyone has a strong opinion on that. |
Is this waiting on the example dataset? That will probably take a while to finish, so perhaps we should merge this first. |
It'd be cool to give @rwblair some more time to review this - and I think bids-standard/bids-specification#527 should be merged first once discussion is done over there. |
} | ||
|
||
// run HED validator | ||
return hedValidator.buildSchema(schemaDefinition).then(hedSchema => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with leaving in the local schema ability, can we add a catch statement on this promise chain? If HEDVersion
is not a semantic version and the file doesn't exist it produces an uncaught error. I think generating a new issue here would be good. I figure most end users will have mistyped the semantic version rather than be trying to use their own schema.
I think the catch is also good in case the hed validator ever rejects its promise during build schema for whatever reason: https://github.com/hed-standard/hed-javascript/blob/f9674dfc6a18ec068260559b6d485b6ca61d0298/validators/schema.js#L374
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I didn't realize that I had left this unsubmitted @happy5214 I'm going to go ahead and fix the merge conflict and merge this, and create a new issue for my concern here.
… hed-schema-specification
…validator into hed-schema-specification
closes #942
This implements the changes proposed in bids-standard/bids-specification#527 to allow datasets to specify their HED schema version, or a specific schema file in sourcedata/, to run HED validation against. I have tested both ways with a sample dataset.