semantic_model
semantic_model ¶
DomoSemanticModel - a Domo data model (semantic layer).
A semantic model (UI: "Data Model") is a data-model datasource: a
query-time join over N source datasets, defined by the model key of the
schema/indexed response (objects + relationships).
It is a SIBLING of DomoDatasetView, not a subclass: a dataset view's
definition lives in viewTemplate while a data model's lives in model
— foundationally different formats. Both inherit dataset + lineage behavior
from DomoDataset_Default.
DomoSemanticModel
dataclass
¶
DomoSemanticModel(
auth: DomoAuth,
id: str,
raw: dict,
display_type: str = "",
data_provider_type: str = "",
name: str = "",
description: str = "",
row_count: int | None = None,
column_count: int | None = None,
stream_id: int | None = None,
cloud_id: str | None = None,
last_touched_dt: datetime | None = None,
last_updated_dt: datetime | None = None,
created_dt: datetime | None = None,
owner: dict = dict(),
formulas: dict = dict(),
Data: DomoDataset_Data | None = None,
Schema: DomoDataset_Schema | None = None,
Stream: DomoStream | None = None,
Tags: DomoTags | None = None,
PDP: DatasetPdpPolicies | None = None,
Access: DomoDatasetAccessController | None = None,
Formulas: DomoDataset_FormulasManager | None = None,
Certification: DomoCertification | None = None,
AI_Readiness: DomoDataset_AI_Readiness | None = None,
_is_schedule_hydrated: bool = False,
Model: DomoSemanticModel_ModelManager | None = None,
)
Bases: DomoDataset_Default
A Domo data model (semantic layer datasource).
Joins multiple source datasets at query time. The tables and JOIN
criteria are exposed via the composed Model manager:
model = await DomoSemanticModel.get_by_id(auth=auth, dataset_id=...)
await model.Model.get()
model.Model.tables # source-dataset tables
model.Model.relationships # JOIN criteria
Upstream source datasets are available two ways: directly from the
definition (model.Model.source_dataset_ids) and via the inherited
Domo lineage API (model.Lineage).
from_dict
classmethod
¶
from_dict(
auth: DomoAuth,
obj: dict[str, Any],
is_use_default_dataset_class: bool = True,
new_cls=None,
**kwargs
) -> DomoSemanticModel
Create a DomoSemanticModel from an API response dictionary.
Source code in src/crew_dcs/classes/DomoDataset/semantic_model.py
80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | |
DomoSemanticModels
dataclass
¶
DomoSemanticModels(
auth: DomoAuth, models: list[DomoSemanticModel] = list()
)
Bases: DomoManager
Manager for searching and listing Domo semantic models (data models).
create
async
¶
create(
data_source_name: str,
schema: dict,
*,
data_source_description: str | None = None,
cloud_id: str = "domo",
return_raw: bool = False,
context: RouteContext | None = None,
**context_kwargs
) -> DomoSemanticModel
Create a new data model on the Domo instance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data_source_name
|
str
|
Model display name |
required |
schema
|
dict
|
Model definition: |
required |
data_source_description
|
str | None
|
Optional model description |
None
|
cloud_id
|
str
|
Cloud engine ID (defaults to "domo") |
'domo'
|
return_raw
|
bool
|
Return the raw API response instead of a DomoSemanticModel |
False
|
context
|
RouteContext | None
|
Optional RouteContext |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
DomoSemanticModel
|
The newly created DomoSemanticModel, or the raw response if |
DomoSemanticModel
|
|
Note
The Domo API has a validation bug where non-primary relationships
require a non-null alias but rejects all string values for it.
Set primary=True on all relationships in the schema to work
around this.
Source code in src/crew_dcs/classes/DomoDataset/semantic_model.py
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 | |
get
async
¶
get(
model_id: str,
*,
context: RouteContext | None = None,
**context_kwargs
) -> DomoSemanticModel
Retrieve a single semantic model by its datasource ID.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model_id
|
str
|
The data model datasource ID |
required |
context
|
RouteContext | None
|
Optional RouteContext |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
DomoSemanticModel
|
A DomoSemanticModel instance. |
Source code in src/crew_dcs/classes/DomoDataset/semantic_model.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 | |
search
async
¶
search(
maximum: int | None = None,
last_updated_bucket: str | None = None,
return_raw: bool = False,
*,
context: RouteContext | None = None,
**context_kwargs
) -> list[DomoSemanticModel]
Search the instance for semantic models via the SEMANTIC_MODEL profile.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
maximum
|
int | None
|
Maximum number of models to return |
None
|
last_updated_bucket
|
str | None
|
Optional |
None
|
return_raw
|
bool
|
Return the raw search response |
False
|
context
|
RouteContext | None
|
Optional RouteContext |
None
|
**context_kwargs
|
Additional context parameters |
{}
|
Returns:
| Type | Description |
|---|---|
list[DomoSemanticModel]
|
List of DomoSemanticModel objects. |
Source code in src/crew_dcs/classes/DomoDataset/semantic_model.py
131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 | |