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

Method has_node

LightRAG/lightrag/kg/oracle_impl.py:436–448  ·  view source on GitHub ↗

根据节点id检查节点是否存在

(self, node_id: str)

Source from the content-addressed store, hash-verified

434
435 #################### query method #################
436 async def has_node(self, node_id: str) -> bool:
437 """根据节点id检查节点是否存在"""
438 SQL = SQL_TEMPLATES["has_node"]
439 params = {"workspace": self.db.workspace, "node_id": node_id}
440 # print(SQL)
441 # print(self.db.workspace, node_id)
442 res = await self.db.query(SQL, params)
443 if res:
444 # print("Node exist!",res)
445 return True
446 else:
447 # print("Node not exist!")
448 return False
449
450 async def has_edge(self, source_node_id: str, target_node_id: str) -> bool:
451 """根据源和目标节点id检查边是否存在"""

Callers 1

get_node_edgesMethod · 0.95

Calls 1

queryMethod · 0.45

Tested by

no test coverage detected