The app used in this example contains two tables TableA and TableB. There are no synthetic keys in the tables.
TableA contains two fields FieldA-1 and FieldA-2.
TableB contains two fields FieldB-1 and FieldB-2.
Compute the association scores for each pair of fields in the tables TableA and TableB by using the GetAssociationScores method.
The client sends:
{
"jsonrpc": "2.0",
"id": 5,
"method": "GetAssociationScores",
"handle": 1,
"params": [
"TableA",
"TableB"
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 5,
"result": {
"qScore": [
{
"qFieldPairName": "FieldA-1 / FieldB-1",
"qScoreSummary": 0,
"qField1Scores": {
"qFieldName": "FieldA-1",
"qCardinalRatio": 1,
"qSymbolScore": 0.42857142857142855,
"qRowScore": 0.42857142857142855
},
"qField2Scores": {
"qFieldName": "FieldB-1",
"qCardinalRatio": 0.83333333333333337,
"qSymbolScore": 0.6,
"qRowScore": 0.66666666666666663
}
},
{
"qFieldPairName": "FieldA-1 / FieldB-2",
"qScoreSummary": -1,
"qField1Scores": {
"qFieldName": "FieldA-1",
"qCardinalRatio": 0,
"qSymbolScore": 0,
"qRowScore": 0
},
"qField2Scores": {
"qFieldName": "FieldB-2",
"qCardinalRatio": 0,
"qSymbolScore": 0,
"qRowScore": 0
}
},
{
"qFieldPairName": "FieldA-2 / FieldB-1",
"qScoreSummary": -1,
"qField1Scores": {
"qFieldName": "FieldA-2",
"qCardinalRatio": 0,
"qSymbolScore": 0,
"qRowScore": 0
},
"qField2Scores": {
"qFieldName": "FieldB-1",
"qCardinalRatio": 0,
"qSymbolScore": 0,
"qRowScore": 0
}
},
{
"qFieldPairName": "FieldA-2 / FieldB-2",
"qScoreSummary": 0,
"qField1Scores": {
"qFieldName": "FieldA-2",
"qCardinalRatio": 0.7142857142857143,
"qSymbolScore": 0,
"qRowScore": 0
},
"qField2Scores": {
"qFieldName": "FieldB-2",
"qCardinalRatio": 0.83333333333333337,
"qSymbolScore": 0,
"qRowScore": 0
}
}
]
}
}
The association scores are returned.
For the pair FieldA-1 / FieldB-1 and the field FieldA-1, the following results are returned:
- qCardinalRatio is 1 because all values are unique in the field FieldA-1.
- qSymbolScore is 0.42857142857142855 because there are 3 distinct values in the field FieldA-1 that match the values in the field FieldB-1 and the number of distinct values in the field FieldA-1 is 7.
- qRowScore is 0.42857142857142855 because there are 3 values in the field FieldA-1 that match the values in the field FieldB-1 and the number of values in the field FieldA-1 is 7.
For the pair FieldA-1 / FieldB-1 and the field FieldB-1, the following results are returned:
- qCardinalRatio is 0.83333333333333337 because there are 5 values over 6 that are unique in the field FieldB-1.
- qSymbolScore is 0.6 because there are 3 distinct values in the field FieldB-1 that match the values in the field FieldA-1 and the number of distinct values in the field FieldB-1 is 5.
- qRowScore is 0.66666666666666663 because there are 4 values in the field FieldB-1 that match the values in the field FieldA-1 and the number of values in the field FieldB-1 is 6.
For the pair FieldA-1 / FieldB-2 and the field FieldA-1, the following results are returned:
- qScoreSummary is -1 because the fields FieldA-1 and FieldB-2 are different types. Therefore, all other fields (cardinal ratio, symbol score, row score) are all zero, which means that they were not computed.