hdmf.term_set module

class hdmf.term_set.TermSet(term_schema_path: str | None = None, schemasheets_folder: str | None = None, dynamic: bool = False)

Bases: object

Class for implementing term sets from ontologies and other resources used to define the meaning and/or identify of terms.

Variables:
  • term_schema_path – The path to the LinkML YAML enumeration schema

  • sources – The prefixes for the ontologies used in the TermSet

  • view – SchemaView of the term set schema

  • schemasheets_folder – The path to the folder containing the LinkML TSV files

  • expanded_termset_path – The path to the schema with the expanded enumerations

Parameters:
  • term_schema_path – The path to the LinkML YAML enumeration schema

  • schemasheets_folder – The path to the folder containing the LinkML TSV files

  • dynamic – Boolean parameter denoting whether the schema uses Dynamic Enumerations

validate(term)

Validate term in dataset towards a termset.

Parameters:

term (str) – term to be validated

property view_set

Property method to return a view of all terms in the the LinkML YAML Schema.

__getitem__(term)

Method to retrieve a term and term information (LinkML description and LinkML meaning) from the set of terms.

class hdmf.term_set.TermSetWrapper(termset, value)

Bases: object

This class allows any HDF5 dataset or attribute to have a TermSet.

Parameters:
  • termset (TermSet) – The TermSet to be used.

  • value (list or ndarray or dict or str or tuple) – The target item that is wrapped, either data or attribute.

property value
property termset
property dtype
__getitem__(val)

This is used when we want to index items.

append(arg)

This append resolves the wrapper to use the append of the container using the wrapper.

extend(arg)

This append resolves the wrapper to use the extend of the container using the wrapper.