Chapter 03

Record Linkage, Similarity & Data Fusion

Once schemas are reconciled, the same real-world entity still appears under different strings in different sources. This chapter covers how to measure string similarity (edit distance, Jaccard, Soundex), how to decide that two records match (rule-based, learned, probabilistic — with blocking for scale), and how to fuse conflicting values afterwards.

Reading: ~25 min Interactive: 2 widgets Source: Polimi TIS 2025/26 — Structured Data Integration 2 (deck 03)

01 · Problem

Record linkage & entity resolution

Schema reconciliation lined up the structures. But the same real-world object — a person, a product — is still recorded with different values in different sources. Finding those matches is record linkage (a.k.a. entity resolution); reconciling what they disagree on is data fusion.

Whatever the data model, we must recognise when two records hold the same information — and, crucially, we can do this field by field rather than on the whole tuple as one blob. Compare Tanca | Letizia | DEIS | Lonardo with Tanca | Letizia | DEIB | Leonardo: split into fields, we can use the knowledge that Leonardo is a Politecnico campus to see that Lonardo is a typo of it and DEIS a typo of DEIB. Glue the tuple into one string and that structured knowledge is lost.

The mismatches record linkage must survive are everyday ones: typing errors (Givanni vs Giovanni), different conventions (Sept 20th vs 20/9), nicknames (Giuseppe vs Beppe), inversions (Giovanni Rossi vs Rossi, Giovanni), and abbreviations (Politecnico di Milano vs PoliMI).

02 · Method

String similarity measures

Given two sets of strings, find all pairs that refer to the same entity — each such pair is a match. The tool is a similarity measure s(x,y)[0,1]s(x,y) \in [0,1] with s(x,y)=1    x=ys(x,y) = 1 \iff x = y; the closer to 0, the less similar. We declare a match when

s(x,y)t,0t1.s(x,y) \ge t, \qquad 0 \le t \le 1.

(Using a distance instead changes nothing: lower similarity means higher distance.) The measures come in families — sequence-based (edit distance, Needleman-Wunsch, affine gap, Smith-Waterman, Jaro, Jaro-Winkler), set-based (overlap, Jaccard, TF/IDF), hybrid (generalized Jaccard, soft TF/IDF, Monge-Elkan), and phonetic (Soundex). Three matter most here.

Edit (Levenshtein) distance

The minimal number of single-character insertions, deletions and replacements that turn string aa into bb. Turned into a similarity by normalising against the longer string.

Jaccard (set-based)

View each string as a multiset of tokens (e.g. bigrams) and compare the token sets — robust to word order and small edits.

Soundex (phonetic)

A four-character code from a word’s pronunciation; two words match if their codes are equal.

Worked examples The two measures worked out

Edit similarity. For strings aa and bb,

s(a,b)=1d(a,b)max(a,b).s(a,b) = 1 - \frac{d(a,b)}{\max(\lvert a\rvert, \lvert b\rvert)}.

For a=a = “Politecnico di Milano” and b=b = “Politecnico Milano”, we delete the d and the i, so d(a,b)=2d(a,b) = 2 and (with the slide’s lengths 1919 and 1717)

s(a,b)=12max(19,17)=10.105=0.894— acceptable.s(a,b) = 1 - \frac{2}{\max(19, 17)} = 1 - 0.105\ldots = 0.894\ldots \quad\text{— acceptable.}

Jaccard. Tokenise into padded bigrams. For pinoA={#p,pi,in,no,o#}A = \{\texttt{\#p}, \texttt{pi}, \texttt{in}, \texttt{no}, \texttt{o\#}\} and pinB={#p,pi,in,n#}B = \{\texttt{\#p}, \texttt{pi}, \texttt{in}, \texttt{n\#}\},

J(A,B)=ABAB=ABA+BAB=35+43=36=12.J(A,B) = \frac{\lvert A \cap B\rvert}{\lvert A \cup B\rvert} = \frac{\lvert A \cap B\rvert}{\lvert A\rvert + \lvert B\rvert - \lvert A \cap B\rvert} = \frac{3}{5 + 4 - 3} = \frac{3}{6} = \frac{1}{2}.

The dynamic-programming table behind d(a,b)d(a,b) is worth seeing once. It is seeded with a near-duplicate name of exactly the kind linkage has to score — one substitution and one insertion, so d=2d = 2 — and the highlighted path is the alignment that achieves it. Divide by the longer length to get the similarity s(a,b)s(a,b) above, then compare against your threshold:

Hands-on

Levenshtein edit-distance matrix

Type two strings. Each cell is the minimum of delete (↑+1), insert (←+1), and substitute (↖+0/+1). The highlighted path is one optimal alignment; the corner is the edit distance.

distance = 2
εCathy Robbert
ε012345678910111213
K112345678910111213
a22123456789101112
t3321234567891011
h443212345678910
y55432123456789
66543212345678
R77654321234567
o88765432123456
b99876543212345
e1010987654322234
r11111098765433323
t121211109876544432
TakeawayMinimum edit distance is the candidate-ranking primitive in the noisy-channel spelling corrector: the best correction balances how close a candidate is to the typo against how likely the word is.
×

Soundex is a double-edged tool

Matching by sound is great for names that evolved phonetically (Legoff / Legough) but wrong for ordinary words that merely sound alike (coughing / coffin). It is also strongly language-dependentgn is pronounced differently in English and Italian — so it is a specialist tool, not a default.

03 · Method

Record matching & data fusion

A string measure compares fields; record matching decides whether two whole tuples are the same entity. Three approaches, plus one indispensable optimisation:

Rule-based

Hand-written rules — “same SSN ⇒ same person”, or a weighted blend sim(x,y)=0.5sSSN+0.2sname+0.1sage+\text{sim}(x,y) = 0.5\,s_{\text{SSN}} + 0.2\,s_{\text{name}} + 0.1\,s_{\text{age}} + \ldots with the best similarity measure chosen per attribute. Accurate but labour-intensive.

Learned

Learn the matching from data — supervised (labelled matching / non-matching pairs, needs lots of training data) or unsupervised (cluster similar values).

Probabilistic

Model the matching domain with a probability distribution and reason over it (the classic Fellegi-Sunter-style approach): principled and knowledge-friendly, but computationally expensive and hard to debug.

All three still end at the same place: a score, and a decision about where to cut it. That decision is harder than s(x,y)ts(x,y) \ge t makes it look — set the cut anywhere and some of these pairs come out wrong:

Hands-on

Matching by threshold — and why one cut is not enough

Seven pairs, scored with the chapter's normalised edit similarity. Set the two cuts: above the upper one is a match, below the lower one a non-match, and between them a possible match that a human reviews. The tick marks show which pairs are really the same entity.

Matched
3
To review
1
Wrong decisions
1 FP · 2 FN
Pairs(a,b)truthdecision
Maria Rossi vs Mario Rossi0.91differentmatch
Givanni vs Giovanni0.88samematch
Kathy Robert vs Cathy Robbert0.85samematch
Legoff vs Legough0.57samepossible — review
coughing vs coffin0.50differentnon-match
Politecnico di Milano vs PoliMI0.24samenon-match
Giovanni Rossi vs Rossi, Giovanni0.13samenon-match

Misclassified · One character apart and NOT the same person. No string measure can tell — only another field can.

Try thisDrag both cuts together so there is no review band, then move the single cut anywhere you like. Maria Rossi / Mario Rossi scores ~0.91 and is a different person; Politecnico di Milano / PoliMI scores ~0.29 and is the same institution. Any cut that rejects the first also rejects the second.
TakeawayA similarity plus a threshold is the shape of the decision, not a solution to it. One measure over one field cannot separate typos from genuinely different people, so real linkage compares field by field with the right measure per attribute, defers the middle band to a human, and uses blocking to avoid scoring every pair in the first place.
key

Blocking — beating the quadratic wall

Comparing every pair is O(n2)O(n^2) — hopeless at scale. Blocking first partitions records into small blocks of plausibly-similar records (by some cheap metric) and compares only within corresponding blocks, dropping the cost to the sum of the squares of the block sizes. It is applied before the real matching rules.

Data fusion

Once two records are known to be the same entity, their fields may still disagree — which salary is right? Inconsistency can arise because a source is simply wrong, or because each source holds a correct but partial view (two workplaces, where the true salary is the sum; an author list that is incomplete; a middle name given only as an initial). A resolution function produces the reconciled value — often a function of the originals such as value1+value2\text{value}_1 + \text{value}_2 or 0.5value1+0.5value20.5\,\text{value}_1 + 0.5\,\text{value}_2.

tip

Fusion as an aggregated outer-join

The lecture’s fusion example is compact: match two employee tables, then compute R = MAX_AGE, SUM_SALARY(R1 OuterJoin R2) — outer-join keeps everyone, and the per-attribute resolution functions (MAX on age, SUM on the partial salaries) settle each conflict.

key

Bridge to different data models

Everything so far assumed a single (relational) data model. Real integration also spans different models — relational, XML, JSON, the open Web. That needs a new element, the wrapper (a translator that exposes a non-relational source as if it were relational), which opens the next chapter on semistructured integration.

Load-bearing ideas

  • Record linkage finds records for the same entity across sources; data fusion reconciles the values they disagree on. Compare field by field, not tuple-as-string.
  • Similarity + threshold: s(x,y)[0,1]s(x,y) \in [0,1], match iff sts \ge t. Know edit similarity (1d/max(a,b)1 - d/\max(\lvert a\rvert,\lvert b\rvert)), Jaccard on token sets, and Soundex (phonetic, language-dependent).
  • Matching: rule-based (weighted per-attribute), learned (supervised/unsupervised), probabilistic; blocking cuts the O(n2)O(n^2) cost.
  • Fusion: a resolution function (SUM, MAX, average…) per conflicting attribute, typically over an outer-join.