Skip to content

Commit dff7535

Browse files
removed __Entity__ labels
1 parent 9237847 commit dff7535

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

backend/src/chunkid_entities.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,18 @@ def process_records(records):
1919
relationship = element['relationship']
2020

2121
if start_node['element_id'] not in seen_nodes:
22+
if "labels" in start_node.keys():
23+
labels = set(start_node["labels"])
24+
labels.discard("__Entity__")
25+
start_node["labels"] = list(labels)
2226
nodes.append(start_node)
2327
seen_nodes.add(start_node['element_id'])
2428

2529
if end_node['element_id'] not in seen_nodes:
30+
if "labels" in end_node.keys():
31+
labels = set(end_node["labels"])
32+
labels.discard("__Entity__")
33+
end_node["labels"] = list(labels)
2634
nodes.append(end_node)
2735
seen_nodes.add(end_node['element_id'])
2836

backend/src/shared/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
MATCH (chunk)-[:PART_OF]->(d:Document)
7575
CALL {WITH chunk
7676
MATCH (chunk)-[:HAS_ENTITY]->(e)
77-
MATCH path=(e)(()-[rels:!HAS_ENTITY&!PART_OF]-()){0,2}(:!Chunk &! Document)
77+
MATCH path=(e)(()-[rels:!HAS_ENTITY&!PART_OF]-()){0,2}(:!Chunk &! Document &! `__Community__`)
7878
UNWIND rels as r
7979
RETURN collect(distinct r) as rels
8080
}

0 commit comments

Comments
 (0)