Skip to content

feat(ossie): explain ontology and mapping documents on import - #116

Merged
Obolrus merged 1 commit into
mainfrom
feat/ossie-ontology-message
Oct 11, 2026
Merged

Obolrus merged 1 commit into
mainfrom
feat/ossie-ontology-message

Conversation

@obolonsky-owox

Copy link
Copy Markdown
Collaborator

Why

Apache Ossie recently split its Flights example into three documents (apache/ossie#458): flights.ontology.yaml (business concepts), flights.semantic_model.yaml (datasets) and flights.mapping.yaml (ontology ↔ semantic model). The canvas imports semantic models only. Importing the ontology from GitHub failed with "This file isn't an Ossie model". That message is misleading: the file is Ossie, just not a semantic model.

What

  • parseOssie now names the document type when there are no datasets:
    • Ontology (ontology: list, also the legacy combined flights.yaml): "This is an Apache Ossie ontology (business concepts), not a semantic model. The canvas imports semantic models: import the file with a top-level "datasets" list instead."
    • Mapping (concept_mappings: list): "This is an Apache Ossie mapping document, not a semantic model. Import the semantic model it points to instead: ./flights.semantic_model.yaml" (from semantic_model_ref.iri, capped at 200 chars; generic hint when it is missing).
    • Anything else keeps "This file isn't an Ossie model".
  • detectModelFormat routes pasted text with a top-level ontology / concept_mappings key to the Ossie reader, so pasting gets the same message instead of an empty OKF import.
  • ossie-format.md: a paragraph on ontologies and mappings not being imported yet, and which Flights example files work.

Importing ontologies as conceptual models is a possible follow-up once the ontology spec settles.

Tests

  • okf: ontology, legacy combined file, mapping with and without semantic_model_ref, generic fallback; detection of pasted ontology/mapping text.
  • web: ontology via file upload and via paste shows the message.
  • Ran the four real Flights files from apache/ossie main: the semantic model imports (6 marts); the other three show the new messages.
  • okf 167/167, web 726/726, server 65/65, tsc --noEmit clean.

🤖 Generated with Claude Code

Apache Ossie split its Flights example into an ontology, a semantic model
and a mapping document (apache/ossie#458). Importing the ontology or the
mapping failed with "This file isn't an Ossie model", which is misleading:
they are Ossie documents, just not semantic models.

The import now says what the file is. An ontology (`ontology:`, incl. the
legacy combined flights.yaml) asks for the file with a top-level
"datasets" list; a mapping (`concept_mappings:`) names the semantic model
it points to (`semantic_model_ref.iri`). Pasted ontology/mapping text is
routed to the Ossie reader so it gets the same message. The Ossie guide
documents the limit.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@Obolrus
Obolrus merged commit b8ecfb7 into main Oct 11, 2026
@Obolrus
Obolrus deleted the feat/ossie-ontology-message branch October 11, 2026 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants