Get subgraph truncation in the right place

This commit is contained in:
Cyber MacGeddon 2025-03-12 23:34:33 +00:00
parent 5ca910e089
commit 5160d5bf2f

View file

@ -131,16 +131,6 @@ class Query:
subgraph = list(subgraph) subgraph = list(subgraph)
subgraph = subgraph[0:self.max_subgraph_size]
if self.verbose:
print("Subgraph:", flush=True)
for edge in subgraph:
print(" ", str(edge), flush=True)
if self.verbose:
print("Done.", flush=True)
return subgraph return subgraph
def get_labelgraph(self, query): def get_labelgraph(self, query):
@ -160,6 +150,16 @@ class Query:
sg2.append((s, p, o)) sg2.append((s, p, o))
sg2 = sg2[0:self.max_subgraph_size]
if self.verbose:
print("Subgraph:", flush=True)
for edge in sg2:
print(" ", str(edge), flush=True)
if self.verbose:
print("Done.", flush=True)
return sg2 return sg2
class GraphRag: class GraphRag: