remove " and upper()

This commit is contained in:
zrguo
2025-03-02 14:23:06 +08:00
parent 9aa438cf79
commit 5198240cf9

View File

@@ -880,7 +880,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"]
@@ -910,8 +910,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)
@@ -1213,7 +1213,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)
@@ -1509,7 +1508,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)
@@ -1547,8 +1545,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(