Skip to content

Commit

Permalink
removed __Entity__ labels
Browse files Browse the repository at this point in the history
  • Loading branch information
vasanthasaikalluri committed Sep 17, 2024
1 parent 9237847 commit dff7535
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions backend/src/chunkid_entities.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,18 @@ def process_records(records):
relationship = element['relationship']

if start_node['element_id'] not in seen_nodes:
if "labels" in start_node.keys():
labels = set(start_node["labels"])
labels.discard("__Entity__")
start_node["labels"] = list(labels)
nodes.append(start_node)
seen_nodes.add(start_node['element_id'])

if end_node['element_id'] not in seen_nodes:
if "labels" in end_node.keys():
labels = set(end_node["labels"])
labels.discard("__Entity__")
end_node["labels"] = list(labels)
nodes.append(end_node)
seen_nodes.add(end_node['element_id'])

Expand Down
2 changes: 1 addition & 1 deletion backend/src/shared/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
MATCH (chunk)-[:PART_OF]->(d:Document)
CALL {WITH chunk
MATCH (chunk)-[:HAS_ENTITY]->(e)
MATCH path=(e)(()-[rels:!HAS_ENTITY&!PART_OF]-()){0,2}(:!Chunk &! Document)
MATCH path=(e)(()-[rels:!HAS_ENTITY&!PART_OF]-()){0,2}(:!Chunk &! Document &! `__Community__`)
UNWIND rels as r
RETURN collect(distinct r) as rels
}
Expand Down

0 comments on commit dff7535

Please sign in to comment.