Merge branch 'main' into max-graph-node
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
### This is sample file of .env
|
||||
|
||||
### Server Configuration
|
||||
# HOST=0.0.0.0
|
||||
# PORT=9621
|
@@ -997,7 +997,7 @@ class LightRAG:
|
||||
# Insert entities into knowledge graph
|
||||
all_entities_data: list[dict[str, str]] = []
|
||||
for entity_data in custom_kg.get("entities", []):
|
||||
entity_name = f'"{entity_data["entity_name"].upper()}"'
|
||||
entity_name = entity_data["entity_name"]
|
||||
entity_type = entity_data.get("entity_type", "UNKNOWN")
|
||||
description = entity_data.get("description", "No description provided")
|
||||
# source_id = entity_data["source_id"]
|
||||
@@ -1027,8 +1027,8 @@ class LightRAG:
|
||||
# Insert relationships into knowledge graph
|
||||
all_relationships_data: list[dict[str, str]] = []
|
||||
for relationship_data in custom_kg.get("relationships", []):
|
||||
src_id = f'"{relationship_data["src_id"].upper()}"'
|
||||
tgt_id = f'"{relationship_data["tgt_id"].upper()}"'
|
||||
src_id = relationship_data["src_id"]
|
||||
tgt_id = relationship_data["tgt_id"]
|
||||
description = relationship_data["description"]
|
||||
keywords = relationship_data["keywords"]
|
||||
weight = relationship_data.get("weight", 1.0)
|
||||
@@ -1330,8 +1330,6 @@ class LightRAG:
|
||||
return loop.run_until_complete(self.adelete_by_entity(entity_name))
|
||||
|
||||
async def adelete_by_entity(self, entity_name: str) -> None:
|
||||
entity_name = f'"{entity_name.upper()}"'
|
||||
|
||||
try:
|
||||
await self.entities_vdb.delete_entity(entity_name)
|
||||
await self.relationships_vdb.delete_entity_relation(entity_name)
|
||||
@@ -1626,7 +1624,6 @@ class LightRAG:
|
||||
- graph_data: Complete node data from the graph database
|
||||
- vector_data: (optional) Data from the vector database
|
||||
"""
|
||||
entity_name = f'"{entity_name.upper()}"'
|
||||
|
||||
# Get information from the graph
|
||||
node_data = await self.chunk_entity_relation_graph.get_node(entity_name)
|
||||
@@ -1664,8 +1661,6 @@ class LightRAG:
|
||||
- graph_data: Complete edge data from the graph database
|
||||
- vector_data: (optional) Data from the vector database
|
||||
"""
|
||||
src_entity = f'"{src_entity.upper()}"'
|
||||
tgt_entity = f'"{tgt_entity.upper()}"'
|
||||
|
||||
# Get information from the graph
|
||||
edge_data = await self.chunk_entity_relation_graph.get_edge(
|
||||
|
Reference in New Issue
Block a user