Schema#

Loading/saving NWB Schema yaml files

load_yaml(path: Path | str) dict#
load_namespaces(path: Path | NamespaceRepo) Namespaces#

Loads the NWB SCHEMA LANGUAGE namespaces (not the namespacesadapter)

load_schema_file(path: Path, yaml: dict | None = None) SchemaAdapter#

Load a single schema file within an NWB namespace.

Note

This needs to be a separate function from loading a namespace because NWB doesn’t define a schema file per se in its spec, aside from having a datasets and groups dictionary. We wanted to be as faithful to the spec as possible in that package, and so that’s picked up here.

load_namespace_adapter(namespace: Path | NamespaceRepo | Namespaces, path: Path | None = None, version: str | None = None) NamespacesAdapter#

Load all schema referenced by a namespace file

Parameters:
  • namespace (:class:.Namespace`) –

  • path (pathlib.Path) – Optional: Location of the namespace file - all relative paths are interpreted relative to this

  • version (str) – Optional: tag or commit to check out namespace is a NamespaceRepo. If None, use HEAD if not already checked out, or otherwise use whatever version is already checked out.

Returns:

NamespacesAdapter

load_nwb_core(core_version='2.6.0', hdmf_version='1.5.0') NamespacesAdapter#

Convenience function for loading the NWB core schema + hdmf-common as a namespace adapter.

Note

NWB Core schema are implicitly linked to a specific version of HDMF common by virtue of which version of hdmf-common-schema is checked out as a submodule in the repository. We don’t attempt to resolve that linkage here because it’s not in the schema, but the defaults are for the latest nwb core ( '2.6.0' ) and its linked hdmf-common version ( '1.5.0' )

Parameters:
  • core_version (str) – an entry in NWB_CORE_REPO.versions

  • hdmf_version (str) – an entry in NWB_CORE_REPO.versions

Returns: