Hello! I am trying to use my existing nodes and edges in neo4j as the index for my KnowledgeGraphIndex, but loading the nodes from neo4j and using the existing relationships to build the index is not straightforward with the documentation. Can someone help me? My current approach looks something like this.. but I'm a bit stuck
nodes = graph_store.query('MATCH (n)-[r]->(m) RETURN n,r,m;')
for node in nodes:
subject = node['n']['id']
relationship = node['r']['id']
object = node['m']['id']
index.upsert_triplet_and_node(
[subject, relationship, object],
TextNode(
text=...,
id_=node['n']['id'],
)
)
Any help is appreciated thank you