diff --git a/src/linkahead/apiutils.py b/src/linkahead/apiutils.py index 71ec3d45f635a730ff7163254e058599dbb168af..dac163b8f0f508cacc004b7326475b58d0ec5390 100644 --- a/src/linkahead/apiutils.py +++ b/src/linkahead/apiutils.py @@ -587,8 +587,10 @@ def merge_entities(entity_a: Entity, raise NotImplementedError() for attribute in ("datatype", "unit", "value"): + # attribute is in r2 if (attribute in diff_r2["properties"][key] and diff_r2["properties"][key][attribute] is not None): + # but not in r1 if (attribute not in diff_r1["properties"][key] or diff_r1["properties"][key][attribute] is None): setattr(entity_a.get_property(key), attribute, @@ -596,6 +598,7 @@ def merge_entities(entity_a: Entity, elif force: setattr(entity_a.get_property(key), attribute, diff_r2["properties"][key][attribute]) + # attribute in r1 but no "force" else: raise_error = True if merge_id_with_resolved_entity is True and attribute == "value":