Bidirectional converter between GoodData's declarative Logical Data Model (LDM) and the Apache Ossie semantic model specification.
- GoodData → Ossie: Convert a GoodData declarative LDM JSON to Ossie semantic model YAML
- Ossie → GoodData: Convert an Ossie semantic model YAML to GoodData declarative LDM JSON
- Preserves GoodData-specific metadata (labels, date granularities, geo types) via Ossie custom_extensions
- Generates dual-dialect expressions (ANSI_SQL + MAQL) for fields
import json
import yaml
from ossie_gooddata import gooddata_to_osi, osi_to_gooddata
from ossie_gooddata.models import gd_model_from_dict, gd_model_to_dict
# GoodData → Apache Ossie
with open("gooddata_ldm.json") as f:
gd_model = gd_model_from_dict(json.load(f))
osi_model = gooddata_to_osi(gd_model, model_name="my_model")
with open("osi_model.yaml", "w") as f:
yaml.dump(osi_model, f, default_flow_style=False)
# Apache Ossie → GoodData
with open("osi_model.yaml") as f:
osi_data = yaml.safe_load(f)
gd_model = osi_to_gooddata(osi_data, data_source_id="my_datasource")
with open("gooddata_ldm.json", "w") as f:
json.dump(gd_model_to_dict(gd_model), f, indent=2)uv sync --group dev
uv run pytest| GoodData LDM | Ossie Semantic Model |
|---|---|
| Dataset | Dataset |
| Attribute (+ Labels) | Field with dimension metadata |
| Fact | Field without dimension metadata |
| Source column data type | Field datatype |
| Reference (FK) | Relationship |
| Date Instance | Dataset with GOODDATA custom_extension (date_dimension: true) |
| MAQL expression | Dialect entry (dialect: MAQL) |
| GoodData source type | Ossie DataType |
|---|---|
STRING |
String |
INT |
Integer |
NUMERIC |
Decimal |
BOOLEAN |
Boolean |
DATE |
Date |
TIMESTAMP |
DateTime |
TIMESTAMP_TZ |
DateTimeTz |
Only an explicitly present GoodData sourceColumnDataType becomes an Ossie
datatype. If GoodData omits the source type, the Ossie datatype remains
unspecified rather than being inferred from whether the field is an attribute or fact.
Unknown GoodData source types become Opaque and their exact value is retained in a
GOODDATA custom extension for lossless round trips. Regular GoodData attributes remain
explicitly non-time dimensions even when their source column has a temporal data type;
GoodData date instances continue to carry the time-dimension role.
- Metrics are not converted. GoodData metrics use MAQL, a context-aware metric language where dimensionality and filters are applied at report time. The current Ossie metric model is SQL-expression-based and cannot represent this paradigm.
- AggregatedFacts are not yet supported.
- Workspace data filters are not mapped.
- GoodData has only one
NUMERICsource type, so exporting OssieFloatloses the distinction between approximate and exact numeric values. - GoodData has no time-only source type. Ossie
Timefields retain the existing attribute or fact default and emit a warning when exported. - Ossie
Opaquefields require an exact GoodData source type in theirGOODDATAextension for lossless export; otherwise the role default is used with a warning.