From 41c1d95c760ed86a6ee84063ccdcd46e1f9f75f8 Mon Sep 17 00:00:00 2001 From: Harshad Date: Mon, 8 Apr 2024 11:57:19 -0500 Subject: [PATCH] Added `diff` markdown for `AddNodeToSubset` (#736) --- src/oaklib/utilities/writers/change_handler.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/oaklib/utilities/writers/change_handler.py b/src/oaklib/utilities/writers/change_handler.py index 43fb2038a..0c3b16e04 100644 --- a/src/oaklib/utilities/writers/change_handler.py +++ b/src/oaklib/utilities/writers/change_handler.py @@ -285,6 +285,14 @@ def handle_node_direct_merge(self, value): header = "| Term | Replacement |" self.write_markdown_table(f"Nodes merged: {len(rows)}", header, rows) + def handle_add_node_to_subset(self, value): + rows = [ + f"| {self._format_entity_labels(change.about_node)} | {change.in_subset} |" + for change in value + ] + header = "| Term | Subset |" + self.write_markdown_table(f"Nodes added to subset: {len(rows)}", header, rows) + # def handle_datatype_or_language_tag_change(self, value): # # Implement datatype or language tag change handling logic here # logging.info("Datatype or language tag change handling not yet implemented.") @@ -354,6 +362,7 @@ def process_changes(self, curie_or_change: Dict[str, Change]): "EdgeCreation": self.handle_edge_creation, "EdgeChange": self.handle_edge_change, "MappingEdgeDeletion": self.handle_mapping_edge_deletion, + "AddNodeToSubset": self.handle_add_node_to_subset, # "DatatypeOrLanguageTagChange": self.handle_datatype_or_language_tag_change, # "LanguageTagChange": self.handle_language_tag_change, # "DatatypeChange": self.handle_datatype_change,