This document provides an overview of the ontology related modules, their purposes and the key functionalities they handle.
OntologyResolver
- OntologyResolver class: Implements the rdf_xml connection logic and contains the following steps
- Utility functions to handle the lookup table, such as:
build_lookup
: Creates a lookup from the ontologyrefresh_lookup
: Updates lookup with the latest ontology changes
- Node - Ontology matching logic:
find_closest_match
: Finds the closest ontology node to the parameter (entity — individual, entity_type — class)
- Ontology subgraph collection logic:
get_subgraph
: Collects the subgraph starting from the closest ontology node match
- expand_with_nodes_and_edges: Implements the main graph matching logic
- The task creates the entities and entity types from the documentchunks, looks for matching ontology nodes using the
OntologyResolver
class, and merges the structure of the matching ontology subgraphs with the LLM generated structures.
How to Contribute
If you have additional examples or innovative approaches to ontology integration using owl2ready, we’d love to include them! Submit a pull request to our GitHub repository or reach out to us directly.