MCPcopy Create free account
hub / github.com/NanGePlus/LightRAGTest / get_edge

Method get_edge

LightRAG/lightrag/kg/oracle_impl.py:500–516  ·  view source on GitHub ↗

根据源和目标节点id获取边

(
        self, source_node_id: str, target_node_id: str
    )

Source from the content-addressed store, hash-verified

498 return None
499
500 async def get_edge(
501 self, source_node_id: str, target_node_id: str
502 ) -> Union[dict, None]:
503 """根据源和目标节点id获取边"""
504 SQL = SQL_TEMPLATES["get_edge"]
505 params = {
506 "workspace": self.db.workspace,
507 "source_node_id": source_node_id,
508 "target_node_id": target_node_id,
509 }
510 res = await self.db.query(SQL, params)
511 if res:
512 # print("Get edge!",self.db.workspace, source_node_id, target_node_id,res[0])
513 return res
514 else:
515 # print("Edge not exist!",self.db.workspace, source_node_id, target_node_id)
516 return None
517
518 async def get_node_edges(self, source_node_id: str):
519 """根据节点id获取节点的所有边"""

Callers

nothing calls this directly

Calls 1

queryMethod · 0.45

Tested by

no test coverage detected