From c600eb7a56ed217a59554e621f8c43ab1df161dd Mon Sep 17 00:00:00 2001 From: Matea Pesic <80577904+matea16@users.noreply.github.com> Date: Tue, 8 Jul 2025 20:00:11 +0200 Subject: [PATCH] Memgraph fix (#1062) ## Description Updated get_edges function so the output id matches internal ID ## 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. --------- Co-authored-by: github-actions[bot] Co-authored-by: Vasilije <8619304+Vasilije1990@users.noreply.github.com> --- .../databases/graph/memgraph/memgraph_adapter.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cognee/infrastructure/databases/graph/memgraph/memgraph_adapter.py b/cognee/infrastructure/databases/graph/memgraph/memgraph_adapter.py index 871a9543e..050e3a3c8 100644 --- a/cognee/infrastructure/databases/graph/memgraph/memgraph_adapter.py +++ b/cognee/infrastructure/databases/graph/memgraph/memgraph_adapter.py @@ -155,7 +155,7 @@ class MemgraphAdapter(GraphDBInterface): MERGE (node {id: $node_id}) ON CREATE SET node:$node_label, node += $properties, node.updated_at = timestamp() ON MATCH SET node:$node_label, node += $properties, node.updated_at = timestamp() - RETURN ID(node) AS internal_id,node.id AS nodeId + RETURN ID(node) AS internal_id, node.id AS nodeId """ params = { @@ -845,8 +845,8 @@ class MemgraphAdapter(GraphDBInterface): result = await self.query(query) edges = [ ( - record["properties"]["source_node_id"], - record["properties"]["target_node_id"], + record["source"], + record["target"], record["type"], record["properties"], )