B. HED errors

This appendix summarizes the error codes used by HED validators and other tools.

HED-compliant tools may assume that it if a HED annotation has been properly validated, it will comply with the rules of the HED specification. Annotators and analysts are mainly concerned with HED validation errors relating to incorrectly annotated events. See B.1: HED validation errors for a listing of errors keyed to the HED specification.

HED-compliant tools assume that the HED schemas available on the hed-standard/hed-schemas GitHub repository are error-free, and that schema errors can only occur due to failure to locate or read a HED schema.

HED schema developers are mainly concerned with errors and inconsistencies in the schema itself. Schemas under development should be validated at all stages of development. See B.2: Schema validation errors for a listing of errors keyed to the HED specification.

B.1. HED validation errors

CHARACTER_INVALID

a. A HED string cannot contain the following characters:

  • Character code <= 31 (hex 0x1f).

  • 127 (hex 0x7f) <= character code <= 159 (hex 0x9f).

  • Left or right square brackets ([, ]).

  • Tilde (~) character. Replace: the syntax (A ~ B ~ C) with (A, (B, C)).

  • Double quotes (").

b. Curly braces ({, }) can only appear in a sidecar and indicate a column template, not HED.

Notes:

  1. Starting with HED 8.3.0, HED supports UTF-8 encoding.

  2. Different parts of a HED string have different rules for acceptable characters. For example tag names must satisfy the rules for the HED name class. The values used after tag names depend on the value classes of the tag and the unit classes of the tag.

  3. From standard schema 8.5.0, and in libraries partnered with 8.5.0 or later, a textClass value containing a parenthesis, number sign, or tilde is CHARACTER_INVALID under the value class. In earlier schemas the value class allows these characters, but the substituted string is still parsed as HED, so tools report the structural error instead (PARENTHESES_MISMATCH, PLACEHOLDER_INVALID, or CHARACTER_INVALID for the tilde).

  4. The character sets named here and in 2.2 Character sets and restrictions are published as character_sets.json. A validator reporting this error names the character, its position, and the set it failed.

See also:

COMMA_MISSING

HED tag groups and tags must be separated with commas. In the following A, B, C, and D represent HED expressions.

a. Two tag groups are not separated by commas: (A, B)(C, D).
b. A tag and a tag group are not separated by commas: A(B,D).

Note: Commas missing between two HED tags are generally detected as invalid HED tags, rather than as missing commas.

See 3.2.7.3. Empty tags and groups for an explanation of the rules for empty tags.

See also TAG_EMPTY.

DEF_EXPAND_INVALID

a. A Def-expand tag’s name does not correspond to a definition.
b. A Def-expand is missing an expected placeholder value or has an unexpected placeholder value.
c. A Def-expand has a placeholder value of incorrect format or units for definition.
d. The tags within a Def-expand do not match the corresponding definition.
e. A Def-expand tag group is missing its inner tag group.
f. A Def-expand tag group has extra tags or groups.

See 3.2.8.2. The Def and Def-expand tags for an explanation of the rules for Def-expand and 5.2. Using definition for more details and examples.

DEF_INVALID

a. A Def tag’s name does not correspond to a definition.
b. A Def tag is missing an expected placeholder value or has an unexpected placeholder value.
c. A Def has a placeholder value of incorrect format or units for definition.

See 3.2.8.2. The Def and Def-expand tags for an explanation of the rules for Def and 5.2. Using definition for more details and examples.

DEFINITION_INVALID

A definition is a tag group containing a Definition tag and a single tag group with the definition’s contents.

a. A Definition tag does not appear in a tag group at the top level in an annotation.
b. A definition’s enclosing tag group contains an empty group (i.e., an actual inner ()).
c. A definition’s enclosing tag group contains more than a Definition tag and an inner group.
d. A definition’s contents contain, at any level, a structural reserved tag (Definition, Def, Def-expand, Onset, Offset, Inset, Delay, Duration, Event-context), in every schema version.
e. A definition uses curly braces.
f. A definition that includes a placeholder (#) does not have exactly two # characters.
g. A definition has placeholders (#) in incorrect positions.
h. Definitions of the same name appear with and without a #.
i. Two definitions with the same name have different contents. Identical definitions of one name (the same placeholder form and the same contents, without regard to case or order) are allowed and treated as one definition.
j. A tag with a required or unique attribute appears in a definition.
k. A definition appears in an unexpected place such as an events file or in a sidecar dictionary that contains non-definition entries.
l. The value of a Definition tag has a part after the name other than a single # (Definition/MyDef/3, Definition/MyDef/#/#).

See 3.2.8.1. The Definition tag for an explanation of the rules for definitions. See also 5.1. Creating definitions and 5.2. Using definitions for more details and examples of definition syntax.

ELEMENT_DEPRECATED*

A schema element has been deprecated and should not be used. When an element is updated, its description is updated to include the reason for deprecation and a suggested path for updating usage.

a. A tag has been deprecated and an alternative method of tagging should be used. See tag description for how to replace.
b. A unit, unit class, value class has been deprecated and an alternative should be used.

See A.1.4. Schema attributes for additional information about the deprecatedFrom schema attribute.

PARENTHESES_MISMATCH

a. A HED string does not have the same number of open and closed parentheses.
b. The open and closed parentheses are not correctly nested in the HED string.

See 3.2.7.1. Parentheses and order for the rules for parentheses in HED.

PLACEHOLDER_INVALID

a. A # appears in a place that it should not (such as in the HED column of an events file).
b. A JSON sidecar has a placeholder (#) in the HED dictionary for a categorical column.
c. A JSON sidecar does not have exactly one placeholder (#) in each HED string representing a value column.
d. A placeholder (#) is used in JSON sidecar or definition, but its parent in the schema does not have a placeholder child.
e. Multiple placeholders (#) appear in a HED string (e.g., "Label/#, Parameter-value/#").
f. A placeholder (#) does not appear directly after a slash (e.g., "Label/ #").

See 3.2.4. Tags that take values and 3.2.9.1. Sidecar entries for information on the use of placeholders in HED.

REQUIRED_TAG_MISSING

a. An event-level annotation does not have a tag corresponding to a node with the required schema attribute.

Note: An assembled event string must include all tags having the required schema attribute.

See 3.2.10.2. Event-level processing for additional information on the required tag.

SCHEMA_LOAD_FAILED

a. Different standard schema partner versions in a merge group.
b. Elements (tag, unit class, unit, unit modifier, value class, or schema attribute) of two library schemas in the same merge group have the same name but have conflicting attributes, description, parents, or placeholder (#) children.
c. Different versions of the same schema appear in the same merge group.
d. A schema with a specified name and version cannot be found.

Note: Depending on the validator, a missing file may be reported through a file error exception (e.g., a HedFileError exception in the Python tools) rather than as SCHEMA_LOAD_FAILED.

Note: Partnered library schemas never define schema properties: the Properties section of an unmerged partnered library schema is empty and that of a merged partnered library schema is the Properties section of its standard schema partner, so conflicts with the standard partner are detected when the schema itself is validated. See reason j and k of SCHEMA_LIBRARY_INVALID.

See 3.1.2.4. Partnered combinations for the rule table and 7.3.6. Lazy partnering for a description of the merging process.

SIDECAR_BRACES_INVALID

a. A name appearing in curly braces in a sidecar HED annotation is not the word HED or the name of a HED-annotated column in the sidecar.
b. A column name entry in a sidecar has a HED annotation with curly braces, but this name also appears in curly braces in another HED annotation.
c. The curly braces in a sidecar are nested or unmatched.
d. The curly braces appear as the substitution for a placeholder in another tag.

See 3.2.9. Sidecars for information on the requirements for using sidecars.

SIDECAR_INVALID

a. The "HED" key is not a second-level dictionary key.
b. An annotation entry is provided for n/a.
c. No longer used: a sidecar that refers in curly braces to a column with no HED is SIDECAR_BRACES_INVALID (a) from specification 4.0.0.
d. A top-level sidecar key begins or ends with whitespace (blank, tab, line feed, or carriage return).

See 3.2.9. Sidecars for a general explanation of sidecar requirements.

SIDECAR_KEY_MISSING*

(WARNING)

a. A value in a categorical column does not have an expected entry in a sidecar.
b. A {ref} in a sidecar does not correspond to a column in the associated tabular file.

Note: This warning is only triggered if the categorical column in which the value appears does have HED annotations.

See 3.2.9. Sidecars for a general explanation of sidecar requirements.

STYLE_WARNING*

(WARNING)

a. A tag does not follow the standard capitalization convention: only the first letter of the tag term should be capitalized, with the remainder lower case.

Note: This warning can occur for tag extensions during annotation and for schema nodes in prerelease schema versions under development. Tags drawn from released schemas already follow the convention.

See 3.1.5. Naming conventions for the HED naming conventions and 3.2.5 Tag extensions for additional information on the tag extension rules.

TABULAR_INVALID

a. A column name appears more than once in the first line (the column names) of a tabular file.
b. A column name in the first line of a tabular file begins or ends with whitespace (blank, tab, line feed, or carriage return).

For (a) the error names each repeated column, and the repeated columns are not renamed, merged, or dropped: assembling the row annotations of such a file would combine the annotations of the repeated columns into one row and report the result as TAG_EXPRESSION_REPEATED, or lose one of them. For (a) names are compared exactly as written, so two names that differ only in leading or trailing whitespace (trial and trial ) are not a repeat; the name with the whitespace is (b). For (b) the error is reported once for each column name with leading or trailing whitespace; a name that is both padded and repeated (trial twice) is reported under (b) only. Both are reported before any row annotation is assembled.

Both reasons apply to the column names of any tabular container whose row annotations are assembled from named columns, as 3.2.10 states, by the names under which its columns are assembled: in NWB the TimestampVectorData column named timestamp counts as onset, so a table that also has a column named onset is (a). Other TimestampVectorData columns keep their own names.

See 3.2.10. Tabular files for the requirements on tabular files.

TAG_EMPTY

a. A HED string has extra commas or parentheses separated by only white space, indicating empty tags.
b. A HED string begins or ends with a comma (ignoring white space), indicating an empty string.
c. A tag group is empty (i.e., empty parentheses are not allowed).

See 3.2.7.3. Empty tags and groups for the rules on empty tags and groups.

TAG_EXPRESSION_REPEATED

a. A tag is repeated in the same tag group or level.

Suppose A, B, and C represent HED expressions. HED strings are not ordered, so (B, C) is equivalent to (C, B). Thus, (A, (A, B)) is not a duplicate, but (A, (B, C), A) and (A, (B, C), (C, B)) are duplicates.

Note: In a tabular file, a repetition can also come from the assembly of a row’s annotation rather than from any single annotation, for example two columns whose annotations contain the same tag. A column name that appears twice in the first line of the file is TABULAR_INVALID, not this error.

See 3.2.7.4. Repeated expressions for additional information on the rules for duplication.

TAG_EXTENDED*

(WARNING)

a. A tag represents an extension from the schema.

Note: Often such extensions are really spelling errors and not meant to extend the schema.

Note: Annotators are discouraged from extending the schema unless absolutely necessary. If an extension tag is needed, annotators should consider posting an issue explaining the tag extension so that an addition to the respective schema might be considered.

See 3.2.5 Tag extensions for additional information on the tag extension rules.

TAG_EXTENSION_INVALID

a. A tag extension term is already in the schema.
b. A tag extension term does not comply with rules for schema nodes.
c. A tag has extension, but an extension is not allowed. This includes an extension of a reserved tag (Onset/Blah, Onset/#), although reserved tags inherit extensionAllowed; see 3.2.5 Tag extensions.

See 3.2.5 Tag extensions for additional information on the tag extension rules.

TAG_GROUP_ERROR

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. Note: a single Delay may be in the same group as a single Duration, Onset, Offset, or Inset.
d. An Event-context group contains a tag other than Event-context that is not inside a tag group.
e. An Event-context group contains a curly brace column reference ({column}).

Note: For the structural reserved tags of 3.2.8. Reserved tags, a violation of a group rule is reported with the tag’s own code (DEFINITION_INVALID, TEMPORAL_TAG_ERROR). A tag that is not in a group (a), not in a top-level group (b), or in a group with a tag not allowed beside it © MAY instead be reported as TAG_GROUP_ERROR.

See 3.2.7.2. Tag group attributes for additional information on the rules for group errors due to schema attributes.

See also: TEMPORAL_TAG_ERROR for errors involving Onset, Offset, Inset, Duration and Delay.

TAG_INVALID

a. The tag is not valid in the schema it is associated with.
b. The tag has extra internal whitespace, including directly before or after forward slashes.
c. The tag has a leading, trailing, or consecutive forward slashes.
d. A tag or tag extension contains a non name character.

See 3.2.2. Tag forms for a discussion of tag forms and their relationship to the HED schema.

TAG_NAMESPACE_PREFIX_INVALID

a. A tag prefix has invalid characters.

See 3.2.6. Tag namespace prefixes and 7. Library schema for additional information on using multiple schemas in annotation.

TAG_NOT_UNIQUE

a. A tag with unique attribute appears more than once in an event-level HED string.

See 3.2.10.2. Event-level processing for additional information on the unique tag.

TAG_REQUIRES_CHILD

a. A tag has the requireChild schema attribute but does not have a child.
b. A structural reserved tag whose requireValue is true in reserved_tags.json (see 3.2.8. Reserved tags) has no value. This matters for Delay and Duration in standard schemas 8.0.0 to 8.2.0, which do not have requireChild.

See 3.2.4. 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 group contains anything besides its anchor and an optional Delay tag.
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 has tags besides the anchor Def tag or Def-expand group and an optional Delay tag 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, Offset, or Delay tag appears in an annotation for a table without an onset or equivalent column.
l. A Duration or Delay tag group contains extra tags or groups, or is missing the required group. A Delay group that does not contain Onset, Offset, or Inset MUST have exactly one inner group, so (Delay/2 s) alone is an error.
m. An Offset, Onset, Inset, Duration, or Delay tag appears with other top-level tags, except that a Delay MAY be paired with a Duration, Onset, Offset, or Inset.
n. In a timeline table (a table with an onset or equivalent column), a Duration or Delay tag has a value that cannot be converted to the default units of its unit class (non-numeric value, invalid units, or units with no conversionFactor, such as month or year), so the delayed onset (Delay) or the end time (Duration) cannot be placed on the table’s timeline. In a standard schema whose timeUnits carry no conversionFactor (8.0.0), a value with no unit, or in the default unit written as s, second, or seconds, is not an error; a value in a modified form such as ms or in any other unit is. A Duration tag in a descriptor table MAY use any valid unit of its unit class.

See also: TAG_GROUP_ERROR.

See 3.2.8.3 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 in Chapter 5 gives examples of usage and additional details.

UNITS_INVALID

a. A tag has a value with units that are invalid or not of the correct unit class for the tag.
b. A unit modifier is applied to units that are not SI units.
c. A component of a compound unit (m-per-s, m^3) is not a schema unit symbol, differs in case from it, or carries more than one SI unit modifier (kmm-per-s, m-per-sec, m-per-S).

See 3.2.4 Tags that take values for more information.

VALUE_INVALID

a. The value substituted for a placeholder (#) is not valid.
b. A tag value is incompatible with the specified value class.
c. A tag value with no value class is assumed to be textClass and contains invalid characters.
d. The units are not separated from the value by a single blank.
e. A value in a tabular column annotated by a sidecar value entry is invalid, in any row whose value is not n/a or blank, including rows whose assembled annotation does not use the column.

See 3.2.4 Tags that take values for more information.

B.2. Schema validation errors

This section is organized by the type of schema format that results in the error. Errors that might be detected regardless of the schema format start with HED_SCHEMA. Errors that are specific to the .mediawiki format start with HED_WIKI. Errors that occur in the construction of the XML version or that are detected by XML validators when the planned XSD validation is implemented start with HED_XML.

B.2.1. General validation errors

SCHEMA_ANNOTATION_INVALID*

a. An annotation value uses a prefix that is not a row of the Prefixes section.
b. The prefix:id of an annotation value is not a row of the External annotations section. A bare external term such as glotto:afro1255 falls here; write skos:exactMatch glotto:afro1255.
c. A dc:source value names no row of the Sources section: it neither begins with a row’s source name nor contains a URL under a row’s link.
d. A value in prefix notation (prefix:term) has a prefix that is not a row of the Prefixes section, or the value of a SKOS mapping property (skos:exactMatch, skos:closeMatch) is not in prefix notation at all (skos:exactMatch C25499, skos:exactMatch https://example.org/C25499).

The Prefixes, External annotations, and Sources rows of a partnered library’s standard schema count as the library’s own. Applies to standard schemas with versions >= 8.5.0 and to library schemas partnered with them.

See A.1.4.2. annotation for the form of an annotation value and A.1.6. Schema sources for what a dc:source value must name.

SCHEMA_ATTRIBUTE_INVALID

a. An attribute is used in the schema, but is not defined in the schema attribute section.
b. A schema attribute is applied to the incorrect type (e.g., an element with the unit definition does appear under an appropriate unit class).
c. A schema attribute is used in an invalid way
d. The pseudo unit class anyUnits lists a unit or has defaultUnits.

Attribute

Invalid Usage Location

deprecatedFrom

See SCHEMA_DEPRECATION_ERROR

rooted

See SCHEMA_LIBRARY_INVALID

takesValue

Used on a non-placeholder(#) node.

unitClass

Used on a non-placeholder(#) node.

valueClass

Used on a non-placeholder(#) node.

Notes:

  • A tag (referred to as a node element in the schema) can have schema attributes that have the tagDomain or the elementDomain property or have no domain property.

  • A unitClass element can only have schema attributes that have the unitClassDomain or the elementDomain property.

  • A unitModifier element can only have schema attributes that have the unitModifierDomain or the elementDomain property.

  • A unit element can only have schema attributes that have the unitDomain or the elementDomain property.

  • A valueClass element can only have schema attributes that have the valueClassDomain or the elementDomain property.

SCHEMA_ATTRIBUTE_VALUE_INVALID

a. A non-boolean schema attribute has an invalid value or usage as indicated by the following table.

Attribute

Invalid Attribute Value

allowedCharacter

Not a character set name or alias of 2.2, and not a single character.

conversionFactor

Not a positive numeric value.

defaultUnits

Not a unit, or a derived form of a unit, of this unit class.

deprecatedFrom

See SCHEMA_DEPRECATION_ERROR

inLibrary

The value of an inLibrary attribute is for the wrong library.

relatedTag

Not an existing tag.

rooted

See SCHEMA_LIBRARY_INVALID

suggestedTag

Not an existing tag.

unitClass

Not an existing unit class, more than one, or valueClass not numericClass.

valueClass

Not an existing value class.

The valueClass condition in the unitClass row applies to standard schemas with versions >= 8.5.0 and to library schemas partnered with them; earlier standard schemas keep placeholders such as Sampling-rate/# that have a unit class and no value class (see 3.1.4.4. Unit classes and units).

SCHEMA_CHARACTER_INVALID

a. A non-placeholder schema node contains non-name characters.
b. A unit class name contains non-name characters.
c. A value or unit class name contains non-name or blank characters.
d. The prologue or epilogue contain characters other than text or newline.

See 2.2 Character sets and restrictions for definitions of the different types of characters.

Note: tag extensions may contain nonascii characters.

SCHEMA_DEPRECATION_ERROR

a. The value of deprecatedFrom is not a previously released HED schema version.
b. A deprecated tag is used as a suggestedTag or a relatedTag in a non-deprecated tag.
c. A child tag of a deprecated tag does not have the deprecatedFrom attribute.
d. A deprecated attribute is used on a non-deprecated element.
e. A deprecated property is used on a non-deprecated attribute.
f. A deprecated unit class has non-deprecated units.
g. A tag has deprecated unit or value classes.
h. A unit class has a deprecated default unit.

SCHEMA_DUPLICATE_NODE

a. A schema node name appears in the schema more than once.
b. In a standard schema with version >= 8.5.0, or a library schema partnered with one, a unit class lists a unit that is an SI unit modifier applied to another unit of the same class (uV beside V).
c. A unit string is derived by two unit classes (an SI unit modifier applied to a unit of each, or a plural) and listed by neither, so it would be ambiguous on a placeholder with unitClass=anyUnits. A string listed in one class and derived in another is not an error: the listed unit wins. See 3.1.4.4. Unit classes and units.

SCHEMA_HEADER_INVALID

a. The schema header has invalid characters or format.
b. The schema header has unrecognized attributes.

SCHEMA_LIBRARY_INVALID

Library schema errors are specific to library schema. Library schema may also raise any of the other schema errors.
a. The specified library name is not alphabetic or lowercase.
b. The withStandard attribute is used in a header that does not also have the library attribute.
c. The withStandard attribute value does not correspond to a valid standard schema version.
d. The rooted attribute appears in a schema whose header does not have both the library and withStandard attributes.
e. In an unmerged schema, a node with the rooted attribute is not at the top level; in a merged schema, a node with rooted=XXX is not a direct child of XXX.
f. A node with the rooted attribute does not correspond to a node in its partnered standard schema.
g. A partnered library schema with the unmerged="true" header attribute has an inLibrary attribute in some element.
h. A partnered library schema with the unmerged="true" header attribute duplicates a row of the extra sections (Sources, Prefixes, or External annotations) of its standard schema partner. Extra-section rows are not schema elements and are not merged when the schema is loaded.
i. A partnered library schema with the unmerged="true" header attribute has a schema element (tag, unit, unit class, unit modifier, value class, or schema attribute) with the same name as an element of its standard schema partner. Naming an existing unit class solely to add new units under it is not a duplication.
j. A partnered library schema with the unmerged="true" header attribute has a non-empty Properties section.
k. A merged partnered library schema has a Properties section that differs from that of its standard schema partner.
l. A library schema uses the reserved attribute on one of its own elements (in a merged partnered library schema, an element with the inLibrary attribute).
m. A library schema defines, among its own elements (in a merged partnered library schema, those with the inLibrary attribute), a tag whose name is a reserved tag of a standard schema; the partner’s reserved tags carried into a merged file are not affected. For an unmerged partnered library schema this is also reason i.
n. A partnered library schema places a node under a reserved tag with the rooted attribute.

SCHEMA_MISSING_EXTRA*

a. A row of the Sources, Prefixes, or External annotations section has an empty value in a required column.

See 3.1.4.10. Sources, prefixes, and external annotations for the columns of each section.

SCHEMA_RESERVED_INVALID

a. A standard schema does not define a tag that reserved_tags.json names for its version, or defines it without the attributes the rules rely on: reserved (standard schemas >= 8.2.0) and topLevelTagGroup (on Delay and Duration, standard schemas >= 8.2.0) for every row, Inset existing from 8.2.0; reserved on Def and Def-expand; and, from 8.3.0, reserved on the ten organizational reserved tags.
b. A reserved tag has a child node other than #.

See 3.2.8. Reserved tags for the tags and A.6. Reserved tags file for the file.

SCHEMA_SECTION_MISSING

a. A required schema section is missing.
b. The schema sections (corresponding to the prologue, schema, unit classes, unit modifiers, value classes, schema attributes, properties, epilogue, and, when present, sources, prefixes, and external annotations) are not in the correct order and hence not detected.

Note: A tool that writes a schema file includes every section, even when it is empty. A tool that reads a schema file requires the sources, prefixes, and external annotations sections in standard schemas with versions >= 8.5.0 and in library schemas partnered with those standard schemas (HED specification 4.0.0). For compatibility with older files, it accepts their omission from standard schemas with versions < 8.5.0 and from unpartnered library schemas and treats an omitted section as empty. When present they must appear in the order listed.

SCHEMA_VERSION_INVALID

a. The schema version in the HED line or element is invalid.
b. A HED version specification does not have the correct syntax for the schema file format.
c. A HED schema version does not comply with semantic versioning.

B.2.2. MediaWiki format errors

WIKI_DELIMITERS_INVALID

a. Delimiters used in the wiki are invalid.
b. Schema line content after node name is not enclosed with <nowiki></nowiki> delimiters.
c. A line has unmatched or multiple <nowiki></nowiki>, [ ], or { } delimiters.
d. Attributes section of a node is malformed(e.g., hanging = character).

WIKI_LINE_START_INVALID

a. Start of body line not ''' or *.

WIKI_SEPARATOR_INVALID

a. A malformed section separator is present
b. A duplicate section separator is present.

B.2.3. XML format errors

XML_SYNTAX_INVALID

a. XML syntax or does not comply with specified XSD.

B.2.4. Schema loading errors

Schema loading errors can occur because the file is inaccessible or is not proper XML. Schema loading errors are handled in different ways by the Python and JavaScript tools.

Python tools generally raise a HedFileError exception when a failure to load the schema occurs. The calling programs are responsible for deciding how to handle such a failure. However, the message associated with the HedFileError usually includes the SCHEMA_LOAD_FAILED error code.

JavaScript tools in contrast are mainly used for validation of HED annotations in data. These tools are mainly called by the BIDS validator. If a BIDS dataset uses HED, it must provide a HED version specification in the dataset_description.json file. If the HED JavaScript validator cannot load a valid HED schema based on this specification it reports a SCHEMA_LOAD_FAILED issue.