Skip to content

Commit 796d68e

Browse files
committed
fix-bug
1 parent d905450 commit 796d68e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

graphrag_sdk/ontology.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,13 +136,13 @@ def from_kg_graph(graph: Graph, sample_size: int = 100,):
136136

137137
# Extract attributes for each edge type, limited by the specified sample size.
138138
for e_type in e_types:
139+
e_t = e_type[0]
139140
attributes = graph.query(
140141
f"""MATCH ()-[a:{e_t}]->() call {{ with a return [k in keys(a) | [k, typeof(a[k])]] as types }}
141142
WITH types limit {sample_size} unwind types as kt RETURN kt, count(1)""").result_set
142143
attributes = [Attribute(attr[0][0], attr[0][1]) for attr in attributes]
143144
for s_lbls in n_labels:
144145
for t_lbls in n_labels:
145-
e_t = e_type[0]
146146
s_l = s_lbls[0]
147147
t_l = t_lbls[0]
148148
# Check if a relationship exists between the source and target entity labels

0 commit comments

Comments
 (0)