Entity Matching pipeline
An Entity Matching pipeline finds nodes that describe the same real-world entity: it compares nodes of the source types with nodes of the target types and proposes the pairs whose similarity reaches the cutoff.
This Terraform configuration creates one pipeline that:
1. Compares Person nodes with Person nodes (source_node_filter and target_node_filter).
2. Proposes matches with a similarity of 0.8 or more (similarity_score_cutoff; the default is 0.5).
Runs are started on demand through the Entity Matching API; the configuration only declares what to compare.
Use case
Scenario: customer records arrive from several systems and the same person appears more than once in the graph.
- The pipeline is declared once, in version control, with the node types to compare and the cutoff the data team agreed on.
- Each run is triggered with POST /entity-matching/v1/pipelines/{id}/runs once the automatic property mapping has reached SUCCESS; its status and proposed matches are read back through the same API.
- Raising or lowering similarity_score_cutoff is an update; changing the node types means a new pipeline, since the filters cannot change after creation.
Requirements
- ServiceAccount credentials created in the IndyKite Hub for your organization.
- IndyKite Terraform provider 0.49.0 or later, the release the example pins in required_providers; the Terraform guide lists the version each feature first appeared in.
- A project GID for project_id, and an Application Agent with the EntityMatching permission to run the pipeline afterwards.
Steps
1. Put your project GID in project_id and choose the node types to compare.
2. Apply. The pipeline's GID is in the resource id.
3. Read the suggested property mapping and start a run through the Entity Matching API, as the Entity Matching guide shows.
4. Adjust similarity_score_cutoff and apply again when the proposed matches are too loose or too strict.
An Entity Matching pipeline comparing Person nodes with a 0.8 similarity cutoff.
terraform {
required_providers {
indykite = {
source = "indykite/indykite"
version = ">= 0.49.0" # or a later release
}
}
}
# indykite provider integrates IndyKite platform with Terraform scripting.
# Provider for now does not support any parameters and all is set within service account credential file.
provider "indykite" {}
# An Entity Matching pipeline compares nodes of the source types with nodes of
# the target types and proposes matches above the similarity cutoff. Runs are
# started by POST /entity-matching/v1/pipelines/{id}/runs; rerun_interval is
# accepted but schedules nothing.
# source_node_filter and target_node_filter cannot be changed after creation.
resource "indykite_entity_matching_pipeline" "person_dedup" {
name = "terraform-entity-matching"
display_name = "Terraform entity matching"
description = "Finds Person nodes that describe the same individual"
project_id = "gid:AAAAAmluZHlraURlgAABDwAAAAA" # your project GID
source_node_filter = ["Person"]
target_node_filter = ["Person"]
similarity_score_cutoff = 0.8 # 0 to 1; defaults to 0.5
}