Add WisdomAI domain converter (both directions)#13
Open
mwu-wisdom wants to merge 3 commits into
Open
Conversation
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>
Author
|
@jbonofre Would appreciate if you could help take a look for our team to land the converter changes. |
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds
converters/wisdom, a bidirectional converter between WisdomAI domain exports (format1.0, the JSON produced by wisdom'sexportDomainAPI and consumed byimportDomain) and Ossie semantic model YAML. It follows the layout and conventions of the dbt converter (apache-ossiedependency,ConverterResult/ConverterIssueloss reporting, argparse CLI). Also registersWISDOMas a well-known custom-extension vendor in the spec documents andOSIVendorenum.Import mapping (wisdom → Ossie)
semantic_model[].name/descriptionref.name/descriptionai_context(model level)domainSystemInstructions+ domain knowledge contents as a bulleted listdatasets[]location.database.schema.dbTable→source;primaryKey.columnsorisPrimaryKeyflags →primary_key)datasets[].fields[]displayName→label; DATE/DATETIME/TIMESTAMP →dimension.is_timerelationships[]from= many side); compound AND-joins flattened to composite key arrays; OR/non-equi joins dropped with a warningmetrics[]Expressions are emitted verbatim under the Ossie dialect mapped from the table's connection (
snowflake → SNOWFLAKE,databricks → DATABRICKS); other dialects fall back toANSI_SQLverbatim with anUNSUPPORTED_DIALECTwarning.Export mapping (Ossie → wisdom)
The exact inverse, so round-trips are stable in both directions:
ai_contextsplits back intodomainSystemInstructions(leading text) + one knowledge item per-bullet.dimension.is_timemaps to aTIMESTAMPdata type (wisdom re-derives exact types from the warehouse).MANY_TO_ONEedges; theai_contextnotes written by the import direction restoreONE_TO_ONE/MANY_TO_MANY, and composite keys become compoundANDjoin conditions.unique_keys,custom_extensions, andai_contexton fields/metrics (plus synonyms/examples anywhere).Testing
OSI → wisdom → OSIyields an identicalOSIDocument), and determinism of the emitted export.validation/validate.pyfully (schema, uniqueness, reference integrity, sqlglot SQL parsing), andOSI → wisdom → OSIround-trips are byte-identical YAML for both.🤖 Generated with Claude Code