Files
CoreRasurae e828acf175
CI / lint (push) Successful in 1m32s
CI / typecheck (push) Successful in 1m38s
CI / lint (pull_request) Successful in 1m30s
CI / typecheck (pull_request) Successful in 1m30s
CI / behave (3.11) (pull_request) Successful in 1m39s
CI / behave (3.12) (pull_request) Successful in 1m39s
CI / build (pull_request) Successful in 1m29s
CI / behave (3.13) (pull_request) Successful in 1m39s
CI / behave (3.11) (push) Successful in 1m39s
CI / behave (3.12) (push) Successful in 1m41s
CI / behave (3.13) (push) Successful in 1m37s
CI / build (push) Successful in 1m30s
feat: Initial version of CleverRDFLib
ISSUES CLOSED: #1
2025-12-19 22:26:14 +00:00
..

Robot Framework Tests for CleverRDFLib

This directory contains Robot Framework integration tests for the CleverRDFLib library.

Structure

  • test_data/ - Test ontology files (RDF/OWL files) used by the tests
  • libraries/ - Custom Python keyword libraries for Robot Framework
  • *.robot - Robot Framework test suite files

Test Suites

ontology_loader_tests.robot

Tests for the core OntologyLoader functionality:

  • Loading ontologies from files
  • Different loading strategies (depth-first, breadth-first)
  • Max depth constraints
  • Validation options

loading_result_tests.robot

Tests for the LoadingResult class:

  • Merged graph access
  • Loaded URI tracking
  • Success/failure indication
  • Error and warning tracking

class_hierarchy_tests.robot

Tests for the ClassHierarchy functionality:

  • Class hierarchy building
  • Parent/child relationships
  • Class navigation

owl_features_tests.robot

Tests for OWL-specific features:

  • Metadata extraction
  • OWL validation
  • Consistency checking
  • Version management

graph_operations_tests.robot

Tests for graph operations:

  • Triple queries
  • Graph structure verification
  • RDF/RDFS/OWL assertions

error_handling_tests.robot

Tests for error handling and exception scenarios:

  • Non-existent file handling
  • Invalid syntax handling
  • Error propagation
  • Exception types

Running Tests

Run all tests

nox -s integration_tests

Run specific test suite

nox -s integration_tests -- robot/ontology_loader_tests.robot

Run tests with specific tags

nox -s integration_tests -- --include basic robot/

Run slow tests

nox -s slow_integration_tests

Custom Keywords

The CleverRDFLibKeywords library provides custom keywords for testing:

  • Create Ontology Loader - Create an OntologyLoader instance
  • Load Ontology - Load an ontology from URI or file path
  • Load Ontology Should Succeed - Load and verify success
  • Load Ontology Should Fail - Load and verify failure
  • Result Should Have Loaded Count - Verify loaded count
  • Result Should Have No Errors - Verify no errors
  • Get Merged Graph - Get the merged RDF graph
  • Get Class Hierarchy - Get the class hierarchy
  • Class Hierarchy Should Contain Class - Verify class exists
  • Class Should Have Parent - Verify parent relationship
  • Class Should Have Child - Verify child relationship
  • Get OWL Metadata - Get OWL metadata
  • Get OWL Validation Result - Get validation result
  • Get OWL Consistency Result - Get consistency result
  • And more...

Test Data

Test data files are located in test_data/:

  • simple_ontology.ttl - Simple ontology with basic classes and properties
  • complex_ontology.ttl - Complex ontology with class hierarchy
  • invalid_ontology.ttl - Ontology with intentional issues for error testing

Notes

  • Robot Framework does not support the -c option
  • Remember to import os when working with OS-related functionality in Python libraries
  • Test results are written to build/reports/robot/