Repository navigation
feat(nvidia): export Auto Ontology terms as an Ossie ontology and mapping - #590
Merged
Merged
Conversation
This was referenced Oct 15, 2026
Contributor
Author
liofnv
force-pushed
the
feat/nvidia-ontology-export
branch
from
October 16, 2026 18:08
4e9d27d to
678c075
Compare
jbonofre
self-requested a review
October 16, 2026 19:13
jbonofre
previously approved these changes
Oct 16, 2026
jbonofre
left a comment
Member
There was a problem hiding this comment.
Thanks @liofnv for this PR!
The ontology and standalone mapping report (ontology.py) is very clean, well-aligned with the ontology/mapping specifications, and the round-trip handling for database-qualified term names and key_column fields is well thought out. Great test coverage with the schema validator as well.
Two minor observations for potential follow-up:
- In
_identity()(ontology.py), checkingset(relationship["from_columns]") <= set(key)in addition tocolumn in relationship["from_columns"]would prevent a composite foreign key from being treated as an identifying link when only a subset of its columns is part of the dataset's key. - In
_referent_mappings(), tracking avisitedset of concepts when recursing through identifying link would guard againstRecursionErrorif a schema ever has cyclic identifying relationships.
LGTM 👍
Let's merge #589 first once CI completed, then I will merge this one.
…ping Auto Ontology's terms are business concepts, its attributes are properties of those concepts, and its foreign keys link one concept to another, but the converter wrote only the semantic model. The import command now also writes an Ossie ontology and a mapping document that populates it from that model (--ontology-output, --mapping-output; convert_auto_ontology_to_ossie_ontology). Each dataset becomes an entity concept identified by its primary key, or its first unique key. Each field with a portable datatype becomes a relationship to the built-in value type, and each relationship a many-to-one link to the referenced concept. A key made of a link and a field is mapped through nested referent mappings, as in the specification's own examples. A concept whose dataset has no usable key is declared but not mapped. Two export changes make that possible: - A term Auto Ontology renamed `Name (database.schema.table)` to keep names unique across databases is exported as `Name` where that is free in the document, and keeps its full name on the way back. - A key or relationship column that no field exposes, such as a foreign-key column Auto Ontology gives no attribute, is exported as a field, so the mapping can reference it. It is marked so it does not become an attribute on the way back.
jbonofre
force-pushed
the
feat/nvidia-ontology-export
branch
from
October 16, 2026 19:32
678c075 to
e95f71f
Compare
jbonofre
approved these changes
Oct 16, 2026
liofnv
added a commit
to NVIDIA/auto-ontology
that referenced
this pull request
Oct 16, 2026
The ontology export merged upstream in apache/ossie#590, so the converter no longer comes from a fork.
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.
Summary
Builds on #589. Please review only the last commit (
4e9d27d); the first commit is #589, and this diff shrinks to that commit once #589 merges.Auto Ontology's terms are business concepts, its attributes are properties of those concepts, and its foreign keys link one concept to another. The converter wrote only the semantic model, so an exported Auto Ontology model showed no concepts, relationships or mappings. The
importcommand can now also write an Ossie ontology and a mapping document that populates it from the semantic model:The same is available as
convert_auto_ontology_to_ossie_ontology. The mapping references both other documents by name and, from the CLI, by a path relative to itself.How the ontology is read off the semantic model
identify_bydatatypeManyToOnerelationship to the built-in value type, orOneToOnewhen the field alone identifies the conceptManyToOnerelationship to the referenced conceptA key made of a link and a field, such as a TPC-H line item's order and line number, is mapped through nested referent mappings, as in the specification's own
OrderLineItemexample.Nothing is guessed:
Time,Opaque), is left out.{Customer} has Account Balance {Decimal}), because Auto Ontology records no verbalizations.Export changes the mapping needs
Name (database.schema.table)when another database already uses the name. An Ossie document is its own namespace, so the dataset is exported asNamewherever that is free in the document. The term keeps its full name on the way back.Testing
uv run pytestinconverters/nvidia: 118 passed, including 13 new tests (10 intests/test_ontology.py).validation/validate.pyagainst the core, ontology and mapping schemas (test_cli_writes_three_documents_that_pass_official_validation).converters/ontology'sOssieParser.SNOWFLAKE_SAMPLE_DATA.TPCH_SF1gives 8 concepts and 64 relationships. 6 of the 8 concepts are mapped:LINEITEMandPARTSUPPhave no key, because Snowflake declares none and their keys are composite. With the TPC-H primary keys declared, all 8 are mapped.AI disclosure
This contribution was prepared with AI assistance (Claude Code), per the ASF Generative Tooling Guidance.