Skip to content
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

Update temporal tag error name #567

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
6 changes: 3 additions & 3 deletions docs/source/03_HED_formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -883,7 +883,7 @@ In addition to its anchor, the `Inset` tag group may contain a single additional
tag group with additional information about that marked point.
An event of temporal extent may contain several of these intermediate points.

See [**ONSET_OFFSET_INSET_ERROR**](./Appendix_B.md#onset_offset_inset_error) and
See [**TEMPORAL_TAG_ERROR**](./Appendix_B.md#temporaltagerror) and
IanCa marked this conversation as resolved.
Show resolved Hide resolved
[**TAG_GROUP_ERROR**](./Appendix_B.md#tag_group_error) and
for a listing of specific errors associated with onsets, and offsets, and insets.

Expand Down Expand Up @@ -1182,7 +1182,7 @@ Definitions many not appear in the `HED` column of a tabular file or
in any entry of a JSON sidecar that contains items other than definitions.

See [**DEFINITION_INVALID**](./Appendix_B.md#definition_invalid)
and [**ONSET_OFFSET_INSET_ERROR**](./Appendix_B.md#onset_offset_inset_error) for information.
and [**TEMPORAL_TAG_ERROR**](./Appendix_B.md#temporaltagerror) for information.
IanCa marked this conversation as resolved.
Show resolved Hide resolved


#### 3.2.10.3. Event-level processing
Expand Down Expand Up @@ -1263,7 +1263,7 @@ The validator must also check to make sure that `Onset` and `Offset` tags are
properly matched within the data recording.
In particular every `Offset` tag group must correspond to a preceding `Onset` tag group.

See [**ONSET_OFFSET_INSET_ERROR**](./Appendix_B.md#onset_offset_inset_error) for details on the
See [**TEMPORAL_TAG_ERROR**](./Appendix_B.md#temporaltagerror) for details on the
IanCa marked this conversation as resolved.
Show resolved Hide resolved
type of errors that are generated due to `Onset` and `Offset` errors.


Expand Down
2 changes: 1 addition & 1 deletion docs/source/06_Infrastructure_and_tools.md
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ matched.

**Tabular files that do not represent timelines are not permitted to use
`Onset`, `Inset`, and `Offset` tags in their annotations.**
See [**ONSET_OFFSET_INSET_ERROR**](./Appendix_B.md#onset_offset_inset_error)
See [**TEMPORAL_TAG_ERROR**](./Appendix_B.md#temporaltagerror)
IanCa marked this conversation as resolved.
Show resolved Hide resolved
for additional information.

The following shows an excerpt from a BIDS event file:
Expand Down
65 changes: 34 additions & 31 deletions docs/source/Appendix_B.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,36 +123,6 @@ about the `deprecatedFrom` schema attribute.

See [**3.2.3 Tag forms**](./03_HED_formats.md#322-tag-forms) for more information.

### ONSET_OFFSET_INSET_ERROR

Note: For the purpose of `Onset`/`Offset` matching, `Def` or `Def-expand` tags with
different placeholder substitutions are considered to be different.

**a.** An `Onset` or `Offset` tag does not appear in a tag group.
**b.** An `Onset` or `Offset` tag appears in a nested tag group (not a top-level tag group).
**c.** An `Onset` or `Offset` tag is not grouped with exactly one `Def` tag or `Def-expand` group.
**d.** An `Onset` or an `Inset` tag group contains more than one additional tag group.
**e.** An `Offset` appears with one or more tags or additional tag groups.
**f.** An `Offset` tag appears before an `Onset` tag associated with the same definition.
**g.** An `Offset` tag associated with a given definition appears after a previous `Offset` tag.
without the appearance of an intervening `Onset` of the same name.
**h.** An `Onset` or an `Inset` tag group with has tags besides the anchor `Def` tag or `Def-expand` group
that are not in a tag group.
**i.** An `Onset` or `Offset` with a given `Def` tag or `Def-expand` group anchor
appears in an event marker with the same time as with another `Onset`, `Inset`, or `Offset`
that uses the same anchor.
**j.** An `Inset` tag is not grouped with a `Def` tag or a `Def-expand` group corresponding to an ongoing `Onset`.
**k.** An `Onset`, `Inset`, or `Offset` tag appears in an annotation for a non-time tabular file.

**Note:** if the `Onset` tag group's definition is in expanded form,
the `Def-expand` will be an additional internal tag group.

See [**3.2.8.3 Onset, Offset, and Inset**](./03_HED_formats.md#3283-onset-offset-and-inset)
for a specification of the required behavior of the `Onset`, `Offset`, and `Inset` tags.

[**5.3.1. Using Onset and Offset**](./05_Advanced_annotation.md#531-using-onset-and-offset)
in Chapter 5 gives examples of usage and additional details.

### PARENTHESES_MISMATCH

**a.** A HED string does not have the same number of open and closed parentheses.
Expand Down Expand Up @@ -271,7 +241,7 @@ for additional information on the tag extension rules.

**a.** A tag has `tagGroup` or `topLevelTagGroup` attribute, but is not enclosed in parentheses.
**b.** A tag with the `topLevelTagGroup` does not appear at a HED tag group at the top level in an assembled HED annotation.
**c.** Multiple tags with the `topLevelTagGroup` attribute appear in the same top-level tag group.
**c.** Multiple tags with the `topLevelTagGroup` attribute appear in the same top-level tag group.(note: Duration and Delay may be paired)
IanCa marked this conversation as resolved.
Show resolved Hide resolved

See [**3.2.7.2. Tag group attributes**](./03_HED_formats.md#3272-tag-group-attributes)
for additional information on the rules for group errors due to schema attributes.
Expand Down Expand Up @@ -306,6 +276,39 @@ additional information on the `unique` tag.
See [**3.2.4. Tags that take values**](03_HED_formats.md#324-tags-that-take-values)
for an explanation of the `requireChild` attribute.

### TEMPORAL_TAG_ERROR

Note: For the purpose of `Onset`/`Offset` matching, `Def` or `Def-expand` tags with
different placeholder substitutions are considered to be different.

**a.** An `Offset`, `Onset`, `Inset`, `Duration`, or `Delay` tag does not appear in a tag group.
**b.** An `Offset`, `Onset`, `Inset`, `Duration`, or `Delay` tag appears in a nested tag group (not a top-level tag group).
**c.** An `Onset`, `Offset` or `Inset` tag is not grouped with exactly one `Def` tag or `Def-expand` group.
**d.** An `Onset`, `Inset`, `Duration`, or `Delay` tag group contains more than one additional tag group.
**e.** An `Offset` appears with one or more tags or additional tag groups.
**f.** An `Offset` tag appears before an `Onset` tag associated with the same definition.
**g.** An `Offset` tag associated with a given definition appears after a previous `Offset` tag.
without the appearance of an intervening `Onset` of the same name.
**h.** An `Onset` or an `Inset` tag group with has tags besides the anchor `Def` tag or `Def-expand` group
that are not in a tag group.
**i.** An `Onset` or `Offset` with a given `Def` tag or `Def-expand` group anchor
appears in an event marker with the same time as with another `Onset`, `Inset`, or `Offset`
that uses the same anchor.
**j.** An `Inset` tag is not grouped with a `Def` tag or a `Def-expand` group corresponding to an ongoing `Onset`.
**k.** An `Onset`, `Inset`, or `Offset` tag appears in an annotation for a non-time tabular file.
**l.** A `Duration` or `Delay` tag group contains extra tags or groups, or is missing the required group.
**m.** An `Offset`, `Onset`, `Inset`, `Duration`, or `Delay` tag appears with other top level tags, except
Delay and Duration which can be paired
IanCa marked this conversation as resolved.
Show resolved Hide resolved

**Note:** if the `Onset` tag group's definition is in expanded form,
the `Def-expand` will be an additional internal tag group.

See [**3.2.8.3 Onset, Offset, and Inset**](./03_HED_formats.md#3283-onset-offset-and-inset)
for a specification of the required behavior of the `Onset`, `Offset`, and `Inset` tags.

[**5.3.1. Using Onset and Offset**](./05_Advanced_annotation.md#531-using-onset-and-offset)
in Chapter 5 gives examples of usage and additional details.

### TILDES_UNSUPPORTED

The tilde notation is not supported.
Expand Down
2 changes: 1 addition & 1 deletion tests/hed_error_codes.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"DEFINITION_INVALID",
"ELEMENT_DEPRECATED",
"NODE_NAME_EMPTY",
"ONSET_OFFSET_INSET_ERROR",
"TEMPORAL_TAG_ERROR",
"PARENTHESES_MISMATCH",
"PLACEHOLDER_INVALID",
"REQUIRED_TAG_MISSING",
Expand Down
29 changes: 18 additions & 11 deletions tests/json_tests/TAG_GROUP_ERROR.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,22 @@
"error_code": "TAG_GROUP_ERROR",
"name": "tag-group-error-missing",
"description": "A tag has tagGroup or topLevelTagGroup attribute, but is not enclosed in parentheses.",
"schema": "8.1.0",
"schema": "8.2.0",
"definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"],
"tests": {
"string_tests": {
"fails": [
"Definition, (Red)",
"Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)",
"Onset"
"Onset",
"Duration/3.0 s",
"Delay/3.0 s"
],
"passes": [
"(Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red))",
"((Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)), Onset)"
"((Def-expand/Acc/4.5 m-per-s^2, (Acceleration/4.5 m-per-s^2, Red)), Onset)",
"(Duration/3.0 s, (Event))",
"(Duration/3.0 s, Delay/2.0 s, (Event))"
]
},
"sidecar_tests":{
Expand Down Expand Up @@ -66,7 +70,7 @@
}
}
},
"events":
"events":
[
["onset", "duration", "event_code","HED"],
[ 4.5, 0, "face", "Red, Def/MyColor"],
Expand All @@ -84,7 +88,7 @@
}
}
},
"events":
"events":
[
["onset", "duration", "event_code","HED"],
[ 4.5, 0, "face", "Blue"],
Expand All @@ -99,7 +103,7 @@
"error_code": "TAG_GROUP_ERROR",
"name": "tag-group-error-not-top-level",
"description": "A tag with the topLevelTagGroup does not appear at a HED tag group at the top level in an assembled HED annotation.",
"schema": "8.1.0",
"schema": "8.2.0",
"definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"],
"tests": {
"string_tests": {
Expand Down Expand Up @@ -131,7 +135,7 @@
}
}
},
"events":
"events":
[
["onset", "duration", "event_code","HED"],
[ 4.5, 0, "face", "Red, Def/MyColor"],
Expand All @@ -149,7 +153,7 @@
}
}
},
"events":
"events":
[
["onset", "duration", "event_code","HED"],
[ 4.5, 0, "face", "Blue"],
Expand All @@ -164,16 +168,19 @@
"error_code": "TAG_GROUP_ERROR",
"name": "multiple-top-level-tags-in-same-group",
"description": "Multiple tags with the topLevelTagGroup attribute appear in the same top-level tag group. (Delay and Duration are allowed to be in the same topLevelTagGroup).",
"schema": "8.1.0",
"schema": "8.2.0",
"definitions": ["(Definition/Acc/#, (Acceleration/#, Red))", "(Definition/MyColor, (Label/Pie))"],
"tests": {
"string_tests": {
"fails": [
"(Def/MyColor, Onset, Event-context)",
"(Event-context, Red, Offset)"
"(Event-context, Red, Offset)",
"(Event-context, Duration/3.0 s, Offset)",
"(Delay/3.0 s, Duration/2.0 s, Offset)"
],
"passes": [
"(Def/MyColor, Onset)"
"(Def/MyColor, Onset)",
"((Event), Duration/3.0 s, Delay/2.0 s)"
]
},
"sidecar_tests": {
Expand Down
Loading