The KnowledgeOntology
class represents the entire ontology, including all entity and relationship classes.
KnowledgeOntology
class loads the ontology from a YAML file and provides methods to access its components.
__init__(self, ontology_file: str)
KnowledgeOntology
class.
ontology_file
(str): The path to the YAML file defining the ontology.find_entity_class(self, name: str)
name
(str): The name of the entity class to find.EntityClass
object or None
if not found.get_add_or_update_tools(self, add_entity_func, add_relationship_func)
add_entity_func
(function): The function to call to add/update an entity.add_relationship_func
(function): The function to call to add/update a relationship.get_get_tools(self, get_all_entity_func, get_entity_properties_func, get_relationship_properties_func, get_relationship_entities_func)
get_all_entity_func
(function): Function to get all entities of a certain type.get_entity_properties_func
(function): Function to get the properties of an entity.get_relationship_properties_func
(function): Function to get the properties of a relationship.get_relationship_entities_func
(function): Function to get the entities connected by a relationship.