ontouml_models_lib ================== .. py:module:: ontouml_models_lib .. autoapi-nested-parse:: The `__init__.py` file for the OntoUML/UFO catalog package. This package provides a set of tools for manipulating and querying ontology models within the OntoUML/UFO framework. The library is designed to help users work with concepts and models that conform to the standards and practices outlined in the OntoUML/UFO Catalog, a structured and open-source repository containing high-quality, curated OntoUML and UFO ontology models. About the OntoUML/UFO Catalog ----------------------------- The OntoUML/UFO Catalog, also known as the FAIR Model Catalog for Ontology-Driven Conceptual Modeling Research, is a comprehensive and collaborative repository that supports empirical research in OntoUML and UFO, as well as in general conceptual modeling. It offers a diverse collection of models in machine-readable formats (JSON and Turtle) that are accessible via permanent identifiers. These models cover various domains and are created by modelers with differing levels of expertise. Public API ---------- This file defines the public API of the package, exposing the following classes and enumerations: Public Classes -------------- - **Catalog**: Manages a collection of ontology models, enabling queries across multiple models within the catalog. - **Query**: Encapsulates SPARQL queries, providing methods for loading, hashing, and executing queries. - **Model**: Represents an individual ontology model, allowing for querying and metadata management. Public Enumerations ------------------- - **OntologyPurpose**: Enumerates the standardized purposes for which an ontology model may be designed. - **OntologyDevelopmentContext**: Enumerates the possible development contexts for an ontology model. - **OntologyRepresentationStyle**: Enumerates the representation styles adopted in an ontology model. - **OntologyType**: Enumerates the categories of ontologies according to their scope. Intended Use ------------ This library is specifically designed to assist users in manipulating and querying ontology models that conform to the OntoUML/UFO standards. It provides a robust framework for interacting with the formal representations of concepts, relations, and constraints that are central to the OntoUML/UFO modeling approach. **Example**:: >>> from ontouml_models_lib import Catalog, Query, Model >>> catalog = Catalog('/path/to/catalog') >>> query = Query('/path/to/query.sparql') >>> model = Model('/path/to/ontology_model_folder') For more information on the OntoUML/UFO project and to access the latest models, please visit the official repository: https://github.com/OntoUML/ontouml-models Subpackages ----------- .. toctree:: :maxdepth: 1 /autoapi/ontouml_models_lib/utils/index Submodules ---------- .. toctree:: :maxdepth: 1 /autoapi/ontouml_models_lib/catalog/index /autoapi/ontouml_models_lib/enumerations/index /autoapi/ontouml_models_lib/model/index /autoapi/ontouml_models_lib/query/index Classes ------- .. autoapisummary:: ontouml_models_lib.Catalog ontouml_models_lib.Query ontouml_models_lib.Model ontouml_models_lib.OntologyPurpose ontouml_models_lib.OntologyDevelopmentContext ontouml_models_lib.OntologyRepresentationStyle ontouml_models_lib.OntologyType Package Contents ---------------- .. py:class:: Catalog(catalog_path, limit_num_models = 0) Bases: :py:obj:`ontouml_models_lib.utils.queryable_element.QueryableElement` Manages a collection of ontology models in the OntoUML/UFO Catalog. The `Catalog` class allows loading, managing, and executing queries on multiple ontology models. It compiles graphs of individual models into a cohesive dataset, enabling complex queries across the entire catalog. This class inherits from `QueryableElement`, which provides functionality to execute SPARQL queries using RDFLib. :ivar path: The path to the catalog directory. :vartype path: str :ivar path_models: The path to the directory containing the ontology model subfolders. :vartype path_models: str :ivar models: A list of `Model` instances representing the loaded ontology models. :vartype models: list[Model] :ivar graph: An RDFLib `Graph` object representing the merged graph of all ontology models. :vartype graph: rdflib.Graph Examples -------- Basic usage example of the `Catalog` class: >>> from ontouml_models_lib import Catalog >>> from ontouml_models_lib import Query >>> # Initialize the catalog with the path to the directory >>> catalog = Catalog('/path/to/catalog') >>> # Load a specific query from a file >>> query = Query('./queries/query.sparql') >>> # Execute the query on all models in the catalog >>> catalog.execute_query_on_all_models(query) >>> # Execute multiple queries on all models in the catalog >>> queries = Query.load_queries('./queries') >>> catalog.execute_queries_on_all_models(queries) >>> # Execute multiple queries on a specific model >>> model = catalog.get_model('some_model_id') >>> catalog.execute_queries_on_model(queries, model) .. py:attribute:: catalog_path .. py:attribute:: path :type: pathlib.Path .. py:attribute:: path_models :type: pathlib.Path .. py:attribute:: models :type: list[ontouml_models_lib.model.Model] :value: [] .. py:attribute:: graph :type: rdflib.Graph .. py:method:: execute_query_on_models(query, models, results_path = None) Execute a specific Query on a specific Model and save the results. This method runs a single SPARQL query on a specific ontology model and saves the results to the specified directory. If no directory is provided, the results are saved in the default "./results" directory. :param query: A Query instance representing the SPARQL query to be executed. :type query: Query :param models: A list of Model instances on which the query will be executed. :type models: list[Model] :param results_path: Optional; Path to the directory where the query results should be saved. If not provided, defaults to "./results". :type results_path: Optional[Union[str, Path]] :raises FileNotFoundError: If the provided results path does not exist and cannot be created. :raises Exception: For any other errors that occur during query execution. **Example**:: >>> from ontouml_models_lib import Catalog >>> from ontouml_models_lib import Query >>> catalog = Catalog('/path/to/catalog') >>> query = Query('./queries/query.sparql') # Load a SPARQL query from a file >>> model = catalog.get_model('some_model_id') # Retrieve a model by its ID >>> catalog.execute_query_on_model(query, model) .. py:method:: execute_query_on_all_models(query, results_path = None) Execute a single Query instance on all loaded Model instances in the catalog and save the results. This method runs a single SPARQL query across all ontology models loaded in the catalog. The results are saved in the specified directory, or in the default "./results" directory if no directory is provided. :param query: A Query instance representing the SPARQL query to be executed on all models. :type query: Query :param results_path: Optional; Path to the directory where the query results should be saved. If not provided, defaults to "./results". :type results_path: Optional[Union[str, Path]] :raises FileNotFoundError: If the provided results path does not exist and cannot be created. :raises Exception: For any other errors that occur during query execution. **Example**:: >>> from ontouml_models_lib import Catalog >>> from ontouml_models_lib import Query >>> catalog = Catalog('/path/to/catalog') >>> query = Query('./queries/query.sparql') # Load a SPARQL query from a file >>> catalog.execute_query_on_all_models(query) # Execute the query on all models .. py:method:: execute_queries_on_model(queries, model, results_path = None) Execute a list of Query instances on a specific Model instance and save the results. This method runs multiple SPARQL queries on a specific ontology model. The results of each query are saved in the specified directory, or in the default "./results" directory if no directory is provided. :param queries: A list of Query instances to be executed on the model. :type queries: list[Query] :param model: A Model instance on which the queries will be executed. :type model: Model :param results_path: Optional; Path to the directory where the query results should be saved. If not provided, defaults to "./results". :type results_path: Optional[Union[str, Path]] :raises FileNotFoundError: If the provided results path does not exist and cannot be created. :raises Exception: For any other errors that occur during query execution. **Example**:: >>> from ontouml_models_lib import Catalog >>> from ontouml_models_lib import Query >>> catalog = Catalog('/path/to/catalog') >>> model = catalog.get_model('some_model_id') # Retrieve a model by its ID >>> queries = Query.load_queries('./queries') # Load multiple SPARQL queries from a directory >>> catalog.execute_queries_on_model(queries, model) .. py:method:: execute_queries_on_models(queries, models, results_path = None) Execute a list of Query instances on a list of Model instances and save the results. This method runs multiple SPARQL queries across a specified set of ontology models in the catalog. The results of each query on each model are saved in the specified directory, or in the default "./results" directory if no directory is provided. :param queries: A list of Query instances to be executed on the models. :type queries: list[Query] :param models: A list of Model instances on which the queries will be executed. :type models: list[Model] :param results_path: Optional; Path to the directory where the query results should be saved. If not provided, defaults to "./results". :type results_path: Optional[Union[str, Path]] :raises FileNotFoundError: If the provided results path does not exist and cannot be created. :raises Exception: For any other errors that occur during query execution. **Example**:: >>> from ontouml_models_lib import Catalog >>> from ontouml_models_lib import Query >>> catalog = Catalog('/path/to/catalog') >>> models = catalog.get_models(language="en") # Filter models by language >>> queries = Query.load_queries('./queries') # Load multiple SPARQL queries from a directory >>> catalog.execute_queries_on_models(queries, models) .. py:method:: execute_queries_on_all_models(queries, results_path = None) Execute a list of Query instances on all loaded Model instances in the catalog and save the results. This method runs multiple SPARQL queries across all ontology models loaded in the catalog. The results of each query on each model are saved in the specified directory, or in the default "./results" directory if no directory is provided. :param queries: A list of Query instances to be executed on all models. :type queries: list[Query] :param results_path: Optional; Path to the directory where the query results should be saved. If not provided, defaults to "./results". :type results_path: Optional[Union[str, Path]] :raises FileNotFoundError: If the provided results path does not exist and cannot be created. :raises Exception: For any other errors that occur during query execution. **Example**:: >>> from ontouml_models_lib import Catalog >>> from ontouml_models_lib import Query >>> catalog = Catalog('/path/to/catalog') >>> queries = Query.load_queries('./queries') # Load multiple SPARQL queries from a directory >>> catalog.execute_queries_on_all_models(queries) # Execute the queries on all models .. py:method:: get_model(model_id) Retrieve a model from the catalog by its ID. This method searches for a model within the catalog's loaded models by its unique ID. If a model with the specified ID is found, it is returned. Otherwise, a `ValueError` is raised. :param model_id: The ID of the model to retrieve. :type model_id: str :return: The model with the specified ID. :rtype: Model :raises ValueError: If no model with the specified ID is found. **Example**:: >>> from ontouml_models_lib import Catalog >>> catalog = Catalog('/path/to/catalog') >>> model = catalog.get_model('some_model_id') # Retrieve a model by its unique ID .. py:method:: get_models(operand = 'and', **filters) Return a list of models that match the given attribute restrictions. This method filters the loaded models based on specified attribute restrictions. It supports logical operations ("and" or "or") to combine multiple filters. If only a single filter is provided, the operand is ignored. :param operand: Logical operand for combining filters ("and" or "or"). Defaults to "and". :type operand: str :param filters: Attribute restrictions to filter models. Attribute names and values should be passed as keyword arguments. Multiple values for the same attribute can be provided as a list. :type filters: dict[str, Any] :return: List of models that match the restrictions. :rtype: list[Model] :raises ValueError: If an invalid operand is provided. **Example**:: >>> from ontouml_models_lib import Catalog >>> catalog = Catalog('/path/to/catalog') >>> # Filter models by a single attribute (language) >>> filtered_models = catalog.get_models(language="en") >>> # Filter models by multiple keywords >>> filtered_models = catalog.get_models(operand="or", keyword=["safety", "geology"]) >>> # Filter models by multiple attributes (keyword and language) >>> filtered_models = catalog.get_models(operand="and", keyword="safety", language="en") .. py:method:: remove_model_by_id(model_id) Remove a model from the catalog by its ID. This method searches for a model within the catalog's loaded models by its unique ID. If a model with the specified ID is found, it is removed from the catalog. Otherwise, a `ValueError` is raised. :param model_id: The ID of the model to remove. :type model_id: str :raises ValueError: If no model with the specified ID is found. **Example**:: >>> from ontouml_models_lib import Catalog >>> catalog = Catalog('/path/to/catalog') >>> catalog.remove_model_by_id('some_model_id') # Remove a model by its unique ID .. py:method:: _load_models(limit_num_models) Load ontology models from the catalog directory. This method scans the catalog directory for subfolders, each representing an ontology model. It loads the models from these subfolders and initializes them as instances of the `Model` class. The loaded models are stored in the `models` attribute of the `Catalog` instance. :param limit_num_models: The maximum number of models to load. If 0, load all models. :type limit_num_models: int :raises FileNotFoundError: If the catalog directory does not contain any model subfolders. .. py:method:: _get_subfolders() Retrieve the names of all subfolders in the catalog directory. This method identifies all subfolders within the catalog's `path_models` directory, which represent individual ontology models. The subfolders are expected to have the necessary ontology and metadata files for each model. :return: A list of subfolder names within the catalog directory. :rtype: list .. py:method:: _create_catalog_graph() Create a merged RDFLib graph from all loaded models in the catalog. This method combines the RDF graphs of all loaded models into a single RDFLib `Graph` object. The merged graph allows for executing SPARQL queries across the entire catalog, enabling comprehensive queries that span multiple models. :return: A merged RDFLib graph containing all triples from the models in the catalog. :rtype: Graph .. py:method:: _match_model(model, filters, operand) Check if a model matches the specified attribute filters. This method evaluates whether a model meets the attribute restrictions defined in the `filters` dictionary. It supports combining multiple filters using logical operations ("and" or "or"), and returns a boolean indicating whether the model satisfies the filter conditions. :param model: The model to be checked against the filters. :type model: Model :param filters: A dictionary of attribute restrictions used to filter models. Attribute names and values are passed as keyword arguments. :type filters: dict[str, Any] :param operand: Logical operand for combining filters ("and" or "or"). Defaults to "and". :type operand: str :return: True if the model matches the filter conditions; False otherwise. :rtype: bool :raises ValueError: If an invalid operand is provided (not "and" or "or"). .. py:method:: _match_single_filter(model, attr, value) Check if a model matches a single attribute filter. This method evaluates whether a model meets a single attribute restriction. It compares the model's attribute value to the provided filter value and returns a boolean indicating whether there is a match. It handles both single-value and list-value comparisons. :param model: The model to be checked against the filter. :type model: Model :param attr: The name of the attribute to filter by. :type attr: str :param value: The expected value or list of values to filter by. :type value: Any :return: True if the model's attribute matches the filter; False otherwise. :rtype: bool .. py:class:: Query(query_file) Represents a SPARQL query for execution within the OntoUML/UFO catalog. The `Query` class encapsulates a SPARQL query, providing methods for loading the query from a file, computing a persistent hash for the query content, and managing multiple queries through batch loading. This class ensures that queries are handled consistently, facilitating their reuse and reliable execution across RDF graphs representing ontology models. :ivar query_file_path: The path to the file from which the SPARQL query was loaded. :vartype query_file_path: Path :ivar query_content: The content of the SPARQL query as a string. :vartype query_content: str :ivar hash: A persistent hash value computed from the query content, used to ensure consistent result management. :vartype hash: int **Example**:: >>> from ontouml_models_lib import Query >>> query = Query('/path/to/query.sparql') >>> print(query.query_content) # Output: "SELECT ?s WHERE { ?s ?p ?o }" .. py:attribute:: query_file .. py:attribute:: query_file_path :type: pathlib.Path .. py:attribute:: name :type: str .. py:attribute:: query_content :type: str .. py:attribute:: hash :type: int .. py:method:: load_queries(queries_path) :staticmethod: Load all query_content files from the specified directory catalog_path and return a list of Query instances. :param queries_path: Path to the directory containing query_content files. :type queries_path: Path :return: List of Query instances. :rtype: list[Query] .. py:method:: execute_on_models(models, results_path = None) Execute the query on a list of models and consolidate the results into a single file. This method executes the query across multiple ontology models and saves all results into a single consolidated file. :param models: A list of Model instances on which the query will be executed. :type models: list[Model] :param results_path: Optional; Path to the directory where the query results should be saved. If not provided, defaults to "./results". :type results_path: Optional[Union[str, Path]] :raises Exception: For any errors that occur during query execution. .. py:method:: _save_results(results, results_path, suffix = '') Save the results to a file. This method is responsible for saving the results of the query execution to a file. :param results: The results to save. :type results: list[dict] :param results_path: The path to save the results file. :type results_path: Path :param suffix: An optional suffix for the filename to distinguish different types of results. :type suffix: str .. py:method:: _read_query_file(query_file) :staticmethod: Read the content of a SPARQL query file. This method opens a SPARQL query file, reads its content, and returns it as a string. The file is read using UTF-8 encoding to ensure compatibility with a wide range of characters. :param query_file: The path to the SPARQL query file. :type query_file: Path :return: The content of the SPARQL query file as a string. :rtype: str :raises FileNotFoundError: If the specified query file does not exist. :raises OSError: If an error occurs while reading the query file. .. py:method:: _compute_persistent_hash(content) :staticmethod: Compute a persistent hash value for the content of a SPARQL query. This method generates a SHA-256 hash from the content of a SPARQL query string. The hash is computed in a way that ensures consistency across executions, facilitating the identification and management of query results. :param content: The content of the SPARQL query to be hashed. :type content: str :return: The computed hash value for the query content. :rtype: int .. py:class:: Model(model_path) Bases: :py:obj:`ontouml_models_lib.utils.queryable_element.QueryableElement` Represents an individual ontology model within the OntoUML/UFO catalog. The `Model` class extends the `QueryableElement` class to manage and interact with RDF graphs representing ontology models. It provides methods for loading RDF graphs, extracting metadata from associated YAML files, and executing SPARQL queries. This class ensures that ontology data is consistently managed and that metadata attributes are easily accessible. :ivar title: The title of the ontology model, as determined by the `dct:title` property. There must be at most one title per language. :vartype title: str :ivar keyword: A list of keywords associated with the ontology model, aiding in the categorization and searchability of the model. :vartype keyword: list[str] :ivar acronym: An optional acronym for the ontology model, providing a shorthand identifier. :vartype acronym: Optional[str] :ivar source: The source or origin of the ontology model, typically a publication, organization, or project. It is recommended to use persistent and resolvable identifiers, such as DOIs or DBLP URIs, to refer to these resources. :vartype source: Optional[str] :ivar language: The language in which the lexical labels of the ontology model are written. The use of values from the IANA Language Sub Tag Registry (e.g., "en", "pt") is required. :vartype language: Optional[str] :ivar designedForTask: A list of standardized purposes for which the ontology model was designed, categorized using the OntologyPurpose enumeration. Examples include Conceptual Clarification, Data Publication, and Decision Support Systems. :vartype designedForTask: list[OntologyPurpose] :ivar context: The development context of the ontology model, classified under the OntologyDevelopmentContext enumeration. Examples include Research, Industry, and Classroom. :vartype context: list[OntologyDevelopmentContext] :ivar representationStyle: The representation style of the ontology model, categorized under the OntologyRepresentationStyle enumeration. Examples include OntoumlStyle and UfoStyle. :vartype representationStyle: Optional[OntologyRepresentationStyle] :ivar ontologyType: The type of ontology, categorized under the OntologyType enumeration. Examples include Core, Domain, and Application. :vartype ontologyType: Optional[OntologyType] :ivar theme: The central theme of the ontology model, identified according to a theme taxonomy such as the Library of Congress Classification (LCC). :vartype theme: Optional[str] :ivar contributor: An optional contributor to the ontology model, typically a person or organization that contributed to its development. :vartype contributor: Optional[str] :ivar editorialNote: An optional editorial note providing additional context or comments regarding the ontology model. :vartype editorialNote: Optional[str] :ivar issued: The year the ontology model was issued or published, represented as an integer. :vartype issued: Optional[int] :ivar landingPage: A URL representing the landing page or home page for the ontology model. :vartype landingPage: Optional[str] :ivar license: The license under which the ontology model is distributed. It is recommended to use a standard license identifier, such as those from SPDX (e.g., "CC-BY-4.0"). :vartype license: Optional[str] :ivar modified: The year the ontology model was last modified, represented as an integer. :vartype modified: Optional[int] **Example**:: >>> from ontouml_models_lib import Model >>> model = Model('/path/to/ontology_model_folder') >>> print(model.title) # Output: "Example Ontology Title" >>> print(model.keyword) # Output: ["ontology", "example"] .. py:attribute:: acronym :type: Optional[str] :value: None .. py:attribute:: context :type: list[ontouml_models_lib.enumerations.OntologyDevelopmentContext] :value: [] .. py:attribute:: contributor :type: Optional[str] :value: None .. py:attribute:: designedForTask :type: list[ontouml_models_lib.enumerations.OntologyPurpose] :value: [] .. py:attribute:: editorialNote :type: Optional[str] :value: None .. py:attribute:: issued :type: Optional[int] :value: None .. py:attribute:: keyword :type: list[str] :value: [] .. py:attribute:: landingPage :type: Optional[str] :value: None .. py:attribute:: language :type: Optional[str] :value: None .. py:attribute:: license :type: Optional[str] :value: None .. py:attribute:: modified :type: Optional[int] :value: None .. py:attribute:: ontologyType :type: Optional[ontouml_models_lib.enumerations.OntologyType] :value: None .. py:attribute:: representationStyle :type: Optional[ontouml_models_lib.enumerations.OntologyRepresentationStyle] :value: None .. py:attribute:: source :type: Optional[str] :value: None .. py:attribute:: theme :type: Optional[str] :value: None .. py:attribute:: title :type: str :value: '' .. py:attribute:: model_path :type: pathlib.Path .. py:attribute:: path_model_graph .. py:attribute:: path_metadata_graph .. py:attribute:: path_metadata_yaml .. py:method:: _compute_consistent_hash(graph) Compute a consistent hash value for an RDFLib graph. This method generates a SHA-256 hash for an RDFLib graph by first serializing it to a canonical format (N-Triples), sorting the serialized triples, and then encoding the sorted serialization to UTF-8. The resulting hash value is used to ensure consistency and integrity of the graph's content. :param graph: The RDFLib graph to be hashed. :type graph: Graph :return: The computed hash value for the RDFLib graph. :rtype: int .. py:method:: _load_graph_safely(ontology_file) Safely load an RDFLib graph from a file. This method loads an RDFLib graph from a specified ontology file, ensuring that the file exists and is correctly parsed. It determines the file format based on its extension and returns the loaded graph. :param ontology_file: The path to the ontology file to be loaded. :type ontology_file: Path :return: The loaded RDFLib graph. :rtype: Graph :raises FileNotFoundError: If the ontology file does not exist. :raises OSError: If an error occurs during the parsing of the ontology file. .. py:method:: _populate_attributes(yaml_file) Populate the model's attributes from a YAML metadata file. This method reads a YAML file containing metadata and assigns the corresponding values to the model's attrs. It handles enumerations by matching the string values in the YAML file to the appropriate enumeration members. The method supports both single-value and list-value attributes. :param yaml_file: The path to the YAML file containing the metadata. :type yaml_file: Path :raises FileNotFoundError: If the YAML metadata file does not exist. :raises ValueError: If an invalid value is encountered for an enumeration attribute. .. py:class:: OntologyPurpose(*args, **kwds) Bases: :py:obj:`enum.Enum` Represents the purposes for which ontologies are created. :cvar CONCEPTUAL_CLARIFICATION: Created to clarify and untangle complex notions and relations through ontological analysis. :cvar DATA_PUBLICATION: Created to support data publication, such as generating an OWL vocabulary to publish data as linked open data. :cvar DECISION_SUPPORT_SYSTEM: Created during the development of a decision support system. :cvar EXAMPLE: Created to demonstrate OntoUML's application, support an experiment, or exemplify model reuse in specific scenarios. :cvar INFORMATION_RETRIEVAL: Created to support the design of an information retrieval system. :cvar INTEROPERABILITY: Created to support data integration, vocabulary alignment, or interoperability between software systems. :cvar LANGUAGE_ENGINEERING: Created for the design of a domain-specific modeling language. :cvar LEARNING: Created by authors to learn UFO and OntoUML, often as part of a course assignment. :cvar ONTOLOGIC_ANALYSIS: Created as part of a broader ontological analysis. :cvar SOFTWARE_ENGINEERING: Created during the development of an information system, such as generating a relational database schema. These purposes categorize ontologies based on their intended use, from data publication to software engineering and conceptual analysis. .. py:attribute:: CONCEPTUAL_CLARIFICATION :value: 'ConceptualClarification' .. py:attribute:: DATA_PUBLICATION :value: 'DataPublication' .. py:attribute:: DECISION_SUPPORT_SYSTEM :value: 'DecisionSupportSystem' .. py:attribute:: EXAMPLE :value: 'Example' .. py:attribute:: INFORMATION_RETRIEVAL :value: 'InformationRetrieval' .. py:attribute:: INTEROPERABILITY :value: 'Interoperability' .. py:attribute:: LANGUAGE_ENGINEERING :value: 'LanguageEngineering' .. py:attribute:: LEARNING :value: 'Learning' .. py:attribute:: ONTOLOGIC_ALANALYSIS :value: 'OntologicalAnalysis' .. py:attribute:: SOFTWARE_ENGINEERING :value: 'SoftwareEngineering' .. py:class:: OntologyDevelopmentContext(*args, **kwds) Bases: :py:obj:`enum.Enum` Represents the different contexts in which ontologies are developed. :cvar CLASSROOM: Indicates that the ontology was developed within an educational setting, such as a classroom. :cvar INDUSTRY: Indicates that the ontology was developed for or within an industrial or corporate context. :cvar RESEARCH: Indicates that the ontology was developed as part of a research project, often associated with academic publications. These contexts categorize ontologies based on their origin, whether they are created in educational, industrial, or research environments. .. py:attribute:: CLASSROOM :value: 'Classroom' .. py:attribute:: INDUSTRY :value: 'Industry' .. py:attribute:: RESEARCH :value: 'Research' .. py:class:: OntologyRepresentationStyle(*args, **kwds) Bases: :py:obj:`enum.Enum` Represents the styles of ontology representation. :cvar ONTOUML_STYLE: Characterizes a model that contains at least one class, relation, or property using a valid OntoUML stereotype. :cvar UFO_STYLE: Characterizes a model that contains at least one class or relation from UFO (Unified Foundational Ontology) without an OntoUML stereotype. These representation styles classify ontologies based on whether they adhere to OntoUML stereotypes or use foundational ontology elements from UFO. .. py:attribute:: ONTOUML_STYLE :value: 'OntoumlStyle' .. py:attribute:: UFO_STYLE :value: 'UfoStyle' .. py:class:: OntologyType(*args, **kwds) Bases: :py:obj:`enum.Enum` Represents the types of ontologies based on their scope and application. :cvar CORE: An ontology that grasps central concepts and relations of a given domain, often integrating several domain ontologies and being applicable in multiple scenarios. :cvar DOMAIN: An ontology that describes how a community conceptualizes a phenomenon of interest, typically narrower in scope than a core ontology. :cvar APPLICATION: An ontology that specializes a domain ontology for a particular application, representing a model of a domain according to a specific viewpoint. These types classify ontologies based on their scope, from core ontologies applicable in multiple domains to specialized application ontologies. .. py:attribute:: CORE :value: 'Core' .. py:attribute:: DOMAIN :value: 'Domain' .. py:attribute:: APPLICATION :value: 'Application'