Repository navigation
Conversation
The load-time structural check now runs in AdapterRegistry::load, so OWL/Turtle, JSON-LD, OBO, SHACL, SKOS, LinkML and native YAML all fail closed on undeclared class references and duplicate class or relationship names. The committed OWL, JSON-LD and OBO examples previously produced undeclared classes (datatype ranges mapped to relationships with a string/integer to_class, and Typedef stanzas mapped to classes under an undeclared relationship superclass). Those mappings now produce properties and relationships that pass the check. Closes #186
|
Model: Gemini 4 Argon (gemini-4-argon) (Gemini API) |
Closes #186
Why
The load-time structural check (declared class references, unique class and relationship names, unique owner/property pairs) only ran for native YAML. OWL/Turtle, JSON-LD and OBO ontologies with a typo or an undeclared class still loaded silently. The check could not simply be turned on for every format because the committed OWL, JSON-LD and OBO examples themselves produced undeclared classes: datatype
rdfs:rangevalues became relationships pointing atstring/integer, and[Typedef]stanzas became classes under an undeclaredrelationshipsuperclass.Done when
otg schemaonexamples/manufacturing.owl.ttl,examples/manufacturing.jsonldandexamples/manufacturing.oboexits 0 and writes a schema.json (also exit 0 for the LinkML and native YAML examples).string,integerorrelationshipclasses.validation error: undeclared class 'Ghost' in to_class of relationship 'has_ghost',duplicate relationship name 'linked',duplicate class name 'Widget',undeclared class 'MFG:9999999' in super_classes of class 'Sprocket'.load_ontology/load_ontology_from_pathcan load, with no per-format skip and no weaker check.cargo test --workspacepasses (157 passed, 0 failed) andcargo clippy --workspace --all-targets -- -D warningspasses.Notes
manufacturing.owl.ttlis now identical to the one produced frommanufacturing.linkml.yaml. Compared with main, the OWL and JSON-LD output no longer lists datatype properties (sku,name,quantity, ...) as relationship types, and XSD ranges now set the property datatype (quantity,lead_time_days,tierbecomeinteger) instead of alwaysstring.[Typedef]stanzas now become relationship types, and the[Term]before them is no longer lost (main droppedLotfrom the example's schema.json).is_aandrelationship:targets are resolved from term ids to term names. When one relationship type is used from several terms, the first use sets its endpoints; later uses do not add duplicate entries.Concept, since its injectedbroader/narrower/relatedrelationships reference it.