Files
cleveragents-core/robot/uko_ontology_registry.robot
T
hamza.khyari 04f24b39c0
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 16s
CI / quality (pull_request) Successful in 19s
CI / security (pull_request) Successful in 33s
CI / typecheck (pull_request) Successful in 38s
CI / unit_tests (pull_request) Successful in 2m26s
CI / docker (pull_request) Successful in 40s
CI / integration_tests (pull_request) Successful in 3m29s
CI / coverage (pull_request) Successful in 4m30s
CI / benchmark-regression (pull_request) Has been cancelled
feat(acms): implement UKO Layer 1 Domain Ontologies (uko-code, uko-doc, uko-data, uko-infra)
Implement the four Layer 1 domain-specific OWL/Turtle ontology vocabularies
that specialize Layer 0 universal concepts for specific knowledge domains.

Ontology (docs/ontology/uko.ttl):
- Added uko-doc: namespace with 17 classes (Document, Part, Chapter, Section,
  Subsection, Paragraph, Sentence, CodeBlock, Citation, Figure, Table,
  Footnote, Annotation, Bookmark, CrossReference, PageBreak, SectionBreak),
  5 properties, and 4 relationships
- Added uko-data: namespace with 13 classes (Schema, Table, Column, View,
  StoredProcedure, Constraint, Index, ForeignKey, Trigger, Annotation,
  Bookmark, PartitionBoundary, ShardBoundary), 6 properties, and
  5 relationships
- Added uko-infra: namespace with 7 classes (Service, Network, Endpoint,
  ConfigKey, Volume, FirewallRule, SubnetBoundary) and 2 relationships
- All classes use rdfs:subClassOf from Layer 0 base classes

Domain registry (ontology_registry.py):
- DomainDescriptor dataclass with namespace IRI, prefix, layer, classes,
  superclass mappings, and DetailLevelMap
- Registry functions: get_domain(), list_domains(), get_layer1_domains()
- DetailLevelMap chain builder for hierarchical depth resolution
- Turtle validation with TurtleValidationError (no rdflib dependency)
- All DetailLevelMap data inlined to maintain DIP compliance (domain
  layer does not import from application layer)

DetailLevelMap presets (depth_breadth_projection.py):
- code_detail_map: 10 spec-complete levels (depths 0-9)
- docs_detail_map: 11 spec-complete levels (depths 0-10)
- database_detail_map: 12 spec-complete levels (depths 0-11)
- infra_detail_map: 9 spec-complete levels (depths 0-8)

Tests:
- 31 BDD scenarios in uko_ontology_registry.feature covering domain
  lookup, all DetailLevelMap levels, inheritance chains, Turtle
  validation, Universal View Guarantee, and negative/edge cases
- 6 Robot Framework integration tests
- Updated existing tests: depth_breadth_projection.feature (TABLE_LISTING
  depth 0->1, added SCHEMA_LISTING), uko_ontology.feature (Layer 1
  node count 8->67)

Spec reference: docs/specification.md §41830-42332

ISSUES CLOSED: #574
2026-03-06 23:14:30 +00:00

67 lines
3.1 KiB
Plaintext

*** Settings ***
Documentation Integration smoke tests for UKO Ontology Domain Registry.
... Validates domain lookup, DetailLevelMap resolution across
... all four Layer 1 domains, inheritance chain building,
... Turtle syntax validation, and the Universal View Guarantee.
Resource ${CURDIR}/common.resource
Suite Setup Setup Test Environment
Suite Teardown Cleanup Test Environment
*** Variables ***
${HELPER} ${CURDIR}/helper_uko_ontology_registry.py
*** Test Cases ***
Domain Lookup Smoke Test
[Documentation] Look up every registered domain prefix and verify
... IRI, layer, and class count match expectations.
${result}= Run Process ${PYTHON} ${HELPER} domain_lookup cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} DOMAIN_LOOKUP_PASSED
Detail Level Resolution Smoke Test
[Documentation] Resolve key named levels for every Layer 1 domain
... and verify integer depths match the spec.
${result}= Run Process ${PYTHON} ${HELPER} detail_level_resolution cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} DETAIL_LEVEL_RESOLUTION_PASSED
Inheritance Chain Smoke Test
[Documentation] Build a DetailLevelMap chain and verify inherited
... level resolution works across the chain.
${result}= Run Process ${PYTHON} ${HELPER} inheritance_chain cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} INHERITANCE_CHAIN_PASSED
Turtle File Validation Smoke Test
[Documentation] Validate the project ontology file docs/ontology/uko.ttl
... passes lightweight Turtle syntax validation.
${result}= Run Process ${PYTHON} ${HELPER} turtle_validate cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} TURTLE_VALIDATE_PASSED
Universal View Guarantee Smoke Test
[Documentation] Verify all Layer 1 domains resolve depth 0 to 0,
... confirming the universal depth interface.
${result}= Run Process ${PYTHON} ${HELPER} universal_view cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} UNIVERSAL_VIEW_PASSED
List All Domains Smoke Test
[Documentation] List all registered domains and verify the count
... and structure are correct.
${result}= Run Process ${PYTHON} ${HELPER} list_all_domains cwd=${WORKSPACE}
Log ${result.stdout}
Log ${result.stderr}
Should Be Equal As Integers ${result.rc} 0
Should Contain ${result.stdout} LIST_ALL_DOMAINS_PASSED