Skip to content

cmem_client.models.vocabulary¤

Vocabulary models for Corporate Memory vocabulary catalog.

Provides Pydantic models for vocabulary catalog entries returned by the DataPlatform vocabularies API.

The catalog lists both the vocabularies a deployment has installed and those it offers for installation; they are the items of client.vocabularies, keyed by their IRI. The cache models describe something else: the classes and properties DataIntegration extracted from the installed vocabularies, which is what drives autocompletion in the user interface.

Classes:

VocabCacheEntry¤

Bases: Model

Cache data for one vocabulary, containing its classes and properties.

Attributes:

classes¤

classes: list[VocabCacheItem] = Field(default_factory=list)

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

properties¤

properties: list[VocabCacheItem] = Field(default_factory=list)

VocabCacheItem¤

Bases: Model

A single class or property in the vocabulary cache.

Attributes:

generic_info¤

generic_info: VocabCacheItemInfo = Field(alias='genericInfo')

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

VocabCacheItemInfo¤

Bases: Model

Generic info for a vocabulary cache term.

Attributes:

  • uri (str) – URI of the class or property.
  • label (str | None) – Human readable name of the term, if the vocabulary defines one.

label¤

label: str | None = None

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

uri¤

uri: str

Vocabulary¤

Bases: Model, ReadRepositoryItem

A vocabulary catalog entry.

Attributes:

  • iri (str) – IRI of the vocabulary. This is the key of the repository.
  • installed (bool) – Whether the vocabulary is installed in the deployment.
  • download_url (str | None) – Where an uninstalled vocabulary can be fetched from, or None if the catalog offers no source for it.
  • vocabulary_label (str | None) – Name of the vocabulary as given by the catalog.
  • label (VocabularyLabel | None) – Label of the graph holding the vocabulary, once it is installed.

Functions:

  • get_id – Get the IRI of the vocabulary.

download_url¤

download_url: str | None = Field(default=None, alias='downloadUrl')

get_id¤

get_id()

Get the IRI of the vocabulary.

installed¤

installed: bool

iri¤

iri: str

is_installable¤

is_installable: bool

Return True if the vocabulary can be installed from catalog.

label¤

label: VocabularyLabel | None = None

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

vocabulary_label¤

vocabulary_label: str | None = Field(default=None, alias='vocabularyLabel')

VocabularyCache¤

Bases: Model

Global vocabulary cache response from DataIntegration.

Attributes:

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

vocabularies¤

vocabularies: list[VocabCacheEntry] = Field(default_factory=list)

VocabularyLabel¤

Bases: Model

Label metadata for a vocabulary.

Attributes:

  • title (str) – Text of the label.
  • lang (str | None) – Language tag of the label, e.g. en.

lang¤

lang: str | None = None

model_config¤

model_config = ConfigDict(extra='allow', populate_by_name=True)

title¤

title: str

Comments