From ec68e9943868b10008eeca48d85abea02d678178 Mon Sep 17 00:00:00 2001 From: hajdul88 <52442977+hajdul88@users.noreply.github.com> Date: Tue, 27 May 2025 15:23:42 +0200 Subject: [PATCH] Fix: removes ontology resolver initialization at import (#876) ## Description Removes ontology resolver initialization at import. ## DCO Affirmation I affirm that all code in every commit of this pull request conforms to the terms of the Topoteretes Developer Certificate of Origin. --- cognee/modules/graph/utils/expand_with_nodes_and_edges.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cognee/modules/graph/utils/expand_with_nodes_and_edges.py b/cognee/modules/graph/utils/expand_with_nodes_and_edges.py index b392094aa..00998f4e7 100644 --- a/cognee/modules/graph/utils/expand_with_nodes_and_edges.py +++ b/cognee/modules/graph/utils/expand_with_nodes_and_edges.py @@ -15,12 +15,15 @@ from cognee.modules.ontology.rdf_xml.OntologyResolver import OntologyResolver def expand_with_nodes_and_edges( data_chunks: list[DocumentChunk], chunk_graphs: list[KnowledgeGraph], - ontology_resolver: OntologyResolver = OntologyResolver(), + ontology_resolver: OntologyResolver = None, existing_edges_map: Optional[dict[str, bool]] = None, ): if existing_edges_map is None: existing_edges_map = {} + if ontology_resolver is None: + ontology_resolver = OntologyResolver() + added_nodes_map = {} added_ontology_nodes_map = {} relationships = []