caoscrawler.sync_node module
- class caoscrawler.sync_node.TempID
Bases:
int
A special kind of int for negative temporary IDs.
This allows to identify TempIDs in the presence of String IDs. A string ID might look like a negative integer.
- class caoscrawler.sync_node.SyncNode(entity: Entity, registered_identifiable: Optional[RecordType] = None, **kwargs)
Bases:
Entity
represents the information of an Entity as it shall be created in LinkAhead
The following information is taken from an db.Entity object during initialization or when the object is updated using the update member function: - id - role - path - file - name - description - parents - properties
Typically, this class is used in the following way: 1. A SyncNode is initialized with a db.Entity object. 2. The SyncNode object is possibly updated one or more times with other SyncNode objects. 3. A db.Entity object is created (export_entity) that contains the combined information.
- update(other: SyncNode) None
update this node with information of given
other
SyncNode.parents are added if they are not yet in the list properties are added in any case. This may lead to duplication of properties. We allow this duplication here and remove it when we create a db.Entity (export_entity function) because if property values are SyncNode objects, they might not be comparable (no ID, no identifiable) yet.