diff --git a/src/caoscrawler/sync_graph.py b/src/caoscrawler/sync_graph.py index 62b9b207caa6cd1ed6db81c35c8aad8d80416bc1..bae03c00499c6ba347eba74e2a57ec22debe4be7 100644 --- a/src/caoscrawler/sync_graph.py +++ b/src/caoscrawler/sync_graph.py @@ -340,6 +340,8 @@ class SyncGraph(): def _sanity_check(entities: list[db.Entity]): """ Checks whether each record in entities has at least one parent. + + Last review by Alexander Schlemmer on 2024-05-24. """ for ent in entities: if ent.role == "Record" and len(ent.parents) == 0: @@ -573,6 +575,15 @@ class SyncGraph(): self._set_identifiable_of_node(other_node) def _identifiable_is_needed(self, node: SyncNode): + """ + This function checks: + - the identifiable of node is None + - the node has all properties that are needed for the identifiable + - there are no unchecked entities that are needed for the identifiable of the node, + neither as forward or as backward references + + Last review by Alexander Schlemmer on 2024-05-24. + """ return (node.identifiable is None and not self._identity_relies_on_unchecked_entity(node) and self.identifiableAdapter.check_identifying_props(node, raise_exception=False))