Skip to main content
Version: latest

agrag.common.data_models.presets.Preset

Bases: BaseModel

A curated set of entity types to add to a base schema.

A preset adds entity types. It never adds a relation, changes a pattern or changes a description.

Attributes:

  • name (str) – A short, unique name, such as "operations".
  • entities (list[EntityType]) – The entity types the preset adds.
  • widenings (tuple[()]) – Always empty in this release.

Functions:

  • apply – Return a new schema with this preset's entity types appended.

apply​

apply(base:GraphSchema) -> GraphSchema

Return a new schema with this preset's entity types appended.

Parameters:

Returns:

  • GraphSchema – A new schema named "<base name>+<preset name>" with the base
  • GraphSchema – version and relations. The new name identifies the preset variant;
  • GraphSchema – its version tracks revisions within that variant.

Raises:

  • ValueError – The base already declares a preset entity label.

entities​

entities: list[EntityType]

model_config​

model_config = ConfigDict(frozen=True)

name​

name: str

widenings​

widenings: tuple[()] = ()