Reevaluating
reevaluateRecord
reevaluateRecord() reevaluates a specific record.
g2_engine.reevaluateRecord(datasource_code, record_id)
Parameters
- datasource_code: (str) The configured data source for the record.
- record_id: (str) The RECORD_ID for the record.
Click to expand `reevaluateRecord()` example
Example
#! /usr/bin/env python3
from senzing import G2Engine, G2Exception
# 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()
datasource_code = 'CUSTOMERS'
record_id = '1001'
try:
g2_engine.init("G2Engine", senzing_engine_configuration_json)
g2_engine.reevaluateRecord(
datasource_code,
record_id)
g2_engine.destroy()
except G2Exception as err:
print(g2_engine.getLastException())
reevaluateRecordWithInfo
reevaluateRecordWithInfo() reevaluates a specific record, and returns a JSON document containing the ENTITY_ID values of the affected entities.
g2_engine.reevaluateRecordWithInfo(datasource_code, record_id, response_bytearray)
Parameters
- datasource_code: (str) The configured data source for the record.
- record_id: (str) The RECORD_ID for the record.
- response_bytearray: (bytearray) Object to store the output of the method.
Click to expand `reevaluateRecordWithInfo()` example
Example
#! /usr/bin/env python3
from senzing import G2Engine, G2Exception
# 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()
datasource_code = 'CUSTOMERS'
record_id = '1001'
response_bytearray = bytearray()
try:
g2_engine.init("G2Engine", senzing_engine_configuration_json)
g2_engine.reevaluateRecordWithInfo(
datasource_code,
record_id,
response_bytearray)
g2_engine.destroy()
print(response_bytearray.decode())
except G2Exception as err:
print(g2_engine.getLastException())
Output
{
"DATA_SOURCE": "CUSTOMERS",
"RECORD_ID": "1001",
"AFFECTED_ENTITIES":
[
{
"ENTITY_ID": 1
}
],
"INTERESTING_ENTITIES":
{
"ENTITIES":
[]
}
}
reevaluateEntity
reevaluateEntity() reevaluates the record of the lowest observed entity ID value of the specified resolved entity.
g2_engine.reevaluateEntity(entity_id)
Parameters
- entity_id: (int) The ENTITY_ID for the entity to be reevaluated.
Click to expand `reevaluateEntity()` example
Example
#! /usr/bin/env python3
from senzing import G2Engine, G2Exception
# 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
try:
g2_engine.init("G2Engine", senzing_engine_configuration_json)
g2_engine.reevaluateEntity(entity_id)
g2_engine.destroy()
except G2Exception as err:
print(g2_engine.getLastException())
reevaluateEntityWithInfo
reevaluateEntityWithInfo() reevaluates the record of the lowest observed entity ID value of a specified ENTITY_ID, and returns a JSON document containing the ENTITY_ID values of the affected entities.
g2_engine.reevaluateEntityWithInfo(entity_id, response_bytearray)
Parameters
- entity_id: (int) The ENTITY_ID for the entity to be reevaluated
- response_bytearray: (bytearray) Object to store the output of the method.
Click to expand `reevaluateEntityWithInfo()` example
Example
#! /usr/bin/env python3
from senzing import G2Engine, G2Exception
# 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.init("G2Engine", senzing_engine_configuration_json)
g2_engine.reevaluateEntityWithInfo(entity_id, response_bytearray)
g2_engine.destroy()
print(response_bytearray.decode())
except G2Exception as err:
print(g2_engine.getLastException())
Output
{
"DATA_SOURCE": "CUSTOMERS",
"RECORD_ID": "1001",
"AFFECTED_ENTITIES":
[
{
"ENTITY_ID": 1
}
],
"INTERESTING_ENTITIES":
{
"ENTITIES":
[]
}
}