Repository navigation
Load .shacl.ttl and .skos.ttl as SHACL and SKOS; fail duplicate LinkML class names - #189
Merged
Merged
Conversation
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.
Closes #188
Why
A typical SHACL or SKOS Turtle file was not loaded by the SHACL or SKOS adapter. The Turtle/OWL probe runs first and claimed any path ending in
.ttl, so a.shacl.ttlfile loaded asturtle_owlwithout SHACL constraint extraction, and a.skos.ttlfile loaded asturtle_owlwithoutConceptandbroader/narrower/related. A.skos.ttlfile that only declaredskos:Conceptandskos:broadersucceeded with 0 classes and 0 relationships.Separately, a LinkML file that declared the same class name twice succeeded with only the last declaration, because the repeated YAML key was collapsed before the structural check could see it.
Done when
.shacl.ttlloads as SHACL, not as Turtle/OWL..skos.ttlloads as SKOS, not as Turtle/OWL. A file that only declaresskos:Conceptandskos:broaderdoes not succeed with 0 classes and 0 relationships.examples/manufacturing.owl.ttlstill loads.examples/manufacturing.native.yaml,examples/part_usage.native.yaml,examples/movies.native.yaml,examples/plm/plm.native.yaml,examples/manufacturing.linkml.yaml,examples/manufacturing.obo,examples/manufacturing.jsonld, andexamples/manufacturing.owl.ttl.load_ontology/load_ontology_from_pathcan load, with no per-format skip and no weaker check..shacl.ttlload as SHACL, a.skos.ttlload as SKOS including a concepts-only file, and a LinkML duplicate class name.cargo test --workspacepasses. No docs, version, dependency, or workflow changes.Notes
source.formatis nowshaclfor a.shacl.ttlfile with prefix declarations, anowl:Classand ash:NodeShape, andskosfor.skos.ttlfiles. A concepts-only.skos.ttlfile now loads with classConceptand relationshipsbroader,narrower,related.examples/manufacturing.owl.ttlstill loads asturtle_owlwith the same 7 classes and 7 relationships. Adapter probe order is unchanged; only paths ending in.shacl.ttl/.skos.ttlare no longer claimed by Turtle/OWL. Content-based detection for other.ttlpaths is unchanged.otg schemaon a LinkML file with twoWidgetkeys underclassesnow exits 1 witherror: yaml error: classes: duplicate class name 'Widget' at line 5 column 3. Duplicateslotskeys are not changed by this PR..shacl.ttl/.skos.ttlpaths exit 1 withvalidation error: undeclared class 'Ghost' in to_class of relationship 'has_ghost',duplicate class name 'Widget', andduplicate relationship name 'linked'.cargo test --workspace: 169 passed, 0 failed (157 on main).cargo clippy --workspace --all-targets -- -D warningsexits 0; the existingunused dependency oxirimanifest warning is unchanged.