Terminology API

Besides storing metadata odML also provides means to define the terms used in doML documents in a terminology. Further the terminologies can even serve as schema like restrictions new documents have to adhere to.

In odML terminologies consist of two building blocks: type definitions (TypeDef) and property definitions (PropertyDef).

Type definition

A type definitions describes the type of a thing an odML section can represent. For example: an experiment, recording session or subject.

The most important part of a type definition is a good type name. It is recommended to use camel-case names that start with a capital letter e.g. ‘Experiment’, ‘RecordingSession’ or ‘Subject’.

In addition a type can have a textual description of the thing it represents.

Finally a type definition can have a set of property names that defined common attributes of the type. The property names used in type definitions should have a corresponding property definition (PropertyDef).

class odml2.TypeDef(name, definition=None, properties=frozenset([]))

Creates a new type definition.

Parameters:
  • name (str) – The name of the type.
  • definition (str) – The verbal definition of the type.
  • properties (frozenset[str]) – A set of property names.
copy(name=None, definition=None, properties=frozenset([]))
definition
name
properties

Property definition

A property definition describes a certain attribute of an odML type definition. The most essential part of a property definition is the properties name. It is recommended to use snake-case names that start with a lower letter: ‘recording_time’, ‘age’ or ‘date_of_birth’.

In addition a property can have a textual description of the attribute it represents.

Further a property definition can have a set of type names associated with it. The type name must either be the name defined by another type definition or the type of a predefined data type for odML values: ‘string’, ‘bool’, ‘int’, ‘float’, ‘time’, ‘date’ or ‘datetime’.

class odml2.PropertyDef(name, definition=None, types=frozenset([]))

Crates a new property definition.

Parameters:
  • name (str) – The name of the property.
  • definition (str) – A verbal definition of the property.
  • types (frozenset[str]) – A set of type names (names of types that can be used as target / ‘rvalue’) of the property.
copy(name=None, definition=None, types=frozenset([]))
definition
name
types

Navigation