Skip to content

Commit

Permalink
add components of relationships that were selected ..
Browse files Browse the repository at this point in the history
based on only one of source and target to the selected entities list
  • Loading branch information
slobentanzer committed Nov 28, 2023
1 parent 6d48a32 commit 85ae319
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions biochatter/prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,23 @@ def _select_relationships(self) -> bool:
"target": None,
}

# TODO if we selected relationships that have source and target which is
# not in the selected entities, we add those entities to the selected
# if we selected relationships that have either source or target which
# is not in the selected entities, we add those entities to the selected
# entities.

if self.selected_relationship_labels:
for key, value in self.selected_relationship_labels.items():
if (
value["source"]
and value["source"] not in self.selected_entities
):
self.selected_entities.append(value["source"])
if (
value["target"]
and value["target"] not in self.selected_entities
):
self.selected_entities.append(value["target"])

return bool(result)

def _select_properties(
Expand Down

0 comments on commit 85ae319

Please sign in to comment.