From 3b65dee0e8ea38303941cf46fb50c8b91a978741 Mon Sep 17 00:00:00 2001 From: Wenjie Zhang Date: Sun, 30 Mar 2025 11:09:46 +0800 Subject: [PATCH] Update graphbase.py --- src/core/graphbase.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core/graphbase.py b/src/core/graphbase.py index 178d6ef5..75bf1419 100644 --- a/src/core/graphbase.py +++ b/src/core/graphbase.py @@ -172,7 +172,8 @@ class GraphDatabase: def read_triples(file_path): with open(file_path, 'r', encoding='utf-8') as file: for line in file: - yield json.loads(line.strip()) + if line.strip(): + yield json.loads(line.strip()) triples = list(read_triples(file_path)) @@ -455,4 +456,4 @@ class GraphDatabase: if __name__ == "__main__": - pass \ No newline at end of file + pass