bids-validator
bids-validator copied to clipboard
Populate context data
Context objects have a variety of properties referenced in schema rules via selectors/checks. We need functions that produce the these objects organized as outlined in https://github.com/bids-standard/bids-specification/blob/master/src/schema/meta/context.yaml. Some like path and entities are being populated as the contexts are created. The following are not and will need to be serialized from files:
- [ ] sidecar
- [ ] associations
- [ ] columns
- [x] json
- [ ] nifti_header
The dataset and subjects properties will be populated when the functions to generate summary data is implemented.
For associations we'll need to add something like this to the schema: https://github.com/bids-standard/bids-specification/issues/1047#issuecomment-1086654227
Reviewing the associations they only ones directly accessed are expecting json/tsv. But the associated json/tsv can have their own data files that would need to be asserted to exist at some point. (Don't think schema has any rules saying what kinds of metadata files are disallowed without a corresponding data file.)
If we parsed entity/suffix/extension in the initial fileTree load and exposed them through BIDSFileDeno we could load the existing associations and their data in the Context constructor.
Associations are currently being loaded synchronously on context loading.