Skip to content

models

models

OSI semantic layer model dataclasses with to_dict() serialization.

OsiDimension dataclass

OsiDimension(
    name: str,
    type: str,
    description: str = "",
    synonyms: list[str] = list(),
    domo_extensions: dict = dict(),
)

A dimension (non-aggregatable field) in an OSI semantic model.

Attributes:

Name Type Description
name str

Column name

type str

"categorical" or "time"

description str

Human-readable description (from AI Readiness if available)

synonyms list[str]

Alternative names (from AI Readiness if available)

domo_extensions dict

DOMO-specific metadata

OsiEntity dataclass

OsiEntity(
    name: str, type: str, domo_extensions: dict = dict()
)

An entity (join key column) in an OSI semantic model.

Attributes:

Name Type Description
name str

Column name

type str

"primary" (left/source side) or "foreign" (right/target side)

domo_extensions dict

DOMO-specific metadata to include in custom_extensions

OsiMetric dataclass

OsiMetric(
    name: str,
    expression: str,
    datatype: str = "UNKNOWN",
    description: str = "",
    domo_extensions: dict = dict(),
)

A metric (aggregatable field) in an OSI semantic model.

Field names and shape follow the OSI spec's metrics[] object (core-spec/spec.yaml: name, expression.dialects[], description, datatype, custom_extensions). Domo-specific derived data — the mapped aggregation semantic and the raw Beast Mode functions — is NOT a spec field (there is no aggregation key in OSI); it lives in domo_extensions instead, alongside the rest of the vendor metadata.

Attributes:

Name Type Description
name str

Metric name

expression str

SQL/Beast Mode expression (resolved — self-contained, never a dangling DOMO_BEAST_MODE(nnn) reference). Stored here as a plain string; to_dict() wraps it in the spec's dialects[] structure.

datatype str

Logical data type (default "UNKNOWN")

description str

Human-readable description

domo_extensions dict

DOMO-specific metadata (dataset id, beast mode template id, legacy id, raw functions, and the derived aggregation semantic when unambiguous — see OsiConverter._map_functions_to_aggregation)

OsiRelationship dataclass

OsiRelationship(
    from_model: str,
    to_model: str,
    from_field: str,
    to_field: str,
    join_type: str,
    cardinality: str | None = None,
)

A relationship (JOIN) between two OSI semantic models.

Attributes:

Name Type Description
from_model str

Name of the source/left model

to_model str

Name of the target/right model

from_field str

Join column on the from_model side

to_field str

Join column on the to_model side

join_type str

SQL join type (e.g., "INNER", "LEFT")

cardinality str | None

Relationship cardinality (omitted from output if None)

OsiSemanticModel dataclass

OsiSemanticModel(
    name: str,
    source_dataset_id: str,
    description: str = "",
    entities: list[OsiEntity] = list(),
    dimensions: list[OsiDimension] = list(),
    metrics: list[OsiMetric] = list(),
    relationships: list[OsiRelationship] = list(),
    domo_extensions: dict = dict(),
)

Top-level OSI semantic model for a single source table.

One OsiSemanticModel is generated per source table (DataModelObject or dataset participating in a ViewDefinition join).

Attributes:

Name Type Description
name str

Human-readable model name (from DomoDataset.name if available)

source_dataset_id str

The underlying Domo dataset ID

description str

Model description (from AI_Readiness.unit_of_analysis if set)

entities list[OsiEntity]

Join key columns

dimensions list[OsiDimension]

Non-aggregatable fields

metrics list[OsiMetric]

Aggregatable Beast Mode fields (Phase 1.5)

relationships list[OsiRelationship]

Cross-model JOIN relationships

domo_extensions dict

DOMO-specific metadata for custom_extensions block