Repository navigation
feat(ossie): explain ontology and mapping documents on import - #116
Merged
Merged
Conversation
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>
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.
Why
Apache Ossie recently split its Flights example into three documents (apache/ossie#458):
flights.ontology.yaml(business concepts),flights.semantic_model.yaml(datasets) andflights.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
parseOssienow names the document type when there are nodatasets:ontology:list, also the legacy combinedflights.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."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" (fromsemantic_model_ref.iri, capped at 200 chars; generic hint when it is missing).detectModelFormatroutes pasted text with a top-levelontology/concept_mappingskey 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
semantic_model_ref, generic fallback; detection of pasted ontology/mapping text.main: the semantic model imports (6 marts); the other three show the new messages.tsc --noEmitclean.🤖 Generated with Claude Code