Merge Rules for Arrays of Values

The Semantic Modeler merge rules described in this topic apply to arrays of simple values, for example, "primaryKey": ["Calendar Date"]. Semantic Modeler's merge strategy treats arrays as set-like collection to preserve order where possible, and doesn't use order for identity.

Merge Semantics

This section describes how Semantic Modeler's merge strategy evaluates and merges arrays of simple values.

  • Evaluates array elements as independent values (no positional identity).
  • Applies set-like (union) semantics for combining changes.
  • Automatically merges non-overlapping additions, deletions, and modifications.
  • Doesn't generate conflicts for divergent changes to array elements.
  • Preserves order when only one branch reorders; otherwise, it resolves order deterministically.
  • Treats modifications and renames as value replacement operations.

Global Changes

This table lists the general merge rules for arrays of simple values.

Local Branch Remote Branch Result
No change Change Keep Remote
Change No change Keep Local
Same change Same change Keep
Change value Change same value to different than Local branch Keep both

Change Conflict Conditions

There are no merge conflict for arrays of values. Different changes to the same value don't produce a conflict. Instead, both changes are kept.

Change Types

This section lists and describes the object-level changes evaluated by the merge.

  • Addition: Local or Remote branch adds value. Value not in Base.
  • Deletion: Local or Remote branch removes value. Value present in Base.
  • Modification or Rename: Local or Remote branch changes value (renames). Value present in Base.
  • Reorder: Local or Remote branch modifies the sequence or order of items. Order present in Base.

Complete List of Changes and Merge Rules

This table lists and explains Semantic Modeler's merge rules for arrays of simple values.

Local Modification Branch Modification Rule (Natural Language) Result
No change No change No change made in either branch. No change in merge result. No action
No change Addition Remote branch adds new item. Merge results include new item. Addition kept
No change Modification Remote branch modifies an item. Merge results include modified item. Modification kept
No change Deletion Remote branch deletes an item. Merge results reflect item deletion. Deletion kept
Addition No change Local branch adds item. Merge results include new item. Addition kept
Addition Addition (same item) Local and Remote branches add the same item. Merge results keep only one instance of the item. Addition kept
Addition Addition (different item) Both branches make different changes to the same item. Merge results contain both items (union). Additions kept
Modification No change Local branch modified or renames item. Merge results contain the modified or renamed item. Modification kept
Modification Modification (same change) Both branches make the same change to item. Merge results include the changed item. Modification kept
Modification Modification (different change) Both branches make the different changes to the same item. Merge results include both changes (union). Modification merged
Modification Deletion Local branch modifies an item and Remote branch deletes the same item. Merge results include both changes (union). Modification merged
Deletion No change Local branch deletes item. Merge results remove item. Deletion kept
Deletion Modification Local branch deletes item and Remote branch modifies or renames item. Merge results include both items (union). Modification merged
Deletion Deletion (same items) Local and Remote branches delete the same item. Merge results deletes item. Deletion kept
Deletion Deletion (different items) Local and Remote branches delete different items. Merge results delete items. Deletion merged
No change Reorder Remote branch reorders items. Merge results contains reordered items. Remote order kept
Reorder No change Local branch reorders items. Merge results contains reordered items. Local order kept
Reorder Reorder Local branch and Remote branch reorder the same items. Merge results contains the Local branch's order. Local order kept