Skip to content

Commit

Permalink
Added diff markdown for AddNodeToSubset (#736)
Browse files Browse the repository at this point in the history
  • Loading branch information
hrshdhgd authored Apr 8, 2024
1 parent 8a6dfc3 commit 41c1d95
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/oaklib/utilities/writers/change_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.")
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 41c1d95

Please sign in to comment.