diff --git a/src/caoscrawler/sync_graph.py b/src/caoscrawler/sync_graph.py index 48bbf9bd2162a7d8f39bc5dbdc8dad73bc8c62fd..919131b858ee7530c98c13e207c954c112becd72 100644 --- a/src/caoscrawler/sync_graph.py +++ b/src/caoscrawler/sync_graph.py @@ -286,6 +286,12 @@ class SyncGraph(): Return an equivalent SyncNode. Equivalent means that ID, path or identifiable are the same. + If a new information was added to the given SyncNode (e.g. the ID), it might be possible + then to identify an equivalent node (i.e. one with the same ID in this example). + There might be more than one equivalent nodes in the graph. However, simply the first that + is found is being returned. (When an equivalent node is found this, the given node is + typically merged, into the one that was found and after the merge the graph is again + checked for equivalent nodes) Returns None if no equivalent node is found. """ @@ -565,6 +571,9 @@ class SyncGraph(): # - merge self._add_identifiables_to_dependend_nodes(target) + if self.get_equivalent(target) is not None: + self._merge_into(target, self.get_equivalent(target)) + def _identifiable_is_needed(self, node: SyncNode): """ This function checks: