Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added diff markdown for AddNodeToSubset #736

Merged
merged 1 commit into from
Apr 8, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading