Skip to content

Commit

Permalink
Added change handler for kgcl.RemoveNodeFromSubset
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshdhgd committed Jul 23, 2024
1 parent 7774d90 commit c2c806e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/oaklib/utilities/writers/change_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,16 @@ def handle_add_node_to_subset(self, value):
header = "| Term | Subset |"
self.write_markdown_table(f"Nodes added to subset: {len(rows)}", header, rows)

def handle_remove_node_from_subset(self, value):
rows = list(
{
f"| {self._format_entity_labels(change.about_node)} | {change.in_subset} |"
for change in value
}
)
header = "| Term | Subset |"
self.write_markdown_table(f"Nodes removed from subset: {len(rows)}", header, rows)

def handle_mapping_creation(self, value):
rows = list(
{
Expand Down Expand Up @@ -417,6 +427,7 @@ def process_changes(self, curie_or_change: Dict[str, Change]):
"EdgeCreation": self.handle_edge_creation,
"EdgeChange": self.handle_edge_change,
"AddNodeToSubset": self.handle_add_node_to_subset,
"RemoveNodeFromSubset": self.handle_remove_node_from_subset,
"MappingPredicateChange": self.handle_mapping_predicate_change,
"MappingCreation": self.handle_mapping_creation,
"RemoveMapping": self.handle_remove_mapping,
Expand Down

0 comments on commit c2c806e

Please sign in to comment.