khyari hamza
|
ad53a659de
|
feat(uko): add UKO ontology scaffolding
Add UKO Layer 0-3 ontology skeleton (RDF/TTL) with base URI, version IRI,
and prefix conventions. Python loaders handle URI parsing, inheritance
resolution, versioning metadata, and validation of undefined prefixes and
missing rdf:type. Includes Behave BDD scenarios, Robot Framework integration
tests, ASV benchmarks, and reference documentation.
- Resolve rdfs:domain and rdfs:range values to full URIs in parser
- Fix type: ignore in Robot helper with proper Callable typing
- Export UKO models from core/__init__.py
- Add parent-URI existence validation in validate()
- Rename scenario to clarify parser-skips vs validation-rejects
- Add scenario testing validation with injected typeless node
- Add Scenario Outline for multi-layer node count assertions
- TTL: Layer 0 classes (InformationUnit, Container, Atom, Annotation,
Boundary) with contains/references/dependsOn properties. Layer 1
uko-code: classes (Module, Callable, TypeDefinition, TestCase, Import)
with hasReturnType/hasParameters/testsCallable. Layer 2 uko-oo: classes
(Class, Interface, Method, Attribute) with inheritsFrom/implements and
rdfs:subPropertyOf. New URI scheme cleveragents.ai/ontology/uko#.
- TTL: uko-oo:Class has dual rdfs:subClassOf (TypeDefinition + Container),
uko-oo:Interface has dual rdfs:subClassOf (TypeDefinition + Boundary).
- Model: UKONode.parent_uri replaced with parent_uris: tuple[str, ...]
to support multi-parent rdfs:subClassOf.
- Loader: prefix regex supports hyphenated names (uko-code, uko-oo).
Semantic domain prefix maps (_LAYER_PREFIXES, _LAYER_IRI_PREFIXES).
Comma-separated rdfs:subClassOf parsing. rdfs:domain/range/subPropertyOf
URI resolution. BFS DAG traversal with DFS cycle detection for
resolve_inheritance. HTTP URI skip in validation (D-1 fix). Duplicate
error guard (B-1 fix). Consistent quoting (M-1 fix).
- Services __init__: export UKOLoader and UKOValidationError.
- Tests: 24 Behave scenarios (multi-parent, domain/range resolution,
non-existent parent validation). 4 Robot smoke tests. Consolidated
context attributes (T-3 fix).
- Docs: uko.md written for spec-aligned structure.
- Namespace prefix match in parent-URI validation includes a
delimiter guard (# or /) preventing false positives on URIs that share
the UKO prefix string (e.g. ukobogus:, ukoo:).
ISSUES CLOSED: #189
|
2026-03-04 22:40:34 +00:00 |
|