From 78f8d7a1ce1186ce3398afb946f3da79bad50df7 Mon Sep 17 00:00:00 2001 From: yangdx Date: Sat, 8 Mar 2025 10:20:10 +0800 Subject: [PATCH] Convert node and edge IDs to f-strings for consistency. - Use f-strings for node IDs - Use f-strings for edge IDs - Ensure consistent ID formatting --- lightrag/kg/neo4j_impl.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lightrag/kg/neo4j_impl.py b/lightrag/kg/neo4j_impl.py index 082b4bf2..05deb0a9 100644 --- a/lightrag/kg/neo4j_impl.py +++ b/lightrag/kg/neo4j_impl.py @@ -865,17 +865,17 @@ class Neo4JStorage(BaseGraphStorage): if b_node.labels: # Only process if target node has labels # Create KnowledgeGraphNode for target target_node = KnowledgeGraphNode( - id=target_id, + id=f"{target_id}", labels=list(b_node.labels), properties=dict(b_node), ) # Create KnowledgeGraphEdge target_edge = KnowledgeGraphEdge( - id=edge_id, + id=f"{edge_id}", type=rel.type, - source=node.id, - target=target_id, + source=f"{node.id}", + target=f"{target_id}", properties=dict(rel), ) @@ -905,7 +905,7 @@ class Neo4JStorage(BaseGraphStorage): # Create initial KnowledgeGraphNode start_node = KnowledgeGraphNode( - id=str(node_record["node_id"]), + id=f"{node_record['node_id']}", labels=list(node_record["n"].labels), properties=dict(node_record["n"]), )