mirror of
https://github.com/trustgraph-ai/trustgraph.git
synced 2026-07-20 18:51:03 +02:00
Get subgraph truncation in the right place
This commit is contained in:
parent
5ca910e089
commit
5160d5bf2f
1 changed files with 10 additions and 10 deletions
|
|
@ -131,16 +131,6 @@ class Query:
|
|||
|
||||
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
|
||||
|
||||
def get_labelgraph(self, query):
|
||||
|
|
@ -160,6 +150,16 @@ class Query:
|
|||
|
||||
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
|
||||
|
||||
class GraphRag:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue