validator.modules.utils_validations

OntoUML Input Validation and Assumption Normalization Module.

This module contains utility functions for validating input parameters and assumptions used in OntoUML validation processes. These utility functions are designed to ensure the correctness of input data and assumptions, contributing to the reliability of the OntoUML validation process.

Module Contents

Functions

validate_input_extension(input_extension)

Validate the input file format provided by a user for ensuring RDFLib-compatible graph.

validate_assumption(world_assumption)

Validate and normalize a world-assumption parameter.

validator.modules.utils_validations.validate_input_extension(input_extension)

Validate the input file format provided by a user for ensuring RDFLib-compatible graph.

This function validates the file extension of the input OntoUML model to ensure it is compatible with supported formats. It checks against a predefined list of RDFLib’s allowed graph and JSON formats and raises an error if the provided input extension is invalid.

Parameters:

input_extension (str) – Path to the input file to be validated.

validator.modules.utils_validations.validate_assumption(world_assumption)

Validate and normalize a world-assumption parameter.

This function takes a world_assumption parameter, converts it to lowercase, and removes leading and trailing whitespace. It then checks if the normalized assumption is either “owa” (Open World Assumption) or “cwa” (Closed World Assumption). If it is, the value is returned. If not, an error is raised by a specific function.

Parameters:

world_assumption (str) – The world assumption to be validated and normalized.

Returns:

The validated and normalized world assumption (“owa” or “cwa”).

Return type:

str