Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/derivatives/atlas.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,14 @@ corresponding to the atlas or atlases in the structure.
Atlas metadata fields:

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/json
The definitions of these fields can be found in
src/schema/objects/metadata.yaml
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
-->
{{ MACROS___make_json_table('dataset_metadata.atlas_description') }}
{{ MACROS___make_json_table('json.atlas.atlas_description') }}

Example `atlas-MyAtlas2025_description.json`:

Expand Down
4 changes: 0 additions & 4 deletions src/metaschema.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,6 @@
"type": "array",
"items": { "type": "string" }
},
"dataset_metadata": {
"type": "object"
},
"directories": {
"type": "object"
},
Expand Down Expand Up @@ -513,7 +510,6 @@
"tabular_data",
"metaentities",
"common_principles",
"dataset_metadata",
"directories",
"errors",
"modalities"
Expand Down
4 changes: 3 additions & 1 deletion src/modality-agnostic-files/dataset-description.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,14 @@ A guide for using macros can be found at
Every dataset MUST include this file with the following fields:

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/json
The definitions of these fields can be found in
src/schema/objects/metadata.yaml
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
-->
{{ MACROS___make_json_table('dataset_metadata.dataset_description') }}
{{ MACROS___make_json_table('json.dataset.dataset_description') }}

Each object in the `GeneratedBy` array includes the following REQUIRED, RECOMMENDED
and OPTIONAL keys:
Expand Down
8 changes: 4 additions & 4 deletions src/modality-specific-files/electroencephalography.md
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ General fields:

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/sidecars
src/schema/rules/json
The definitions of the fields specified in these tables may be found in
src/schema/objects/metadata.yaml
A guide for using macros can be found at
Expand All @@ -396,7 +396,7 @@ Fields relating to the EEG electrode positions:

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/sidecars
src/schema/rules/json
The definitions of the fields specified in these tables may be found in
src/schema/objects/metadata.yaml
A guide for using macros can be found at
Expand All @@ -408,7 +408,7 @@ Fields relating to the position of fiducials measured during an EEG session/run:

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/sidecars
src/schema/rules/json
The definitions of the fields specified in these tables may be found in
src/schema/objects/metadata.yaml
A guide for using macros can be found at
Expand All @@ -420,7 +420,7 @@ Fields relating to the position of anatomical landmark measured during an EEG se

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/sidecars
src/schema/rules/json
The definitions of the fields specified in these tables may be found in
src/schema/objects/metadata.yaml
A guide for using macros can be found at
Expand Down
2 changes: 1 addition & 1 deletion src/modality-specific-files/electromyography.md
Original file line number Diff line number Diff line change
Expand Up @@ -533,7 +533,7 @@ Fields relating to the EMG coordinate system(s):

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/sidecars
src/schema/rules/json
The definitions of the fields specified in these tables may be found in
src/schema/objects/metadata.yaml
A guide for using macros can be found at
Expand Down
13 changes: 3 additions & 10 deletions src/modality-specific-files/genetic-descriptor.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,21 +94,14 @@ A guide for using macros can be found at
{{ MACROS___render_text("objects.files.genetic_info.description") }}

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/json
The definitions of these fields can be found in
src/schema/objects/metadata.yaml
and a guide for using macros can be found at
https://github.com/bids-standard/bids-specification/blob/master/macros_doc.md
-->
{{ MACROS___make_metadata_table(
{
"GeneticLevel": "REQUIRED",
"AnalyticalApproach": "OPTIONAL",
"SampleOrigin": "REQUIRED",
"TissueOrigin": "OPTIONAL",
"BrainLocation": "OPTIONAL",
"CellType": "OPTIONAL",
}
) }}
{{ MACROS___make_json_table("json.genetics.genetic_info") }}

To ensure dataset description consistency, we recommend following [Multi-omics approaches to disease](https://genomebiology.biomedcentral.com/articles/10.1186/s13059-017-1215-1) by Hasin et al. 2017 to determine the `GeneticLevel:`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ General fields:

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/sidecars
src/schema/rules/json
The definitions of the fields specified in these tables may be found in
src/schema/objects/metadata.yaml
A guide for using macros can be found at
Expand All @@ -395,7 +395,7 @@ Fields relating to the iEEG electrode positions:

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/sidecars
src/schema/rules/json
The definitions of the fields specified in these tables may be found in
src/schema/objects/metadata.yaml
A guide for using macros can be found at
Expand Down
12 changes: 6 additions & 6 deletions src/modality-specific-files/magnetoencephalography.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ MEG and EEG sensors:

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/sidecars
src/schema/rules/json
The definitions of the fields specified in these tables may be found in
src/schema/objects/metadata.yaml
A guide for using macros can be found at
Expand All @@ -349,7 +349,7 @@ Head localization coils:

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/sidecars
src/schema/rules/json
The definitions of the fields specified in these tables may be found in
src/schema/objects/metadata.yaml
A guide for using macros can be found at
Expand All @@ -361,7 +361,7 @@ Digitized head points:

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/sidecars
src/schema/rules/json
The definitions of the fields specified in these tables may be found in
src/schema/objects/metadata.yaml
A guide for using macros can be found at
Expand All @@ -373,7 +373,7 @@ Anatomical MRI:

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/sidecars
src/schema/rules/json
The definitions of the fields specified in these tables may be found in
src/schema/objects/metadata.yaml
A guide for using macros can be found at
Expand All @@ -385,7 +385,7 @@ Anatomical landmarks:

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/sidecars
src/schema/rules/json
The definitions of the fields specified in these tables may be found in
src/schema/objects/metadata.yaml
A guide for using macros can be found at
Expand Down Expand Up @@ -413,7 +413,7 @@ Fiducials information:

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/sidecars
src/schema/rules/json
The definitions of the fields specified in these tables may be found in
src/schema/objects/metadata.yaml
A guide for using macros can be found at
Expand Down
8 changes: 4 additions & 4 deletions src/modality-specific-files/near-infrared-spectroscopy.md
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ General fields:

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/sidecars
src/schema/rules/json
The definitions of the fields specified in these tables may be found in
src/schema/objects/metadata.yaml
A guide for using macros can be found at
Expand All @@ -400,7 +400,7 @@ Fields relating to the NIRS optode positions:

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/sidecars
src/schema/rules/json
The definitions of the fields specified in these tables may be found in
src/schema/objects/metadata.yaml
A guide for using macros can be found at
Expand All @@ -413,7 +413,7 @@ Fields relating to the position of fiducials measured during an NIRS session/run

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/sidecars
src/schema/rules/json
The definitions of the fields specified in these tables may be found in
src/schema/objects/metadata.yaml
A guide for using macros can be found at
Expand All @@ -426,7 +426,7 @@ Fields relating to the position of anatomical landmarks measured during an NIRS

<!-- This block generates a metadata table.
These tables are defined in
src/schema/rules/sidecars
src/schema/rules/json
The definitions of the fields specified in these tables may be found in
src/schema/objects/metadata.yaml
A guide for using macros can be found at
Expand Down
14 changes: 8 additions & 6 deletions src/schema/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -873,9 +873,9 @@ meg_meg_common:
description: optional
```

### Sidecar and tabular data rules
### JSON and tabular data rules

Tabular data and JSON sidecar files follow a similar pattern:
Tabular data and JSON files follow a similar pattern:

| | Name | Value |
| ---- | ------------- | ------------- |
Expand Down Expand Up @@ -937,7 +937,7 @@ rule is applied.

#### Valid fields for definitions

1. `rules.sidecars.*`
1. `rules.sidecars.*` and `rules.json.*`

| Field | Description |
| ----------- | -------------------------------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -984,6 +984,11 @@ MRIFuncVolumeTiming:
An additional check will be required to assert that both are not present,
but these tables may be combined for rendering purposes.

`rules.json.*` and `rules.sidecars.*` are essentially identical,
except `rules.json` rules describe the contents of individual JSON files,
while `rules.sidecars` rules describe the contents of sidecar files,
accumulated by the inheritance principle.

Here we present an example rule in `rules.tabular_data.eeg`:

```YAML
Expand Down Expand Up @@ -1058,9 +1063,6 @@ EventsMissing:
| ----------- | ------------------------------------- |
| `datatypes` | List of datatypes mapping to modality |

- `rules.dataset_metadata` - These are similar to `rules.sidecars.*`, for JSON files at the root level.
This is likely to go away in favor of other approaches.

- `rules.errors` - This file describes errors that cannot be expressed in the schema. This provides common
codes and language that implementing validators can use to ensure the same problems are reported to
users in the same way.
Expand Down
2 changes: 1 addition & 1 deletion src/schema/SCHEMA_VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.0-dev
2.0.0-dev
19 changes: 19 additions & 0 deletions src/schema/rules/json/atlas.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
atlas_description:
selectors:
- suffix == 'description'
- extension == '.json'
- entities.atlas
fields:
AtlasName: required
License: required
Description: recommended
Authors: recommended
Curators: optional
Funding: optional
ReferencesAndLinks: optional
Species: optional
AtlasSampleSize: optional
DerivedFrom: optional
LevelType: optional
RRID: optional
Original file line number Diff line number Diff line change
Expand Up @@ -44,40 +44,3 @@ derivative_description:
- json.DatasetType == "derivative"
fields:
GeneratedBy: required

dataset_description_with_genetics:
selectors:
- path == "/dataset_description.json"
- exists('genetic_info.json', 'dataset')
fields:
Genetics: required

genetic_info:
selectors:
- path == "/genetic_info.json"
fields:
GeneticLevel: required
SampleOrigin: required
AnalyticalApproach: optional
TissueOrigin: optional
BrainLocation: optional
CellType: optional

atlas_description:
selectors:
- suffix == 'description'
- extension == '.json'
- entities.atlas
fields:
AtlasName: required
License: required
Description: recommended
Authors: recommended
Curators: optional
Funding: optional
ReferencesAndLinks: optional
Species: optional
AtlasSampleSize: optional
DerivedFrom: optional
LevelType: optional
RRID: optional
18 changes: 18 additions & 0 deletions src/schema/rules/json/genetics.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
genetic_info:
selectors:
- path == "/genetic_info.json"
fields:
GeneticLevel: required
SampleOrigin: required
AnalyticalApproach: optional
TissueOrigin: optional
BrainLocation: optional
CellType: optional

dataset_description_with_genetics:
selectors:
- path == "/dataset_description.json"
- exists('genetic_info.json', 'dataset')
fields:
Genetics: required
2 changes: 1 addition & 1 deletion tools/schemacode/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ exclude_also = [
# uvx bump-my-version bump <patch|minor|major>
# git push upstream <current-branch>
[tool.bumpversion]
current_version = "1.3.0-dev"
current_version = "2.0.0-dev"
parse = """(?x)
(?P<major>[0-9]+)
\\.(?P<minor>[0-9]+)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def test_selectors(schema_obj):
# For directories of files, need to look three down
for rules, level in (
(schema_obj.rules.checks, 3),
(schema_obj.rules.dataset_metadata, 2),
(schema_obj.rules.json, 3),
(schema_obj.rules.sidecars, 3),
(schema_obj.rules.tabular_data, 3),
(schema_obj.rules.errors, 2),
Expand Down
Loading