Skip to content

Commit 3aaec8d

Browse files
authored
Merge pull request #233 from effigies/faq
doc: Add FAQ
2 parents 9d927ee + a6ab0dc commit 3aaec8d

File tree

3 files changed

+161
-0
lines changed

3 files changed

+161
-0
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
<!--
2+
A new scriv changelog fragment.
3+
4+
Uncomment the section that is right (remove the HTML comment wrapper).
5+
For top level release notes, leave all the headers commented out.
6+
-->
7+
8+
### Added
9+
10+
- Added a [FAQ] to the user guide. ([#215])
11+
12+
[FAQ]: https://bids-validator.readthedocs.io/en/latest/user_guide/faq.html
13+
[#215]: https://github.com/bids-standard/bids-validator/issues/215
14+
15+
<!--
16+
### Changed
17+
18+
- A bullet item for the Changed category.
19+
20+
-->
21+
<!--
22+
### Fixed
23+
24+
- A bullet item for the Fixed category.
25+
26+
-->
27+
<!--
28+
### Deprecated
29+
30+
- A bullet item for the Deprecated category.
31+
32+
-->
33+
<!--
34+
### Removed
35+
36+
- A bullet item for the Removed category.
37+
38+
-->
39+
<!--
40+
### Security
41+
42+
- A bullet item for the Security category.
43+
44+
-->
45+
<!--
46+
### Infrastructure
47+
48+
- A bullet item for the Infrastructure category.
49+
50+
-->

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ deno run -A jsr:@bids/validator
3333
user_guide/web.md
3434
user_guide/command-line.md
3535
user_guide/issues.md
36+
user_guide/faq.md
3637
```
3738

3839
```{toctree}

docs/user_guide/faq.md

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
# Frequently Asked Questions
2+
3+
This page is for questions about the Javascript validator that may not be
4+
well addressed elsewhere in the documentation.
5+
6+
If you have a question, please [open an issue][new-issue].
7+
The answer may end up on this page!
8+
9+
## Q: What does the validator actually check?
10+
11+
The BIDS Validator aspires to check that a dataset meets the requirements of the BIDS Standard.
12+
The primary way it does this is by interpreting the [BIDS Schema][schema-description].
13+
14+
The general categories of rules include:
15+
16+
- Filename rules: These rules indicate valid combinations of [entities][], [suffixes][definitions]
17+
[datatypes][definitions] and [extensions][definitions].
18+
Every file in a dataset must match a filename rule.
19+
- Sidecar and JSON rules: These rules indicate whether fields are REQUIRED, RECOMMENDED
20+
or OPTIONAL in a JSON file.
21+
REQUIRED fields produce errors on absence, while RECOMMENDED fields produce warnings on absence.
22+
If the field is defined, then it also has a type (for example, numeric or textual);
23+
type mismatches produce errors.
24+
- Tabular data rules: These rules indicate what columns are REQUIRED, RECOMMENDED or OPTIONAL
25+
in a TSV file, and behave similarly to sidecar rules.
26+
Additionally, tabular file rules may indicate that columns must appear in a certain order or
27+
have unique values, and that additional columns are permitted or forbidden.
28+
If JSON sidecar files provide definitions for columns,
29+
the values in those columns are validated against those definitions.
30+
- Checks: These rules are conditional assertions, with the form of selectors and checks.
31+
Selectors are expressions that determine whether the rule applies to the file or dataset,
32+
and checks are expressions about the file or dataset that must evaluate to `true`.
33+
34+
## Q: Why doesn't the validator warn/error about inconsistencies in some TSV columns?
35+
36+
A specific question we've received is why the validator does not ensure that a
37+
column like `sex` in `participants.tsv` will permit both `f` and `F`,
38+
rather than enforce consistency.
39+
40+
The reason for this is that `sex` (like `age`) is not rigorously defined by the BIDS Standard,
41+
but is provided as an example with a default definition.
42+
Default definitions are loose and often accept a wide range of values that would be
43+
understandable by humans while still allowing some amount of machine validation.
44+
As of BIDS 1.10.0, the definition of `sex` in the schema is:
45+
46+
```json
47+
{
48+
"sex": {
49+
"LongName": "sex",
50+
"Description": "String value indicating phenotypical sex.",
51+
"Levels": {
52+
"F": "Female",
53+
"FEMALE": "Female",
54+
"Female": "Female",
55+
"f": "Female",
56+
"female": "Female",
57+
"M": "Male",
58+
"MALE": "Male",
59+
"Male": "Male",
60+
"m": "Male",
61+
"male": "Male",
62+
"O": "Other",
63+
"OTHER": "Other",
64+
"Other": "Other",
65+
"o": "Other",
66+
"other": "Other"
67+
}
68+
}
69+
}
70+
```
71+
72+
Data curators are encouraged to refine this definition in their `participants.json` sidecar file,
73+
for example, if you use the SNOMEDCT ontology:
74+
75+
```json
76+
{
77+
"sex": {
78+
"LongName": "sex",
79+
"Description": "Finding related to biological sex",
80+
"TermURL": "http://purl.bioontology.org/ontology/SNOMEDCT/429019009",
81+
"Levels": {
82+
"F": {
83+
"Description": "Female",
84+
"TermURL": "http://purl.bioontology.org/ontology/SNOMEDCT/248152002",
85+
},
86+
"M": {
87+
"Description": "Male",
88+
"TermURL": "http://purl.bioontology.org/ontology/SNOMEDCT/248153007",
89+
},
90+
"I": {
91+
"Description": "Intersex",
92+
"TermURL": "http://purl.bioontology.org/ontology/SNOMEDCT/32570691000036108",
93+
},
94+
"X": {
95+
"Description": "Indeterminate sex",
96+
"TermURL": "http://purl.bioontology.org/ontology/SNOMEDCT/32570681000036106",
97+
}
98+
}
99+
}
100+
}
101+
```
102+
103+
If provided, the validator will check that all values in the column are `F`, `M`, `I`, `X`,
104+
or `n/a` (which is permitted in all columns, according to the BIDS Standard).
105+
106+
107+
[new-issue]: https://github.com/bids-standard/bids-validator/issues/new
108+
[schema-description]: https://bidsschematools.readthedocs.io/en/latest/description.html
109+
[entities]: https://bids-specification.readthedocs.io/en/stable/common-principles.html#entities
110+
[definitions]: https://bids-specification.readthedocs.io/en/stable/common-principles.html#definitions

0 commit comments

Comments
 (0)