remove " and upper()
This commit is contained in:
@@ -880,7 +880,7 @@ class LightRAG:
|
|||||||
# Insert entities into knowledge graph
|
# Insert entities into knowledge graph
|
||||||
all_entities_data: list[dict[str, str]] = []
|
all_entities_data: list[dict[str, str]] = []
|
||||||
for entity_data in custom_kg.get("entities", []):
|
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")
|
entity_type = entity_data.get("entity_type", "UNKNOWN")
|
||||||
description = entity_data.get("description", "No description provided")
|
description = entity_data.get("description", "No description provided")
|
||||||
# source_id = entity_data["source_id"]
|
# source_id = entity_data["source_id"]
|
||||||
@@ -910,8 +910,8 @@ class LightRAG:
|
|||||||
# Insert relationships into knowledge graph
|
# Insert relationships into knowledge graph
|
||||||
all_relationships_data: list[dict[str, str]] = []
|
all_relationships_data: list[dict[str, str]] = []
|
||||||
for relationship_data in custom_kg.get("relationships", []):
|
for relationship_data in custom_kg.get("relationships", []):
|
||||||
src_id = f'"{relationship_data["src_id"].upper()}"'
|
src_id = relationship_data["src_id"]
|
||||||
tgt_id = f'"{relationship_data["tgt_id"].upper()}"'
|
tgt_id = relationship_data["tgt_id"]
|
||||||
description = relationship_data["description"]
|
description = relationship_data["description"]
|
||||||
keywords = relationship_data["keywords"]
|
keywords = relationship_data["keywords"]
|
||||||
weight = relationship_data.get("weight", 1.0)
|
weight = relationship_data.get("weight", 1.0)
|
||||||
@@ -1213,7 +1213,6 @@ class LightRAG:
|
|||||||
return loop.run_until_complete(self.adelete_by_entity(entity_name))
|
return loop.run_until_complete(self.adelete_by_entity(entity_name))
|
||||||
|
|
||||||
async def adelete_by_entity(self, entity_name: str) -> None:
|
async def adelete_by_entity(self, entity_name: str) -> None:
|
||||||
entity_name = f'"{entity_name.upper()}"'
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
await self.entities_vdb.delete_entity(entity_name)
|
await self.entities_vdb.delete_entity(entity_name)
|
||||||
@@ -1509,7 +1508,6 @@ class LightRAG:
|
|||||||
- graph_data: Complete node data from the graph database
|
- graph_data: Complete node data from the graph database
|
||||||
- vector_data: (optional) Data from the vector database
|
- vector_data: (optional) Data from the vector database
|
||||||
"""
|
"""
|
||||||
entity_name = f'"{entity_name.upper()}"'
|
|
||||||
|
|
||||||
# Get information from the graph
|
# Get information from the graph
|
||||||
node_data = await self.chunk_entity_relation_graph.get_node(entity_name)
|
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
|
- graph_data: Complete edge data from the graph database
|
||||||
- vector_data: (optional) Data from the vector 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
|
# Get information from the graph
|
||||||
edge_data = await self.chunk_entity_relation_graph.get_edge(
|
edge_data = await self.chunk_entity_relation_graph.get_edge(
|
||||||
|
Reference in New Issue
Block a user