Skip to content

Add Ossie → wisdom domain export direction#14

Closed
mwu-wisdom wants to merge 3 commits into
apache:mainfrom
mwu-wisdom:osi-to-wisdom
Closed

Add Ossie → wisdom domain export direction#14
mwu-wisdom wants to merge 3 commits into
apache:mainfrom
mwu-wisdom:osi-to-wisdom

Conversation

@mwu-wisdom

@mwu-wisdom mwu-wisdom commented Jul 10, 2026

Copy link
Copy Markdown

Note

Stacked on #13 — review only the top commit (Add Ossie -> wisdom domain export direction); the first two commits belong to #13. I'll rebase this branch once #13 merges.

What

Adds the reverse direction to the wisdom converter: ossie-wisdom osi-to-wisdom -i semantic_model.yaml -o domain-export.json turns an Ossie document into a WisdomAI domain export (format 1.0) that wisdom's importDomain API can consume.

Design

The mapping is the exact inverse of wisdom-to-osi, so round-trips are stable in both directions:

  • Model ai_context splits back into domainSystemInstructions (leading text) + one knowledge item per - bullet.
  • A field whose expression is just its own (possibly quoted) name becomes a column; anything else becomes a formula. dimension.is_time maps to a TIMESTAMP data type (wisdom re-derives exact types from the warehouse).
  • Relationships become MANY_TO_ONE edges (Ossie's from = many side); the ai_context notes written by the import direction restore ONE_TO_ONE/MANY_TO_MANY, and composite keys become compound AND join conditions.
  • Metrics attach to the table their expression references (fallback to the first dataset with a METRIC_TABLE_UNRESOLVED warning).
  • All IDs are derived deterministically from element names, so re-runs are reproducible; connections are per-dialect placeholders (et-connection-snowflake, …) expected to be remapped at import.
  • Not representable in wisdom — dropped with warnings via the existing ConverterIssue pattern: semantic models beyond the first, unique_keys, custom_extensions, and ai_context on fields/metrics (plus synonyms/examples anywhere).

Testing

  • 12 new tests (27 total in the converter), including full round-trip equality (OSI → wisdom → OSI yields an identical OSIDocument) and determinism of the emitted export.
  • Verified against two real wisdom domain exports (Snowflake and BigQuery): OSI → wisdom → OSI round-trips are byte-identical YAML for both.

mwu-wisdom and others added 3 commits July 10, 2026 15:47
Adds converters/wisdom, a one-way converter from a WisdomAI domain
export JSON (format 1.0) to an Ossie semantic model YAML, following
the layout of the dbt converter.

Mapping: domain -> semantic model; domain knowledge and system
instructions -> model-level ai_context; tables/columns/formulas ->
datasets/fields; relationship graph -> relationships (cardinality
folded into edge direction, compound AND-joins flattened to composite
keys); per-table measures -> model-level metrics.

Expressions are emitted verbatim under the dialect mapped from the
table's connection (snowflake, databricks), falling back to ANSI_SQL
with a warning for unsupported dialects. Information loss is reported
through the same ConverterResult/ConverterIssue pattern as ossie-dbt.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds WISDOM to the OSIVendor enum, the vendor examples in the spec
documents and JSON schema, and the supported-vendors table in the
converter guide.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds osi-to-wisdom, the reverse of the wisdom converter: an Ossie
document becomes a wisdom domain export (format 1.0) consumable by
wisdom's importDomain API.

The mapping inverts wisdom-to-osi so round-trips are stable in both
directions: model ai_context splits back into system instructions and
knowledge items, fields split into columns and formulas, relationship
direction is read as many-to-one with ai_context notes restoring
one-to-one/many-to-many and composite keys becoming compound AND join
conditions, and metrics attach to the table their expression
references. IDs are deterministic (derived from names) and connections
are per-dialect placeholders remapped at import time.

Verified: Ossie -> wisdom -> Ossie round-trips of two real domain
exports are byte-identical.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@mwu-wisdom

Copy link
Copy Markdown
Author

Folding this into #13 as a single PR covering both directions — the reverse converter edits files introduced there, so they can't be reviewed independently.

@mwu-wisdom mwu-wisdom closed this Jul 10, 2026
@mwu-wisdom
mwu-wisdom deleted the osi-to-wisdom branch July 10, 2026 23:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant