Shape-Aware Three-Way Merge for RDF Knowledge Graphs: The schema defines the conflict: an implementation and evaluation: what it means for business leaders

A merge operator for shared knowledge graphs lets the schema decide which concurrent edits need a person, and in testing it asked 33 questions where its nearest neighbor asked 845.

1. What the method is

This is a three-way merge operator for RDF knowledge graphs in which the schema, not the text of a file, defines a conflict. Triples are canonicalized and merged as sets, so the order in which a graph was written out can never produce a conflict. A SHACL shapes graph, the same one that validates ordinary writes, then decides which slots the merge may settle alone. A slot is a subject and predicate pair, and it is contended only where a shape bounds its cardinality and both sides' changes cannot stand within that bound. Unbounded slots take the union, contended slots go to a person, and the merged result is validated against the same shapes. It ships as about 480 lines of Rust in Quipu, a governed bitemporal RDF store. The author makes no claim to the first three-way merge for RDF: the contribution is the conflict rule, the implementation and the evaluation.

2. Why the method was developed

When several writers edit one graph, the copies diverge and something has to reconcile them. Keeping the graph in a file under git fails in both directions. A line merge reports conflicts when two writers add unrelated facts about one entity or merely re-serialize the file, and it merges cleanly when two writers set different values on a property the ontology says holds exactly one, which is the case that needs a decision. Quit Store's Context Merge, the nearest prior work, already merges triples as sets but flags a conflict wherever both sides touched the same node, which measures whether edits are related rather than whether they can both be true. Automatic schemes such as last-writer-wins or convergent replicated types always pick a winner, so on a single-valued property they silently discard one writer's assertion. The paper's position is that the store's shapes already state which values compete.

3. Who should care

This matters to any of our teams running a shared knowledge graph or agent memory that several agents and people write to at once, and to anyone evaluating a graph store for that purpose. Data platform engineers should care because the merge policy stops being a separate configuration to keep in step with the ontology. Whoever owns the schema should care more, because shape quality becomes merge quality: the paper shows a missing cardinality bound loses data silently, while a spurious one only adds review questions. Operations leads who staff review queues are the direct beneficiaries, since the measured gain is fewer human decisions, not better detection. Teams whose main problem is duplicate entities under different names should note that this operator does nothing for them, and that the paid resolution model tested alongside it did not beat free label matching on the hard cases.

4. How the method works

The operator takes a base graph and two descendants, ours and theirs, and computes each side's additions and removals by set difference. A slot is a candidate only when both sides changed it and disagree. It is contended when the three-way set merge of its values exceeds the declared maximum count, or when the bound is one, the base held a value, and one side deleted it while the other replaced it. That yields three classes: functional divergence, cardinality overflow and delete/modify. If any slot is contended the operator writes nothing and returns a decision record per slot with the subject, predicate, declared bound and the base, ours and theirs values. Otherwise it applies the merged set and records both parent shares on the transaction. The common ancestor is found by content hash from the manifest in each shared bundle, and the shapes are read from the bundle rather than the local store.

5. How it was evaluated

The evaluation has six arms. A synthetic benchmark edits two copies of a seeded graph independently and scores eight strategies over five seeds: three git line-merge variants, union, last-writer-wins, a plain triple merge, a reimplementation of Context Merge's overlap rule, and the shape-aware operator. Each is charged for human decisions, constraint violations admitted, and triples lost or fabricated, and the arm is re-judged under deliberately wrong shapes. A replay drives the shipped operator on incidents recorded in one production multi-agent graph: 93 alias repairs made by people, and description values the append path had doubled. Other arms walk a share, diverge and reconnect lifecycle, test a hosted decision model against free baselines on the aliases, run five schema-change fixtures, and check 24 single-slot cases with an oracle that reads no shapes. The author says plainly that most positive results are scored against the same shapes that define the conflicts.

6. How it performed

Summed over five seeds, the shape-aware operator raised 33 decisions, all true conflicts, with no triples lost or fabricated and no violations admitted; the Context Merge reimplementation found the same 33 and asked 845 questions, a count the author notes a reviewer settling whole subjects would reduce. Union admitted 53 to 72 violations per seed. All arms missed the 21 alias conflicts, and the replay detected none of 93 recorded alias repairs; it would have raised 939 decisions on doubled descriptions, a counterfactual. The shape-blind oracle agreed on facts and history in every reachable case. Limits: perfect precision is by construction, a missing bound dropped recall from 0.611 to 0.426 and admitted 10 violations silently, one conflict blocks the whole merge, datatype changes escape the detector, and the evidence is one deployment. Our call: pilot it only where we already run a SHACL-governed graph with several writers, and watch otherwise. (Source: arXiv 2611.34870, 2026)

← Back to dossier index