On this page
Review duplicates in Aurelia
Review two supplied Aurelia duplicate cases and practise a partial decision with an explicitly added teaching record.
Use two known Aurelia cases to distinguish resemblance from identity, then practice a partial decision with an explicitly added teaching record. These exercises change sample data. Use an isolated learning environment and reset Aurelia afterwards.
Before you begin
Install Aurelia in its initial state: 378 customer records and no completed
steward decisions. You need STEWARD or ADMIN plus access to the sample
entity. Installation, reset, and ignore/unignore require ADMIN.
For API steps, use the connection setup and
curl with jq. Keep the sample’s automatic steward unattached during the
exercise. Complete the read-only quality exercise first.
Compare the two candidate groups
Open the email group containing Ana’s two CRM records. In the initial sample
it contains CRM-0001 and CRM-DUP-0001 and is classified MATCH after
cleaning. Compare names, tax identifier, email, and phone. Read the evaluation
rather than treating the score as a probability.
Now inspect the name-and-postcode group containing CRM-NEAR-0001 and
CRM-NEAR-0002. The two Javier records remain in REVIEW. Their names and
postcode agree, but their tax identifiers differ. The supplied scenario
describes two different people. Similarity alone is a poor reason to merge them.
Record that the Javier pair is different
Copy the two groups’ current identifiers from Duplicates → Expert. For the
API commands below, set ANA_CLUSTER_ID and JAVIER_CLUSTER_ID to those
identifiers. The identifiers depend on the index keys and may change when the
indexer changes. Verify each group contains the expected record identifiers
before a decision.
read -r -p 'Ana cluster ID: ' ANA_CLUSTER_ID
read -r -p 'Javier cluster ID: ' JAVIER_CLUSTER_ID
Choose They are different for the Javier pair, or call:
curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $GOLDEN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"comment":"Different tax identifiers; the sample describes two people"}' \
"$GOLDEN_URL/api/golden/sample-customer-entity/duplicates/clusters/${JAVIER_CLUSTER_ID}/disconnect"
Read both records. They remain distinct, and their _metadata._unrelated
values record the separation. The judgment does not require that they vanish
from every candidate view. A later merge of that separated pair is refused
unless someone explicitly overrides the separation with a comment.
Prepare a third record for the partial decision
The supplied Ana email group has two records. The following teaching extension adds an unrelated person using the same contact email. It is not part of the installed sample.
curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $GOLDEN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"insert":true,"record":{"fullName":"Another person",
"email":"ana.garcia@example.com","taxId":"87654321X"},
"comment":"Teaching extension: unrelated person sharing an email"}' \
"$GOLDEN_URL/api/golden/sample-customer-entity/upsert" \
> aurelia-extension.json
OTHER_ID=$(jq -er '.record._id' aurelia-extension.json)
Keep the returned identifier. A forced insertion generates an identity; do not
assume an identifier supplied in the input will be retained. Wait until the
email group’s evaluation includes OTHER_ID, CRM-0001, and CRM-DUP-0001.
If indexing is pending, follow the record’s index status before proceeding.
Separate the third person
jq -n --arg id "$OTHER_ID" \
'{recordIds:[$id],comment:"Different person sharing a contact email"}' |
curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $GOLDEN_TOKEN" \
-H "Content-Type: application/json" --data-binary @- \
"$GOLDEN_URL/api/golden/sample-customer-entity/duplicates/clusters/${ANA_CLUSTER_ID}/disconnect/records"
Read the three records. The third record is unrelated to both Ana records; this action has not separated the two Ana records from each other. The records still exist. Merging all three without an override is now refused.
Merge only the two Ana records
Preview the selected result first:
curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $GOLDEN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"recordIds":["CRM-0001","CRM-DUP-0001"]}' \
"$GOLDEN_URL/api/golden/sample-customer-entity/duplicates/clusters/${ANA_CLUSTER_ID}/merge/records/preview"
Inspect the proposed values, then apply the same selection:
curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $GOLDEN_TOKEN" \
-H "Content-Type: application/json" \
-d '{"recordIds":["CRM-0001","CRM-DUP-0001"],"comment":"Merge the two Ana records"}' \
"$GOLDEN_URL/api/golden/sample-customer-entity/duplicates/clusters/${ANA_CLUSTER_ID}/merge/records" \
> aurelia-merge.json
SURVIVOR_ID=$(jq -er '.record._id' aurelia-merge.json)
Verify that the survivor has the expected values and contributing origins.
Read OTHER_ID separately: it still exists, and the survivor retains the
separation from it. Selection limits which source records are merged.
Undo and inspect
Send the returned survivor identifier to merge undo:
jq -n --arg id "$SURVIVOR_ID" \
'{recordId:$id,comment:"Undo tutorial merge"}' |
curl --fail-with-body --silent --show-error \
-H "Authorization: Bearer $GOLDEN_TOKEN" \
-H "Content-Type: application/json" --data-binary @- \
"$GOLDEN_URL/api/golden/sample-customer-entity/merge/undo"
Verify that CRM-0001 and CRM-DUP-0001 are back. Undo depends on retained
history; it is not a general rollback for every edit or deletion.
Reset and continue
The exercises also recorded separation and audit information. Deleting the teaching record alone does not restore a pristine sample. Have an administrator reinstall Aurelia, then verify the original 378 records and the initial Ana and Javier cases before repeating the tutorial.