G2Engine Getting Entities and Records

Getting Entities and Records

getRecord

Use getRecord() to retrieve a single record from the data repository; the record is assigned in JSON form to a user-designated buffer. Once the Senzing engine is initialized, getRecord() can be called as many times as desired and from multiple threads at the same time.

g2_engine.getRecord(datasource_code, record_id, response_bytearray, g2_engine_flags)
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.
  • g2_engine_flags: (int [optional]) One or more flags used to determine response document content. Applicable flags are listed here getRecord flags)
Click to expand `getRecord()` example

getEntityByRecordID

Use getEntityByRecordID() to retrieve entity data based on the ID of a resolved identity.

g2_engine.getEntityByRecordID(datasource_code, record_id, response_bytearray, g2_engine_flags)
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.
  • g2_engine_flags: (int [optional]) One or more flags used to determine response document content. Applicable flags are listed here getEntity* flags)
Click to expand `getEntityByRecordID()` example

getEntityByEntityID

Use getEntityByEntityID() to retrieve entity data based on the ID of a resolved identity.

g2_engine.getEntityByEntityID(entity_id, response_bytearray, g2_engine_flags)
Parameters
  • entity_id: (str) The ENTITY_ID for the record.
  • 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 getEntity* flags)
Click to expand `getEntityByEntityID()` example

getVirtualEntityByRecordID

Use getVirtualEntityByRecordID() to create a view of a virtual entity using a list of existing loaded records. The virtual entity is composed of only those records and their features. Entity resolution is not performed.

g2_engine.getVirtualEntityByRecordID(record_list, response_bytearray, g2_engine_flags)
Parameters
  • record_list: (str) A list of one or more records by DATA_SOURCE and RECORD_ID pairs, formatted as: {"RECORDS":[{"DATA_SOURCE":"DS1","RECORD_ID":"R1"},{"DATA_SOURCE":"DS2","RECORD_ID":"R2"}]}
  • 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 getEntity* flags)
Click to expand `getVirtualEntityByRecordID()` example