IP Library Granted Patent US 12688166
Granted Patent B2
US 12688166 · App. 18/783,851 · Granted Jul 21, 2026

Machine learning techniques for discovering keys in relational datasets

Inventors: Andrew Chang (Westford, MA); Richard Oberdorf (Spokane, WA); Song Wang (Westford, MA); Nathan Smith (Signal Mountain, TN)
Assignee: Ab Initio Technology LLC
G06F16/211G06F16/2282G06F40/30
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 12688166
App. No.
18/783,851
Granted
Jul 21, 2026
Kind
B2
Abstract

Techniques for discovering primary, unique, and/or foreign keys for relational datasets are described. The techniques include profiling the relational datasets to obtain respective data profiles; identifying one or more primary key candidates for a first relational dataset using a first data profile of the first relational dataset and a first trained machine learning model; identifying one or more foreign key proposals for a second relational dataset using the one or more primary key candidates by performing a subset analysis of the second relational dataset with respect to the first relational dataset; identifying one or more foreign key candidates for the second relational dataset using the first data profile, a second data profile of the second relational dataset, and a second trained machine learning model different from the first trained machine learning model; and outputting the at primary key candidate(s) and the foreign key candidate(s).

Claims (87)

1 . A method for identifying labels for keys discovered for multiple relational datasets managed by a data processing system, the method comprising:

using at least one computer hardware processor to perform:

identifying primary key candidates for a first relational dataset using a first data profile generated using values of entries in fields of the first relational dataset and a first trained machine learning (ML) model trained to score primary key proposals for a relational dataset using feature values obtained using a data profile generated from the relational dataset, wherein identifying the primary key candidates comprises:

generating, from the first data profile, sets of primary key feature values for respective primary key proposals, each of the primary key proposals corresponding to one or more fields of the first relational dataset; and

processing the sets of primary key feature values using parameter values of the first trained ML model to obtain outputs indicating an extent to which the primary key proposals can serve as primary keys for the first relational dataset;

identifying foreign key candidates for a second relational dataset using the first data profile, a second data profile generated using values of entries in fields of the second relational dataset, and a second trained ML model different from the first trained ML model, the second trained ML model trained to score foreign key proposals, wherein identifying the foreign key candidates comprises:

generating, from the first data profile and the second data profile, sets of foreign key feature values for respective foreign key proposals, each of the foreign key proposals corresponding to one or more fields of the second relational dataset; and

processing the sets of foreign key feature values using parameter values of the second trained ML model to obtain outputs indicating an extent to which the foreign key proposals can serve as foreign keys for the second relational dataset;

identifying, from among the primary key candidates, a primary key for the first relational dataset, the primary key being associated with a first field in the first relational dataset;

identifying, from among the foreign key candidates, a foreign key for the second relational dataset, wherein the foreign key is associated with a second field in the second relational dataset and references the primary key for the first relational dataset;

determining whether the first field in the first relational dataset is associated with a semantic label that indicates a semantic meaning of the first field; and

when the first field of the first relational dataset, with which the primary key is associated, is determined to be associated with the semantic label, assigning the semantic label to the second field of the second relational dataset with which the foreign key is associated.

2 . The method of claim 1 , further comprising generating data profiles for the multiple relational datasets, the generating comprising:

analyzing data stored in each of the multiple relational datasets to generate respective data profiles including the first and second data profiles for the respective first and second relational datasets, the analyzing comprising determining statistical attributes for the fields of the first and second relational datasets from values of entries in the fields.

3 . The method of claim 1 , wherein identifying the primary key candidates comprises:

determining scores for the respective primary key proposals by processing the sets of primary key feature values using the parameter values of the first trained ML model, wherein the scores for the primary key proposals are indicative of the extent to which the primary key proposals can serve as primary keys for the first relational dataset.

4 . The method of claim 1 , further comprising:

identifying the foreign key proposals for the second relational dataset using the primary key candidates for the first relational dataset by performing a subset analysis of the second relational dataset with respect to the first relational dataset.

5 . The method of claim 4 , wherein performing the subset analysis comprises:

determining whether values of data stored in a field of the second relational dataset are a subset of values of data stored in a primary key candidate for the first relational dataset; and

identifying the field of the second relational dataset as a foreign key proposal for the second relational dataset when the values of data stored in the field of the second relational dataset are a subset of the values of data stored in the primary key candidate for the first relational dataset.

6 . The method of claim 1 , wherein identifying the foreign key candidates for the second relational dataset comprises:

determining scores for respective foreign key proposals by processing the sets of foreign key feature values using the parameter values of the second trained ML model, wherein the scores for the foreign key proposals are indicative of the extent to which the foreign key proposals can serve as foreign keys for the second relational dataset that references a particular primary key candidate for the first relational dataset.

7 . The method of claim 1 , further comprising:

outputting the primary key candidates and the foreign key candidates.

8 . The method of claim 3 , wherein outputting the primary key candidates and the foreign key candidates comprises:

generating a graphical user interface displaying the primary key candidates and a quality rating of each of the primary key candidates that is determined based on the scores; and

generating a graphical user interface displaying the foreign key candidates, one or more primary key targets for each foreign key candidate of the foreign key candidates, and a quality rating of each of the one or more primary key targets.

9 . The method of claim 8 , further comprising:

receiving, via the graphical user interface, a selection of a particular primary key candidate from the displayed primary key candidates as the primary key for the first relational dataset; and

in response to receiving the selection of the particular primary key candidate as the primary key for the first relational dataset:

configuring the data processing system to indicate the selected particular primary key candidate as the primary key for the first relational dataset, wherein the configuring comprises storing a variable whose value indicates that the selected particular primary key candidate is the primary key for the first relational dataset.

10 . The method of claim 9 , further comprising:

receiving, for each foreign key candidate of the displayed foreign key candidates and via the graphical user interface, a selection of a primary key target from among the one or more primary key targets; and

in response to receiving, for a first foreign key candidate, a selection of a first primary key target from among the one or more primary key targets,

identifying the first foreign key candidate as the foreign key for the second relational dataset, and

configuring the data processing system to indicate the first foreign key candidate as the foreign key for the second relational dataset, wherein the configuring comprises storing a variable whose value indicates the first foreign key candidate is the foreign key for the second relational dataset,

wherein the first primary key target is the primary key for the first relational dataset.

11 . A system comprising:

at least one computer hardware processor; and

at least one non-transitory computer-readable storage medium storing instructions that, when executed by the at least one computer hardware processor, cause the at least one computer hardware processor to perform a method for identifying labels for keys discovered for multiple relational datasets managed by a data processing system, the method comprising:

identifying primary key candidates for a first relational dataset using a first data profile generated using values of entries in fields of the first relational dataset and a first trained machine learning (ML) model trained to score primary key proposals for a relational dataset using feature values obtained using a data profile generated from the relational dataset, wherein identifying the primary key candidates comprises:

generating, from the first data profile, sets of primary key feature values for respective primary key proposals, each of the primary key proposals corresponding to one or more fields of the first relational dataset; and

processing the sets of primary key feature values using parameter values of the first trained ML model to obtain outputs indicating an extent to which the primary key proposals can serve as primary keys for the first relational dataset;

identifying foreign key candidates for a second relational dataset using the first data profile, a second data profile generated using values of entries in fields of the second relational dataset, and a second trained ML model different from the first trained ML model, the second trained ML model trained to score foreign key proposals, wherein identifying the foreign key candidates comprises:

generating, from the first data profile and the second data profile, sets of foreign key feature values for respective foreign key proposals, each of the foreign key proposals corresponding to one or more fields of the second relational dataset; and

processing the sets of foreign key feature values using parameter values of the second trained ML model to obtain outputs indicating an extent to which the foreign key proposals can serve as foreign keys for the second relational dataset;

identifying, from among the primary key candidates, a primary key for the first relational dataset, the primary key being associated with a first field in the first relational dataset;

identifying, from among the foreign key candidates, a foreign key for the second relational dataset, wherein the foreign key is associated with a second field in the second relational dataset and references the primary key for the first relational dataset;

determining whether the first field in the first relational dataset is associated with a semantic label that indicates a semantic meaning of the first field; and

when the first field of the first relational dataset, with which the primary key is associated, is determined to be associated with the semantic label, assigning the semantic label to the second field of the second relational dataset with which the foreign key is associated.

12 . The system of claim 11 , wherein the method further comprises:

executing one or more database queries with respect to the first relational dataset and the second relational dataset using the primary key for the first relational dataset and the foreign key for the second relational dataset.

13 . The system of claim 11 , wherein identifying the primary key candidates comprises:

determining scores for the respective primary key proposals by processing the sets of primary key feature values using the parameter values of the first trained ML model, wherein the scores for the primary key proposals are indicative of the extent to which the primary key proposals can serve as primary keys for the first relational dataset.

14 . The system of claim 11 , wherein the method further comprises:

identifying the foreign key proposals for the second relational dataset using the primary key candidates for the first relational dataset by performing a subset analysis of the second relational dataset with respect to the first relational dataset.

15 . The system of claim 14 , wherein performing the subset analysis comprises:

determining whether values of data stored in a field of the second relational dataset are a subset of values of data stored in a primary key candidate for the first relational dataset; and

identifying the field of the second relational dataset as a foreign key proposal for the second relational dataset when the values of data stored in the field of the second relational dataset are a subset of the values of data stored in the primary key candidate for the first relational dataset.

16 . The system of claim 11 , wherein identifying the one or more foreign key candidates for the second relational dataset comprises:

determining scores for the foreign key proposals by processing the sets of foreign key feature values using the parameter values of the second trained ML model, wherein the scores for the foreign key proposals are indicative of the extent to which the foreign key proposals can serve as foreign keys for the second relational dataset that references a particular primary key candidate for the first relational dataset.

17 . The system of claim 13 , wherein the method further comprises:

outputting the primary key candidates and the foreign key candidates, wherein the outputting comprises:

generating a graphical user interface displaying the primary key candidates and a quality rating of each of the primary key candidates that is determined based on the scores; and

generating a graphical user interface displaying the foreign key candidates, one or more primary key targets for each foreign key candidate of the foreign key candidates, and a quality rating of each of the one or more primary key targets.

18 . The system of claim 17 , further comprising:

receiving, via the graphical user interface, a selection of a particular primary key candidate from the displayed primary key candidates as the primary key for the first relational dataset; and

in response to receiving the selection of the particular primary key candidate as the primary key for the first relational dataset:

configuring the data processing system to indicate the selected particular primary key candidate as the primary key for the first relational dataset, wherein the configuring comprises storing a variable whose value indicates that the selected particular primary key candidate is the primary key for the first relational dataset.

19 . The system of claim 18 , further comprising:

receiving, for each foreign key candidate of the displayed foreign key candidates and via the graphical user interface, a selection of a primary key target from among the one or more primary key targets; and

in response to receiving, for a first foreign key candidate, a selection of a first primary key target from among the one or more primary key targets,

identifying the first foreign key candidate as the foreign key for the second relational dataset, and

configuring the data processing system to indicate the first foreign key candidate as the foreign key for the second relational dataset, wherein the configuring comprises storing a variable whose value indicates the first foreign key candidate is the foreign key for the second relational dataset,

wherein the first primary key target is the primary key for the first relational dataset.

20 . At least one non-transitory computer-readable storage medium storing instructions that, when executed by at least one computer hardware processor, cause the at least one computer hardware processor to perform a method for identifying labels for keys discovered for multiple relational datasets managed by a data processing system, the method comprising:

identifying primary key candidates for a first relational dataset using a first data profile generated using values of entries in fields of the first relational dataset and a first trained machine learning (ML) model trained to score primary key proposals for a relational dataset using feature values obtained using a data profile generated from the relational dataset, wherein identifying the primary key candidates comprises:

generating, from the first data profile, sets of primary key feature values for respective primary key proposals, each of the primary key proposals corresponding to one or more fields of the first relational dataset; and

processing the sets of primary key feature values using parameter values of the first trained ML model to obtain outputs indicating an extent to which the primary key proposals can serve as primary keys for the first relational dataset;

identifying foreign key candidates for a second relational dataset using the first data profile, a second data profile generated using values of entries in fields of the second relational dataset, and a second trained ML model different from the first trained ML model, the second trained ML model trained to score foreign key proposals, wherein identifying the foreign key candidates comprises:

generating, from the first data profile and the second data profile, sets of foreign key feature values for respective foreign key proposals, each of the foreign key proposals corresponding to one or more fields of the second relational dataset; and

processing the sets of foreign key feature values using parameter values of the second trained ML model to obtain outputs indicating an extent to which the foreign key proposals can serve as foreign keys for the second relational dataset;

identifying, from among the primary key candidates, a primary key for the first relational dataset, the primary key being associated with a first field in the first relational dataset;

identifying, from among the foreign key candidates, a foreign key for the second relational dataset, wherein the foreign key is associated with a second field in the second relational dataset and references the primary key for the first relational dataset;

determining whether the first field in the first relational dataset is associated with a semantic label that indicates a semantic meaning of the first field; and

when the first field of the first relational dataset, with which the primary key is associated, is determined to be associated with the semantic label, assigning the semantic label to the second field of the second relational dataset with which the foreign key is associated.