types

class Schema(xmlData)

An imported HED schema object.

Constructor.

Arguments:
  • xmlData (object) – The schema XML data.

Schema.Schema

Constructor.

Schema.generation

type: Number

The HED generation of this schema.

Schema.library

type: string

The HED library schema name.

Schema.prefix

type: string

This schema’s prefix in the active schema set.

Schema.version

type: string

The HED schema version.

Schema.xmlData

type: Object

The schema XML data.

Schema.tagHasAttribute(tag, tagAttribute)

Determine if a HED tag has a particular attribute in this schema.

Arguments:
  • tag (string) – The HED tag to check.

  • tagAttribute (string) – The attribute to check for.

Returns:

boolean – Whether this tag has this attribute.

class Hed2Schema(xmlData, attributes)

Hed2Schema class

Constructor.

Arguments:
  • xmlData (object) – The schema XML data.

  • attributes (SchemaAttributes) – A description of tag attributes.

Hed2Schema.Hed2Schema

Constructor.

Hed2Schema.attributes

type: SchemaAttributes

The description of tag attributes.

Hed2Schema.tagHasAttribute(tag, tagAttribute)

Determine if a HED tag has a particular attribute in this schema.

Arguments:
  • tag (string) – The HED tag to check.

  • tagAttribute (string) – The attribute to check for.

Returns:

boolean – Whether this tag has this attribute.

class Hed3Schema(xmlData, entries, mapping)

Hed3Schema class

Constructor.

Arguments:
  • xmlData (object) – The schema XML data.

  • entries (SchemaEntries) – A collection of schema entries.

  • mapping (Mapping) – A mapping between short and long tags.

Hed3Schema.Hed3Schema

Constructor.

Hed3Schema.entries

type: SchemaEntries

The collection of schema entries.

Hed3Schema.mapping

type: Mapping

The mapping between short and long tags.

Hed3Schema.tagHasAttribute(tag, tagAttribute)

Determine if a HED tag has a particular attribute in this schema.

Arguments:
  • tag (string) – The HED tag to check.

  • tagAttribute (string) – The attribute to check for.

Returns:

boolean – Whether this tag has this attribute.

class Schemas(schemas)

The collection of active HED schemas.

Constructor.

Arguments:
  • schemas (Schema|Map.<string, Schema>|null) – The imported HED schemas.

Schemas.Schemas

Constructor.

Schemas.baseSchema

The base schema, i.e. the schema with no nickname, if one is defined.

Schemas.generation

type: Number

The HED generation of this schema.

If baseSchema is null, generation is set to 0.

Schemas.isHed3

Whether this schema collection comprises HED 3 schemas.

Schemas.isSyntaxOnly

Whether this schema collection is for syntactic validation only.

Schemas.librarySchemas

The library schemas, i.e. the schema with nicknames, if any are defined.

Schemas.schemas

type: Map.<string, Schema>|null

The imported HED schemas.

The empty string key (“”) corresponds to the schema with no nickname, while other keys correspond to the respective nicknames.

This field is null for syntax-only validation.

Schemas.standardSchema

The standard schema, i.e. primary schema implementing the HED standard, if one is defined.

Schemas.getSchema(schemaName)

Return the schema with the given nickname.

Arguments:
  • schemaName (string) – A nickname in the schema set.

Returns:

Schema – The schema object corresponding to that nickname.

class SchemaSpec(nickname, version, library, localPath)

A schema version specification.

Constructor.

Arguments:
  • nickname (string) – The nickname of this schema.

  • version (string) – The version of this schema.

  • library (string) – The library name of this schema.

  • localPath (string) – The local path for this schema.

SchemaSpec.SchemaSpec

Constructor.

SchemaSpec.library

type: string

The library name of this schema.

SchemaSpec.localName

Compute the name for the bundled copy of this schema.

SchemaSpec.localPath

type: string

The local path for this schema.

SchemaSpec.nickname

type: string

The nickname of this schema.

SchemaSpec.path

Alias to old name of localPath.

SchemaSpec.version

type: string

The version of this schema.

class SchemasSpec()

A specification mapping schema nicknames to SchemaSpec objects.

Constructor.

SchemasSpec.SchemasSpec

Constructor.

SchemasSpec.data

type: Map.<string, SchemaSpec>

The specification mapping data.

SchemasSpec.addSchemaSpec(schemaSpec)

Add a schema to this specification.

Arguments:
  • schemaSpec (SchemaSpec) – A schema specification.

Returns:

SchemasSpec|map – This object.

SchemasSpec.isDuplicate(schemaSpec)

Determine whether this specification already has a schema with the given nickname.

Arguments:
  • schemaSpec (SchemaSpec) – A schema specification with a nickname.

Returns:

boolean – Whether the nickname exists in this specification.