*** Settings ***
Documentation    Integration smoke tests for UKO ontology loader
Resource         ${CURDIR}/common.resource
Suite Setup      Setup Test Environment
Suite Teardown   Cleanup Test Environment

*** Variables ***
${HELPER}      ${CURDIR}/helper_uko_ontology.py

*** Test Cases ***
Load UKO Ontology From TTL File
    [Documentation]    Load docs/ontology/uko.ttl and verify parsing succeeds
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    load-ttl    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    uko-load-ok

Validate UKO Ontology
    [Documentation]    Load and validate the ontology with no errors
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    validate    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    uko-validate-ok

Resolve Inheritance Chain
    [Documentation]    Resolve uko-oo:Class inheritance chain through layers
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    resolve-inheritance    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    uko-inheritance-ok

Get Layer Nodes
    [Documentation]    Retrieve all Layer 0 foundation nodes
    ${result}=    Run Process    ${PYTHON}    ${HELPER}    layer-nodes    cwd=${WORKSPACE}
    Log    ${result.stdout}
    Log    ${result.stderr}
    Should Be Equal As Integers    ${result.rc}    0
    Should Contain    ${result.stdout}    uko-layer-nodes-ok
