Update graphbase.py

This commit is contained in:
Wenjie Zhang 2025-03-30 11:09:46 +08:00 committed by GitHub
parent 04b5cac089
commit 3b65dee0e8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -172,6 +172,7 @@ class GraphDatabase:
def read_triples(file_path): def read_triples(file_path):
with open(file_path, 'r', encoding='utf-8') as file: with open(file_path, 'r', encoding='utf-8') as file:
for line in file: for line in file:
if line.strip():
yield json.loads(line.strip()) yield json.loads(line.strip())
triples = list(read_triples(file_path)) triples = list(read_triples(file_path))