caosadvancedtools.structure_mapping module#
- class caosadvancedtools.structure_mapping.EntityMapping#
Bases:
objectmap local entities to entities on the server
the dict to_existing maps _cuid property to entity objects the dict to_target maps id property to entity objects
- add(target, existing)#
- caosadvancedtools.structure_mapping.collect_existing_structure(target_structure, existing_root, em)#
recursively collects existing entities
The collected entities are those that correspond to the ones in target_structure.
em: EntityMapping
- caosadvancedtools.structure_mapping.update_matched_entity(em, updating, target_record, existing_record)#
update the Record existing in the server according to the Record supplied as target_record
- caosadvancedtools.structure_mapping.update_structure(em, updating: Container, target_structure: Record)#
compare the existing records with the target record tree created from the h5 object
- Parameters:
existing_structure – retrieved entity; e.g. the top level identifiable
target_structure (db.Record) – A record which may have references to other records. Must be a DAG.