diff --git a/src/caoscrawler/sync_graph.py b/src/caoscrawler/sync_graph.py index e2687dcad263a2e7de482689bb48ff5355005428..c65f033fd73c1905ca1eba74eb50e56251baf013 100644 --- a/src/caoscrawler/sync_graph.py +++ b/src/caoscrawler/sync_graph.py @@ -62,6 +62,8 @@ def _for_each_scalar_value(node: SyncNode, condition: Callable[[Any], bool], kin it returns True for the property value, the action is executed. kind (str): Either "remove" or "set" depending on whether you want to remove the property or replace the property. value (Callable): A function returning a new value that is set as the property value. This function receives the old value as the single argument. + + Last review by Alexander Schlemmer on 2024-05-24. """ for p in node.properties: if isinstance(p.value, list): @@ -122,7 +124,7 @@ class SyncGraph(): Usage: - Initialize the Graph with a list of entities. Those will be converted to the SyncNodes of the graph. - - SyncNodes that can be merged are automatically merged and SyncNodes where the existance can + - SyncNodes that can be merged are automatically merged and SyncNodes where the existence can be determined are automatically removed from the list of unchecked SyncNodes: graph.unchecked. - You manipulate the graph by setting the ID of a SyncNode (either to a valid ID or to None). @@ -132,6 +134,8 @@ class SyncGraph(): - Ideally, the unchecked list is empty after some manipulation. - You can export a list of entities to be inserted and one of entities to be updated with export_record_lists. + + Last review by Alexander Schlemmer on 2024-05-24. """ def __init__(self, entities: list[db.Entity], identifiableAdapter: IdentifiableAdapter): @@ -168,8 +172,9 @@ class SyncGraph(): if self._identifiable_is_needed(node): self._set_identifiable_of_node(node) - # everything in unchecked has no ID nor path. Thus, it must be possible to create an - # identifiable. + # everything in unchecked neither das have an ID nor a path. + # Thus, it must be possible to create an + # identifiable which is checked using the following function: for node in self.unchecked: self.identifiableAdapter.check_identifying_props(node)