You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ossie.apache.org by "liofnv (via GitHub)" <gi...@apache.org> on 2026/10/15 23:38:24 UTC
[PR] feat(nvidia): export Auto Ontology terms as an Ossie ontology and mapping [ossie]
liofnv opened a new pull request, #590:
URL: https://github.com/apache/ossie/pull/590
## 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 `import` command can now also write an Ossie [ontology](https://github.com/apache/ossie/blob/main/ontology/ontology.md) and a [mapping document](https://github.com/apache/ossie/blob/main/ontology/ontology.md#mapping-documents) that populates it from the semantic model:
```bash
uv run ossie-nvidia-auto-ontology import \
--input tpch.auto_ontology.yaml \
--output tpch.semantic_model.yaml \
--ontology-output tpch.ontology.yaml \
--mapping-output tpch.mapping.yaml
```
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
| Semantic model | Ontology | Mapping |
|---|---|---|
| Dataset | Entity concept, named in PascalCase | One concept mapping |
| Primary key, else the first unique key | `identify_by` | Object mappings: one expression for a single-field key, referent mappings otherwise |
| Field with a portable `datatype` | `ManyToOne` relationship to the built-in value type, or `OneToOne` when the field alone identifies the concept | Link mapping from the field |
| Relationship | `ManyToOne` relationship to the referenced concept | Link mapping to the referenced concept's objects |
A 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 `OrderLineItem` example.
Nothing is guessed:
- A field whose type is unknown, or has no built-in value type (`Time`, `Opaque`), is left out.
- A concept whose dataset has no usable key is declared but not mapped.
- Relationships are verbalized from their field names (`{Customer} has Account Balance {Decimal}`), because Auto Ontology records no verbalizations.
### Export changes the mapping needs
- **Names.** Auto Ontology keeps term names unique across every database it catalogs, so it renames a term to `Name (database.schema.table)` when another database already uses the name. An Ossie document is its own namespace, so the dataset is exported as `Name` wherever that is free in the document. The term keeps its full name on the way back.
- **Key columns.** Auto Ontology gives a foreign-key column no attribute. A key or relationship column that no field exposes is now exported as a field, so the mapping can reference it. It is marked so it does not become an attribute on the way back.
## Testing
- `uv run pytest` in `converters/nvidia`: 118 passed, including 13 new tests (10 in `tests/test_ontology.py`).
- The three documents the CLI writes pass `validation/validate.py` against the core, ontology and mapping schemas (`test_cli_writes_three_documents_that_pass_official_validation`).
- The generated ontology parses with `converters/ontology`'s `OssieParser`.
- A live export of `SNOWFLAKE_SAMPLE_DATA.TPCH_SF1` gives 8 concepts and 64 relationships. 6 of the 8 concepts are mapped: `LINEITEM` and `PARTSUPP` have 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](https://www.apache.org/legal/generative-tooling.html).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(nvidia): export Auto Ontology terms as an Ossie ontology and mapping [ossie]
Posted by "liofnv (via GitHub)" <gi...@apache.org>.
liofnv commented on PR #590:
URL: https://github.com/apache/ossie/pull/590#issuecomment-6219058876
@jbonofre
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] feat(nvidia): export Auto Ontology terms as an Ossie ontology and mapping [ossie]
Posted by "jbonofre (via GitHub)" <gi...@apache.org>.
jbonofre merged PR #590:
URL: https://github.com/apache/ossie/pull/590
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@ossie.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org