Repository navigation
Fail closed on malformed native YAML ontologies - #185
Merged
Merged
Conversation
Add CanonicalOntology::validate_structure and run it from the native YAML adapter: undeclared class references, duplicate class, relationship and (owner_class, property) names fail load and name the offender. Reject unknown keys and unrecognised direction values; omitted direction still defaults to out. Closes #165
Collaborator
Author
|
Model: Gemini 4 Argon (gemini-4-argon) (Gemini API) |
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
Loading a native YAML ontology accepted undeclared class references, duplicate relationship names and unknown keys without error, and an unrecognised
directionfell back toout. A typo in the ontology file passed silently and surfaced later as a confusing intent error or not at all.Done when
bogus_keypresent, serde reportsunknown field `bogus_key`; without it, the error isundeclared class 'Ghost' in to_class of relationship 'R'; duplicate relationship name 'R'.OUT,bogus, empty), omitted and explicit directions, and the committed native examples still loading.cargo test --workspacepasses.Notes
otg schemacan no longer emit a schema.json that kept only the last from/to pair.string; that is out of scope here.directionstill defaults toout.manufacturing.owl.ttlandmanufacturing.jsonldexamples (datatype ranges become relationships to undeclaredstring/integerclasses) andmanufacturing.obo(a[Typedef]stanza becomes a class with undeclared superclassrelationship). Those adapters need a separate fix first.Closes #165