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

rename edge to mapping #775

Merged
merged 10 commits into from
Jun 20, 2024
19 changes: 10 additions & 9 deletions src/oaklib/interfaces/differ_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
Change,
ClassCreation,
Edge,
EdgeChange,
EdgeCreation,
EdgeDeletion,
MappingChange,
MappingCreation,
MappingDeletion,
NewSynonym,
NewTextDefinition,
NodeCreation,
Expand Down Expand Up @@ -275,34 +276,34 @@ def diff(
if mappings_added_set:
for mapping in mappings_added_set:
predicate, xref = mapping
edge_created = EdgeCreation(
mapping_created = MappingCreation(
id=_gen_id(),
subject=entity,
predicate=predicate,
object=xref,
)
yield edge_created
yield mapping_created
if mappings_removed_set:
for mapping in mappings_removed_set:
predicate, xref = mapping
deleted_edge = EdgeDeletion(
deleted_mapping = MappingDeletion(
hrshdhgd marked this conversation as resolved.
Show resolved Hide resolved
id=_gen_id(),
subject=entity,
predicate=predicate,
object=xref,
)
yield deleted_edge
yield deleted_mapping
if mapping_changed_set:
for changes in mapping_changed_set:
object, new_predicate, old_predicate = changes
edge_change = EdgeChange(
mapping_change = MappingChange(
twhetzel marked this conversation as resolved.
Show resolved Hide resolved
id=_gen_id(),
about_edge=Edge(subject=entity, predicate=old_predicate, object=object),
about_mapping=Mapping(subject=entity, predicate=old_predicate, object=object),
old_value=old_predicate,
new_value=new_predicate,
)

yield edge_change
yield mapping_change

# ! Subset changes
self_subsets = set(self.terms_subsets([entity]))
Expand Down
Loading