G2Engine How
How
howEntityByEntityID
howEntityByEntityID()
determines and details steps-by-step how records resolved to an ENTITY_ID.
In most cases how provides more detailed information than why as the resolution is detailed step-by-step.
Parameters
- entity_id: (int) The entity ID for the entity to be analyzed.
- response_bytearray: (bytearray) Object to store the output of the method.
- g2_engine_flags: (int [optional]) One or more flags used to determine response document content. Applicable flags are listed here howEntityByEntityID flags)
Click to expand howEntityByEntityID() example
Example
#! /usr/bin/env python3
from senzing import G2Engine, G2Exception
import json
# REPLACE /home/user/your_project with the path to your Senzing project
senzing_engine_configuration_json = '{ "PIPELINE": { "CONFIGPATH": "/home/user/your_project/etc", "SUPPORTPATH": "/home/user/your_project/data", "RESOURCEPATH": "/home/user/your_project/resources" }, "SQL": { "CONNECTION": "sqlite3://na:na@/home/user/your_project/var/sqlite/G2C.db" } }'
g2_engine = G2Engine()
entity_id = 1
response_bytearray = bytearray()
try:
g2_engine.howEntityByEntityID(
entity_id,
response_bytearray)
g2_engine.destroy()
print(response_bytearray.decode())
except G2Exception as err:
print(err)
Output
{
"HOW_RESULTS":
{
"RESOLUTION_STEPS":
[
{
"STEP": 1,
"VIRTUAL_ENTITY_1":
{
"VIRTUAL_ENTITY_ID": "V2",
"MEMBER_RECORDS":
[
{
"INTERNAL_ID": 2,
"RECORDS":
[
{
"DATA_SOURCE": "CUSTOMERS",
"RECORD_ID": "1002"
}
]
}
]
},
"VIRTUAL_ENTITY_2":
{
"VIRTUAL_ENTITY_ID": "V4",
"MEMBER_RECORDS":
[
{
"INTERNAL_ID": 4,
"RECORDS":
[
{
"DATA_SOURCE": "CUSTOMERS",
"RECORD_ID": "1004"
}
]
}
]
},
"INBOUND_VIRTUAL_ENTITY_ID": "V4",
"RESULT_VIRTUAL_ENTITY_ID": "V2-S1",
"MATCH_INFO":
{
"MATCH_KEY": "+NAME+DOB+ADDRESS",
"ERRULE_CODE": "CNAME_CFF_CEXCL",
"FEATURE_SCORES":
{
"ADDRESS":
[
{
"INBOUND_FEAT_ID": 76,
"INBOUND_FEAT": "1515 Adela Ln Las Vegas NV 89132",
"INBOUND_FEAT_USAGE_TYPE": "HOME",
"CANDIDATE_FEAT_ID": 34,
"CANDIDATE_FEAT": "1515 Adela Lane Las Vegas NV 89111",
"CANDIDATE_FEAT_USAGE_TYPE": "HOME",
"FULL_SCORE": 96,
"SCORE_BUCKET": "CLOSE",
"SCORE_BEHAVIOR": "FF"
}
],
"DOB":
[
{
"INBOUND_FEAT_ID": 75,
"INBOUND_FEAT": "11/12/1979",
"INBOUND_FEAT_USAGE_TYPE": "",
"CANDIDATE_FEAT_ID": 33,
"CANDIDATE_FEAT": "11/12/1978",
"CANDIDATE_FEAT_USAGE_TYPE": "",
"FULL_SCORE": 92,
"SCORE_BUCKET": "CLOSE",
"SCORE_BEHAVIOR": "FMES"
}
],
"NAME":
[
{
"INBOUND_FEAT_ID": 74,
"INBOUND_FEAT": "B Smith",
"INBOUND_FEAT_USAGE_TYPE": "PRIMARY",
"CANDIDATE_FEAT_ID": 32,
"CANDIDATE_FEAT": "Bob Smith",
"CANDIDATE_FEAT_USAGE_TYPE": "PRIMARY",
"GNR_FN": 92,
"GNR_SN": 100,
"GNR_GN": 85,
"GENERATION_MATCH": -1,
"GNR_ON": -1,
"SCORE_BUCKET": "CLOSE",
"SCORE_BEHAVIOR": "NAME"
}
],
"RECORD_TYPE":
[
{
"INBOUND_FEAT_ID": 30,
"INBOUND_FEAT": "PERSON",
"INBOUND_FEAT_USAGE_TYPE": "",
"CANDIDATE_FEAT_ID": 30,
"CANDIDATE_FEAT": "PERSON",
"CANDIDATE_FEAT_USAGE_TYPE": "",
"FULL_SCORE": 100,
"SCORE_BUCKET": "SAME",
"SCORE_BEHAVIOR": "FVME"
}
]
}
}
},
{
"STEP": 2,
"VIRTUAL_ENTITY_1":
{
"VIRTUAL_ENTITY_ID": "V1",
"MEMBER_RECORDS":
[
{
"INTERNAL_ID": 1,
"RECORDS":
[
{
"DATA_SOURCE": "CUSTOMERS",
"RECORD_ID": "1001"
}
]
}
]
},
"VIRTUAL_ENTITY_2":
{
"VIRTUAL_ENTITY_ID": "V2-S1",
"MEMBER_RECORDS":
[
{
"INTERNAL_ID": 2,
"RECORDS":
[
{
"DATA_SOURCE": "CUSTOMERS",
"RECORD_ID": "1002"
}
]
},
{
"INTERNAL_ID": 4,
"RECORDS":
[
{
"DATA_SOURCE": "CUSTOMERS",
"RECORD_ID": "1004"
}
]
}
]
},
"INBOUND_VIRTUAL_ENTITY_ID": "V2-S1",
"RESULT_VIRTUAL_ENTITY_ID": "V1-S2",
"MATCH_INFO":
{
"MATCH_KEY": "+NAME+DOB+PHONE+EMAIL",
"ERRULE_CODE": "SF1_SNAME_CFF_CSTAB",
"FEATURE_SCORES":
{
"ADDRESS":
[
{
"INBOUND_FEAT_ID": 76,
"INBOUND_FEAT": "1515 Adela Ln Las Vegas NV 89132",
"INBOUND_FEAT_USAGE_TYPE": "HOME",
"CANDIDATE_FEAT_ID": 3,
"CANDIDATE_FEAT": "123 Main Street, Las Vegas NV 89132",
"CANDIDATE_FEAT_USAGE_TYPE": "MAILING",
"FULL_SCORE": 33,
"SCORE_BUCKET": "NO_CHANCE",
"SCORE_BEHAVIOR": "FF"
},
{
"INBOUND_FEAT_ID": 34,
"INBOUND_FEAT": "1515 Adela Lane Las Vegas NV 89111",
"INBOUND_FEAT_USAGE_TYPE": "HOME",
"CANDIDATE_FEAT_ID": 3,
"CANDIDATE_FEAT": "123 Main Street, Las Vegas NV 89132",
"CANDIDATE_FEAT_USAGE_TYPE": "MAILING",
"FULL_SCORE": 42,
"SCORE_BUCKET": "NO_CHANCE",
"SCORE_BEHAVIOR": "FF"
}
],
"DOB":
[
{
"INBOUND_FEAT_ID": 75,
"INBOUND_FEAT": "11/12/1979",
"INBOUND_FEAT_USAGE_TYPE": "",
"CANDIDATE_FEAT_ID": 2,
"CANDIDATE_FEAT": "12/11/1978",
"CANDIDATE_FEAT_USAGE_TYPE": "",
"FULL_SCORE": 88,
"SCORE_BUCKET": "PLAUSIBLE",
"SCORE_BEHAVIOR": "FMES"
},
{
"INBOUND_FEAT_ID": 33,
"INBOUND_FEAT": "11/12/1978",
"INBOUND_FEAT_USAGE_TYPE": "",
"CANDIDATE_FEAT_ID": 2,
"CANDIDATE_FEAT": "12/11/1978",
"CANDIDATE_FEAT_USAGE_TYPE": "",
"FULL_SCORE": 95,
"SCORE_BUCKET": "CLOSE",
"SCORE_BEHAVIOR": "FMES"
}
],
"EMAIL":
[
{
"INBOUND_FEAT_ID": 5,
"INBOUND_FEAT": "bsmith@work.com",
"INBOUND_FEAT_USAGE_TYPE": "",
"CANDIDATE_FEAT_ID": 5,
"CANDIDATE_FEAT": "bsmith@work.com",
"CANDIDATE_FEAT_USAGE_TYPE": "",
"FULL_SCORE": 100,
"SCORE_BUCKET": "SAME",
"SCORE_BEHAVIOR": "F1"
}
],
"NAME":
[
{
"INBOUND_FEAT_ID": 32,
"INBOUND_FEAT": "Bob Smith",
"INBOUND_FEAT_USAGE_TYPE": "PRIMARY",
"CANDIDATE_FEAT_ID": 1,
"CANDIDATE_FEAT": "Robert Smith",
"CANDIDATE_FEAT_USAGE_TYPE": "PRIMARY",
"GNR_FN": 97,
"GNR_SN": 100,
"GNR_GN": 95,
"GENERATION_MATCH": -1,
"GNR_ON": -1,
"SCORE_BUCKET": "CLOSE",
"SCORE_BEHAVIOR": "NAME"
}
],
"PHONE":
[
{
"INBOUND_FEAT_ID": 4,
"INBOUND_FEAT": "702-919-1300",
"INBOUND_FEAT_USAGE_TYPE": "MOBILE",
"CANDIDATE_FEAT_ID": 4,
"CANDIDATE_FEAT": "702-919-1300",
"CANDIDATE_FEAT_USAGE_TYPE": "HOME",
"FULL_SCORE": 100,
"SCORE_BUCKET": "SAME",
"SCORE_BEHAVIOR": "FF"
}
],
"RECORD_TYPE":
[
{
"INBOUND_FEAT_ID": 30,
"INBOUND_FEAT": "PERSON",
"INBOUND_FEAT_USAGE_TYPE": "",
"CANDIDATE_FEAT_ID": 30,
"CANDIDATE_FEAT": "PERSON",
"CANDIDATE_FEAT_USAGE_TYPE": "",
"FULL_SCORE": 100,
"SCORE_BUCKET": "SAME",
"SCORE_BEHAVIOR": "FVME"
}
]
}
}
},
{
"STEP": 3,
"VIRTUAL_ENTITY_1":
{
"VIRTUAL_ENTITY_ID": "V1-S2",
"MEMBER_RECORDS":
[
{
"INTERNAL_ID": 1,
"RECORDS":
[
{
"DATA_SOURCE": "CUSTOMERS",
"RECORD_ID": "1001"
}
]
},
{
"INTERNAL_ID": 2,
"RECORDS":
[
{
"DATA_SOURCE": "CUSTOMERS",
"RECORD_ID": "1002"
}
]
},
{
"INTERNAL_ID": 4,
"RECORDS":
[
{
"DATA_SOURCE": "CUSTOMERS",
"RECORD_ID": "1004"
}
]
}
]
},
"VIRTUAL_ENTITY_2":
{
"VIRTUAL_ENTITY_ID": "V3",
"MEMBER_RECORDS":
[
{
"INTERNAL_ID": 3,
"RECORDS":
[
{
"DATA_SOURCE": "CUSTOMERS",
"RECORD_ID": "1003"
}
]
}
]
},
"INBOUND_VIRTUAL_ENTITY_ID": "V1-S2",
"RESULT_VIRTUAL_ENTITY_ID": "V1-S3",
"MATCH_INFO":
{
"MATCH_KEY": "+NAME+DOB+EMAIL",
"ERRULE_CODE": "SF1_PNAME_CSTAB",
"FEATURE_SCORES":
{
"DOB":
[
{
"INBOUND_FEAT_ID": 2,
"INBOUND_FEAT": "12/11/1978",
"INBOUND_FEAT_USAGE_TYPE": "",
"CANDIDATE_FEAT_ID": 2,
"CANDIDATE_FEAT": "12/11/1978",
"CANDIDATE_FEAT_USAGE_TYPE": "",
"FULL_SCORE": 100,
"SCORE_BUCKET": "SAME",
"SCORE_BEHAVIOR": "FMES"
}
],
"EMAIL":
[
{
"INBOUND_FEAT_ID": 5,
"INBOUND_FEAT": "bsmith@work.com",
"INBOUND_FEAT_USAGE_TYPE": "",
"CANDIDATE_FEAT_ID": 5,
"CANDIDATE_FEAT": "bsmith@work.com",
"CANDIDATE_FEAT_USAGE_TYPE": "",
"FULL_SCORE": 100,
"SCORE_BUCKET": "SAME",
"SCORE_BEHAVIOR": "F1"
}
],
"NAME":
[
{
"INBOUND_FEAT_ID": 32,
"INBOUND_FEAT": "Bob Smith",
"INBOUND_FEAT_USAGE_TYPE": "PRIMARY",
"CANDIDATE_FEAT_ID": 55,
"CANDIDATE_FEAT": "Bob J Smith",
"CANDIDATE_FEAT_USAGE_TYPE": "PRIMARY",
"GNR_FN": 93,
"GNR_SN": 100,
"GNR_GN": 93,
"GENERATION_MATCH": -1,
"GNR_ON": -1,
"SCORE_BUCKET": "CLOSE",
"SCORE_BEHAVIOR": "NAME"
},
{
"INBOUND_FEAT_ID": 1,
"INBOUND_FEAT": "Robert Smith",
"INBOUND_FEAT_USAGE_TYPE": "PRIMARY",
"CANDIDATE_FEAT_ID": 55,
"CANDIDATE_FEAT": "Bob J Smith",
"CANDIDATE_FEAT_USAGE_TYPE": "PRIMARY",
"GNR_FN": 90,
"GNR_SN": 100,
"GNR_GN": 88,
"GENERATION_MATCH": -1,
"GNR_ON": -1,
"SCORE_BUCKET": "CLOSE",
"SCORE_BEHAVIOR": "NAME"
}
],
"RECORD_TYPE":
[
{
"INBOUND_FEAT_ID": 30,
"INBOUND_FEAT": "PERSON",
"INBOUND_FEAT_USAGE_TYPE": "",
"CANDIDATE_FEAT_ID": 30,
"CANDIDATE_FEAT": "PERSON",
"CANDIDATE_FEAT_USAGE_TYPE": "",
"FULL_SCORE": 100,
"SCORE_BUCKET": "SAME",
"SCORE_BEHAVIOR": "FVME"
}
]
}
}
}
],
"FINAL_STATE":
{
"NEED_REEVALUATION": 0,
"VIRTUAL_ENTITIES":
[
{
"VIRTUAL_ENTITY_ID": "V1-S3",
"MEMBER_RECORDS":
[
{
"INTERNAL_ID": 1,
"RECORDS":
[
{
"DATA_SOURCE": "CUSTOMERS",
"RECORD_ID": "1001"
}
]
},
{
"INTERNAL_ID": 2,
"RECORDS":
[
{
"DATA_SOURCE": "CUSTOMERS",
"RECORD_ID": "1002"
}
]
},
{
"INTERNAL_ID": 3,
"RECORDS":
[
{
"DATA_SOURCE": "CUSTOMERS",
"RECORD_ID": "1003"
}
]
},
{
"INTERNAL_ID": 4,
"RECORDS":
[
{
"DATA_SOURCE": "CUSTOMERS",
"RECORD_ID": "1004"
}
]
}
]
}
]
}
}
}