*** 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
