senzing_core

The senzing_core Python package has 4 major modules / classes. Senzing objects are created using an Abstract Factory Pattern.

Senzing classes

Module

Class

Creation

szconfigmanager

SzConfigManagerCore

sz_configmanager = sz_abstract_factory.create_configmanager()

szdiagnostic

SzDiagnosticCore

sz_diagnostic = sz_abstract_factory.create_diagnostic()

szengine

SzEngineCore

sz_engine = sz_abstract_factory.create_engine()

szproduct

SzProductCore

sz_product = sz_abstract_factory.create_product()

For the full implementation of the documentation examples, visit the source code on GitHub.

szabstractfactory

senzing_core.szabstractfactory.SzAbstractFactoryCore is an implementation of the senzing.szabstractfactory.SzAbstractFactory interface that communicates with the Senzing binaries.

class senzing_core.szabstractfactory.SzAbstractFactoryCore(instance_name: str = '', settings: str | Dict[Any, Any] = '', config_id: int = 0, verbose_logging: int = 0)[source]

Bases: SzAbstractFactory

SzAbstractFactoryCore is a factory pattern for accessing Senzing.

create_configmanager() SzConfigManager[source]

The create_configmanager method creates a new implementation of an SzConfigManager object.

Args:

Returns:

A new implementation.

Return type:

SzConfigManager

Raises:

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_configmanager = sz_abstract_factory.create_configmanager()
18except SzError as err:
19    print(f"\nERROR: {err}\n")

Output:

1// No output from this example.
create_diagnostic() SzDiagnostic[source]

The create_diagnostic method creates a new implementation of an SzDiagnostic object.

Args:

Returns:

A new implementation.

Return type:

SzDiagnostic

Raises:

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_diagnostic = sz_abstract_factory.create_diagnostic()
18except SzError as err:
19    print(f"\nERROR: {err}\n")

Output:

1// No output from this example.
create_engine() SzEngine[source]

The create_engine method creates a new implementation of an SzEngine object.

Args:

Returns:

A new implementation.

Return type:

SzEngine

Raises:

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_engine = sz_abstract_factory.create_engine()
18except SzError as err:
19    print(f"\nERROR: {err}\n")

Output:

1// No output from this example.
create_product() SzProduct[source]

The create_product method creates a new implementation of an SzProduct object.

Args:

Returns:

A new implementation.

Return type:

SzProduct

Raises:

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_product = sz_abstract_factory.create_product()
18except SzError as err:
19    print(f"\nERROR: {err}\n")

Output:

1// No output from this example.
reinitialize(config_id: int) None[source]

The reinitialize method reinitializes the Senzing objects using a specific configuration identifier. A list of available configuration identifiers can be retrieved using szconfigmanager.get_configs.

Parameters:

config_id (int) – The configuration ID used for the initialization

Raises:
  • TypeError – Incorrect datatype of input parameter.

  • szexception.SzError – config_id does not exist.

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    # Using get_active_config_id for demonstrations purposes.
17    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
18    sz_engine = sz_abstract_factory.create_engine()
19    config_id = sz_engine.get_active_config_id()
20    sz_abstract_factory.reinitialize(config_id)
21except SzError as err:
22    print(f"\nERROR: {err}\n")
class senzing_core.szabstractfactory.SzAbstractFactoryParametersCore[source]

Bases: TypedDict

SzAbstractFactoryParametersCore is used to create a dictionary that can be unpacked when creating an SzAbstractFactory.

config_id: int
instance_name: str
settings: str | Dict[Any, Any]
verbose_logging: int

szconfig

senzing_core.szconfig.SzConfigCore is an implementation of the senzing.szconfig.SzConfig interface that communicates with the Senzing binaries.

To use szconfig, the LD_LIBRARY_PATH environment variable must include a path to Senzing’s libraries.

Example:

export LD_LIBRARY_PATH=/opt/senzing/er/lib
class senzing_core.szconfig.SzConfigCore(**kwargs: Any)[source]

Bases: SzConfig

Use SzAbstractFactoryCore.create_config() to create an SzConfig object. The SzConfig object uses the parameters provided to SzAbstractFactoryCore().

Example:

from senzing_core import SzAbstractFactoryCore

sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
sz_config = sz_abstract_factory.create_config()

Parameters:

Raises:

add_data_source(data_source_code: str) str[source]

The add_data_source method adds a data source to an existing in-memory configuration.

Parameters:

data_source_code (str) – Name of data source code to add.

Returns:

A string containing a JSON document listing the newly created data source.

Return type:

str

Raises:

TypeError – Incorrect datatype of input parameter.

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5data_source_code = "NAME_OF_DATASOURCE"
 6instance_name = "Example"
 7settings = {
 8    "PIPELINE": {
 9        "CONFIGPATH": "/etc/opt/senzing",
10        "RESOURCEPATH": "/opt/senzing/er/resources",
11        "SUPPORTPATH": "/opt/senzing/data",
12    },
13    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
14}
15
16try:
17    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
18    sz_configmanager = sz_abstract_factory.create_configmanager()
19    sz_config = sz_configmanager.create_config_from_template()
20    result = sz_config.add_data_source(data_source_code)
21    print(f"\n{result}\n")
22except SzError as err:
23    print(f"\nERROR: {err}\n")

Output:

1// Output has been formatted for easier reading.
2
3{
4    "DSRC_ID": 1001
5}
delete_data_source(data_source_code: str) str[source]

The delete_data_source method removes a data source from an existing in-memory configuration.

Parameters:

data_source_code (str) – Name of data source code to delete.

Raises:

TypeError – Incorrect datatype of input parameter.

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5data_source_code = "TEST"
 6instance_name = "Example"
 7settings = {
 8    "PIPELINE": {
 9        "CONFIGPATH": "/etc/opt/senzing",
10        "RESOURCEPATH": "/opt/senzing/er/resources",
11        "SUPPORTPATH": "/opt/senzing/data",
12    },
13    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
14}
15
16try:
17    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
18    sz_configmanager = sz_abstract_factory.create_configmanager()
19    sz_config = sz_configmanager.create_config_from_template()
20    result = sz_config.delete_data_source(data_source_code)
21    print(f"\n{result}\n")
22except SzError as err:
23    print(f"\nERROR: {err}\n")

Output:

1// No output from this example.
export() str[source]

The export method creates a JSON string representation of the Senzing SzConfig object.

Args:

Returns:

A string containing a JSON Document representation of the Senzing SzConfig object.

Return type:

str

Raises:

TypeError – Incorrect datatype of input parameter.

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_configmanager = sz_abstract_factory.create_configmanager()
18    sz_config = sz_configmanager.create_config_from_template()
19    config_definition = sz_config.export()
20    print(f"\n{config_definition}\n")
21except SzError as err:
22    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted and pruned for easier reading.
 2// To view a complete configuration, visit /opt/senzing/er/resources/templates/g2config.json
 3
 4{
 5    "G2_CONFIG": {
 6        "CFG_ATTR": [],
 7        "CFG_CFBOM": [],
 8        "CFG_CFCALL": [],
 9        "CFG_CFRTN": [],
10        "CFG_CFUNC": [],
11        "CFG_DFBOM": [],
12        "CFG_DFCALL": [],
13        "CFG_DFUNC": [],
14        "CFG_DSRC": [],
15        "CFG_DSRC_INTEREST": [],
16        "CFG_ECLASS": [],
17        "CFG_EFBOM": [],
18        "CFG_EFCALL": [],
19        "CFG_EFUNC": [],
20        "CFG_ERFRAG": [],
21        "CFG_ERRULE": [],
22        "CFG_ETYPE": [],
23        "CFG_FBOM": [],
24        "CFG_FBOVR": [],
25        "CFG_FCLASS": [],
26        "CFG_FELEM": [],
27        "CFG_FTYPE": [],
28        "CFG_GENERIC_THRESHOLD": [],
29        "CFG_GPLAN": [],
30        "CFG_LENS": [],
31        "CFG_LENSRL": [],
32        "CFG_RCLASS": [],
33        "CFG_RTYPE": [],
34        "CFG_SFCALL": [],
35        "CFG_SFUNC": [],
36        "SYS_OOM": [],
37        "CONFIG_BASE_VERSION": {
38            "VERSION": "4.0.0",
39            "BUILD_VERSION": "4.0.0.00000",
40            "BUILD_DATE": "2025-01-01",
41            "BUILD_NUMBER": "00000",
42            "COMPATIBILITY_VERSION": {
43                "CONFIG_VERSION": "11"
44            }
45        }
46    }
47}
get_data_sources() str[source]

The get_data_sources method returns a JSON document of data sources contained in an in-memory configuration.

Args:

Returns:

A string containing a JSON document listing all of the data sources.

Return type:

str

Raises:

TypeError – Incorrect datatype of input parameter.

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_configmanager = sz_abstract_factory.create_configmanager()
18    sz_config = sz_configmanager.create_config_from_template()
19    result = sz_config.get_data_sources()
20    print(f"\n{result}\n")
21except SzError as err:
22    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4    "DATA_SOURCES": [
 5        {
 6            "DSRC_ID": 1,
 7            "DSRC_CODE": "TEST"
 8        },
 9        {
10            "DSRC_ID": 2,
11            "DSRC_CODE": "SEARCH"
12        }
13    ]
14}
help(method_name: str = '') str

Return the help for a particular message.

Parameters:

method_name (str) – The name of the method. (e.g. “init”). If empty, a list of methods and descriptions is returned.

Returns:

The Help information about the requested method

Return type:

str

import_config_definition(config_definition: str) None[source]

Set the internal JSON document.

Parameters:

config_definition (str) – A Senzing configuration JSON document.

import_template() None[source]

Retrieves a Senzing configuration from the default template. The default template is the Senzing configuration JSON document file, g2config.json, located in the PIPELINE.RESOURCEPATH path.

initialize(instance_name: str, settings: str | Dict[Any, Any], verbose_logging: int = 0) None[source]

Initialize the C-based Senzing SzConfig.

Parameters:
  • instance_name (str) – A name to distinguish this instance of the SzConfig.

  • settings (Union[str, Dict[Any, Any]]) – A JSON document defining runtime configuration.

  • verbose_logging (int, optional) – Send debug statements to STDOUT. Defaults to 0.

verify_config_definition(config_definition: str) None[source]

Verify that a Senzing configuration JSON document is valid. This method does not update the internal Senzing configuration. If an error is not thrown, the Senzing configuration JSON is valid.

szconfigmanager

senzing_core.szconfigmanager.SzConfigManagerCore is an implementation of the senzing.szconfigmanager.SzConfigManager interface that communicates with the Senzing binaries.

To use szconfigmanager, the LD_LIBRARY_PATH environment variable must include a path to Senzing’s libraries.

Example:

export LD_LIBRARY_PATH=/opt/senzing/er/lib
class senzing_core.szconfigmanager.SzConfigManagerCore(**kwargs: Any)[source]

Bases: SzConfigManager

Use SzAbstractFactoryCore.create_configmanager() to create an SzConfigManager object. The SzConfigManager object uses the parameters provided to SzAbstractFactoryCore().

Example:

from senzing_core import SzAbstractFactoryCore

sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
sz_config_manager = sz_abstract_factory.create_configmanager()

Parameters:

Raises:

create_config_from_config_id(config_id: int) SzConfig[source]

The create_config_from_config_id method creates an in-memory Senzing configuration from a specific Senzing configuration stored in the Senzing database.

Parameters:

config_id (int) – The configuration identifier of the desired Senzing configuration to retrieve.

Returns:

Represents an in-memory Senzing configuration that can be modified.

Return type:

SzConfig

Raises:

TypeError – Incorrect datatype of input parameter.

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_configmanager = sz_abstract_factory.create_configmanager()
18    config_id = sz_configmanager.get_default_config_id()
19    sz_config = sz_configmanager.create_config_from_config_id(config_id)
20except SzError as err:
21    print(f"\nERROR: {err}\n")

Output:

  1// Output has been formatted and pruned for easier reading.
  2
  3{
  4    "G2_CONFIG": {
  5        "CFG_ATTR": [
  6            {
  7                "ATTR_ID": 1001,
  8                "ATTR_CODE": "DATA_SOURCE",
  9                "ATTR_CLASS": "OBSERVATION",
 10                "FTYPE_CODE": null,
 11                "FELEM_CODE": null,
 12                "FELEM_REQ": "Yes",
 13                "DEFAULT_VALUE": null,
 14                "INTERNAL": "No"
 15            }
 16        ],
 17        "CFG_CFBOM": [
 18            {
 19                "CFCALL_ID": 1,
 20                "FTYPE_ID": 1,
 21                "FELEM_ID": 2,
 22                "EXEC_ORDER": 1
 23            }
 24        ],
 25        "CFG_CFCALL": [
 26            {
 27                "CFCALL_ID": 1,
 28                "FTYPE_ID": 1,
 29                "CFUNC_ID": 2
 30            }
 31        ],
 32        "CFG_CFRTN": [
 33            {
 34                "CFRTN_ID": 1,
 35                "CFUNC_ID": 1,
 36                "FTYPE_ID": 0,
 37                "CFUNC_RTNVAL": "FULL_SCORE",
 38                "EXEC_ORDER": 1,
 39                "SAME_SCORE": 100,
 40                "CLOSE_SCORE": 90,
 41                "LIKELY_SCORE": 80,
 42                "PLAUSIBLE_SCORE": 70,
 43                "UN_LIKELY_SCORE": 60
 44            }
 45        ],
 46        "CFG_CFUNC": [
 47            {
 48                "CFUNC_ID": 1,
 49                "CFUNC_CODE": "STR_COMP",
 50                "CFUNC_DESC": "String comparison",
 51                "CONNECT_STR": "g2StringComp",
 52                "ANON_SUPPORT": "Yes",
 53                "LANGUAGE": null
 54            }
 55        ],
 56        "CFG_DFBOM": [
 57            {
 58                "DFCALL_ID": 1,
 59                "FTYPE_ID": 1,
 60                "FELEM_ID": 2,
 61                "EXEC_ORDER": 1
 62            }
 63        ],
 64        "CFG_DFCALL": [
 65            {
 66                "DFCALL_ID": 1,
 67                "FTYPE_ID": 1,
 68                "DFUNC_ID": 5
 69            }
 70        ],
 71        "CFG_DFUNC": [
 72            {
 73                "DFUNC_ID": 1,
 74                "DFUNC_CODE": "FELEM_STRICT_SUBSET",
 75                "DFUNC_DESC": "Strict subset of felems",
 76                "CONNECT_STR": "g2StrictSubsetFelems",
 77                "ANON_SUPPORT": "Yes",
 78                "LANGUAGE": null
 79            }
 80        ],
 81        "CFG_DSRC": [
 82            {
 83                "DSRC_ID": 1,
 84                "DSRC_CODE": "TEST",
 85                "DSRC_DESC": "Test",
 86                "RETENTION_LEVEL": "Remember"
 87            }
 88        ],
 89        "CFG_DSRC_INTEREST": [],
 90        "CFG_EFBOM": [
 91            {
 92                "EFCALL_ID": 1,
 93                "FTYPE_ID": 6,
 94                "FELEM_ID": 60,
 95                "EXEC_ORDER": 1,
 96                "FELEM_REQ": "Yes"
 97            }
 98        ],
 99        "CFG_EFCALL": [
100            {
101                "EFCALL_ID": 1,
102                "FTYPE_ID": 6,
103                "FELEM_ID": -1,
104                "EFUNC_ID": 4,
105                "EXEC_ORDER": 1,
106                "EFEAT_FTYPE_ID": -1,
107                "IS_VIRTUAL": "No"
108            }
109        ],
110        "CFG_EFUNC": [
111            {
112                "EFUNC_ID": 1,
113                "EFUNC_CODE": "EXPRESS_BOM",
114                "EFUNC_DESC": "General BOM Hasher",
115                "CONNECT_STR": "g2GenericHasher",
116                "LANGUAGE": null
117            }
118        ],
119        "CFG_ERFRAG": [
120            {
121                "ERFRAG_ID": 11,
122                "ERFRAG_CODE": "SAME_NAME",
123                "ERFRAG_DESC": "SAME_NAME",
124                "ERFRAG_SOURCE": "./FRAGMENT[./GNR_SAME_NAME>0]",
125                "ERFRAG_DEPENDS": "301"
126            }
127        ],
128        "CFG_ERRULE": [
129            {
130                "ERRULE_ID": 100,
131                "ERRULE_CODE": "SAME_A1",
132                "RESOLVE": "Yes",
133                "RELATE": "No",
134                "RTYPE_ID": 1,
135                "QUAL_ERFRAG_CODE": "SAME_A1",
136                "DISQ_ERFRAG_CODE": null,
137                "ERRULE_TIER": 10
138            }
139        ],
140        "CFG_FBOM": [
141            {
142                "FTYPE_ID": 1,
143                "FELEM_ID": 2,
144                "EXEC_ORDER": 1,
145                "DISPLAY_LEVEL": 1,
146                "DISPLAY_DELIM": null,
147                "DERIVED": "No"
148            }
149        ],
150        "CFG_FBOVR": [
151            {
152                "FTYPE_ID": 5,
153                "UTYPE_CODE": "BUSINESS",
154                "FTYPE_FREQ": "FF",
155                "FTYPE_EXCL": "Yes",
156                "FTYPE_STAB": "No"
157            }
158        ],
159        "CFG_FCLASS": [
160            {
161                "FCLASS_ID": 1,
162                "FCLASS_CODE": "NAME"
163            }
164        ],
165        "CFG_FELEM": [
166            {
167                "FELEM_ID": 2,
168                "FELEM_CODE": "FULL_NAME",
169                "FELEM_DESC": "Full name",
170                "DATA_TYPE": "string"
171            }
172        ],
173        "CFG_FTYPE": [
174            {
175                "FTYPE_ID": 1,
176                "FTYPE_CODE": "NAME",
177                "FTYPE_DESC": "Name",
178                "FCLASS_ID": 1,
179                "FTYPE_FREQ": "NAME",
180                "FTYPE_EXCL": "No",
181                "FTYPE_STAB": "No",
182                "PERSIST_HISTORY": "Yes",
183                "USED_FOR_CAND": "No",
184                "DERIVED": "No",
185                "RTYPE_ID": 0,
186                "ANONYMIZE": "No",
187                "VERSION": 2,
188                "SHOW_IN_MATCH_KEY": "Yes"
189            }
190        ],
191        "CFG_GENERIC_THRESHOLD": [
192            {
193                "GPLAN_ID": 1,
194                "BEHAVIOR": "NAME",
195                "FTYPE_ID": 0,
196                "CANDIDATE_CAP": 10,
197                "SCORING_CAP": -1,
198                "SEND_TO_REDO": "Yes"
199            }
200        ],
201        "CFG_GPLAN": [
202            {
203                "GPLAN_ID": 1,
204                "GPLAN_CODE": "INGEST",
205                "GPLAN_DESC": "Standard Ingestion"
206            }
207        ],
208        "CFG_RCLASS": [
209            {
210                "RCLASS_ID": 1,
211                "RCLASS_CODE": "DERIVED",
212                "RCLASS_DESC": "Derived",
213                "IS_DISCLOSED": "No"
214            }
215        ],
216        "CFG_RTYPE": [
217            {
218                "RTYPE_ID": 1,
219                "RTYPE_CODE": "RESOLVED",
220                "RTYPE_DESC": "Resolved",
221                "RCLASS_ID": 1,
222                "BREAK_RES": "No"
223            }
224        ],
225        "CFG_SFCALL": [
226            {
227                "SFCALL_ID": 1,
228                "FTYPE_ID": 1,
229                "FELEM_ID": -1,
230                "SFUNC_ID": 1,
231                "EXEC_ORDER": 1
232            }
233        ],
234        "CFG_SFUNC": [
235            {
236                "SFUNC_ID": 1,
237                "SFUNC_CODE": "PARSE_NAME",
238                "SFUNC_DESC": "Parse name",
239                "CONNECT_STR": "g2ParseName",
240                "LANGUAGE": null
241            }
242        ],
243        "SYS_OOM": [
244            {
245                "OOM_TYPE": "RF",
246                "OOM_LEVEL": "SYSDEFAULT",
247                "FTYPE_ID": 0,
248                "THRESH1_CNT": 100,
249                "THRESH1_OOM": 10,
250                "NEXT_THRESH": 1000
251            }
252        ],
253        "SETTINGS": {
254            "METAPHONE_VERSION": 3
255        },
256        "CONFIG_BASE_VERSION": {
257            "VERSION": "4.0.0",
258            "BUILD_VERSION": "4.0.0.00000",
259            "BUILD_DATE": "2025-01-01",
260            "BUILD_NUMBER": "00000",
261            "COMPATIBILITY_VERSION": {
262                "CONFIG_VERSION": "11"
263            }
264        }
265    }
266}
create_config_from_string(config_definition: str) SzConfig[source]

The create_config_from_string method creates an in-memory Senzing configuration from the given Senzing configuration JSON document.

Parameters:

config_definition (str) – The Senzing configuration JSON document.

Returns:

Represents an in-memory Senzing configuration that can be modified.

Return type:

SzConfig

Raises:

TypeError – Incorrect datatype of input parameter.

Example:
 1import json
 2
 3from senzing import SzError
 4
 5from senzing_core import SzAbstractFactoryCore
 6
 7config_definition = json.dumps({"G2_CONFIG": {}})
 8instance_name = "Example"
 9settings = {
10    "PIPELINE": {
11        "CONFIGPATH": "/etc/opt/senzing",
12        "RESOURCEPATH": "/opt/senzing/er/resources",
13        "SUPPORTPATH": "/opt/senzing/data",
14    },
15    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
16}
17
18try:
19    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
20    sz_configmanager = sz_abstract_factory.create_configmanager()
21    sz_config = sz_configmanager.create_config_from_string(config_definition)
22except SzError as err:
23    print(f"\nERROR: {err}\n")

Output:

1
create_config_from_template() SzConfig[source]

The create_config_from_template method creates an in-memory Senzing configuration from the template Senzing configuration JSON document located at PIPELINE.RESOURCEPATH/templates/g2config.json

Parameters:

config_definition (str) – The Senzing configuration JSON document.

Returns:

Represents an in-memory Senzing configuration that can be modified.

Return type:

SzConfig

Raises:

TypeError – Incorrect datatype of input parameter.

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_configmanager = sz_abstract_factory.create_configmanager()
18    sz_config = sz_configmanager.create_config_from_template()
19except SzError as err:
20    print(f"\nERROR: {err}\n")

Output:

1
get_configs() str[source]

The get_configs method retrieves a list of Senzing configurations from the Senzing database.

Returns:

A JSON document containing Senzing configurations.

Return type:

str

Raises:

TypeError – Incorrect datatype of input parameter.

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_configmanager = sz_abstract_factory.create_configmanager()
18    config_list = sz_configmanager.get_configs()
19    print(f"\n{config_list}\n")
20except SzError as err:
21    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4    "CONFIGS": [
 5        {
 6            "CONFIG_ID": 41320074,
 7            "CONFIG_COMMENTS": "Default Senzing configuration",
 8            "SYS_CREATE_DT": "YYYY-MM-DD HH:MM:SS.mmm"
 9        },
10        {
11            "CONFIG_ID": 490826130,
12            "CONFIG_COMMENTS": "Test",
13            "SYS_CREATE_DT": "YYYY-MM-DD HH:MM:SS.mmm"
14        }
15    ]
16}
get_default_config_id() int[source]

The get_default_config_id method retrieves from the Senzing database the configuration identifier of the default Senzing configuration.

Returns:

A configuration identifier which identifies the current configuration in use.

Return type:

int

Raises:

TypeError – Incorrect datatype of input parameter.

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_configmanager = sz_abstract_factory.create_configmanager()
18    config_id = sz_configmanager.get_default_config_id()
19    print(f"\n{config_id}\n")
20except SzError as err:
21    print(f"\nERROR: {err}\n")

Output:

1692503001
help(method_name: str = '') str

Return the help for a particular message.

Parameters:

method_name (str) – The name of the method. (e.g. “init”). If empty, a list of methods and descriptions is returned.

Returns:

The Help information about the requested method

Return type:

str

initialize(instance_name: str, settings: str | Dict[Any, Any], verbose_logging: int = 0) None[source]

Initialize the C-based Senzing SzConfigManager.

Parameters:
  • instance_name (str) – A name to distinguish this instance of the SzConfigManager.

  • settings (Union[str, Dict[Any, Any]]) – A JSON document defining runtime configuration.

  • verbose_logging (int, optional) – Send debug statements to STDOUT. Defaults to 0.

register_config(config_definition: str, config_comment: str) int[source]

The register_config method adds a Senzing configuration JSON document to the Senzing database.

Parameters:
  • config_definition (str) – The Senzing configuration JSON document.

  • config_comment (str) – free-form string of comments describing the configuration document.

Returns:

A configuration identifier.

Return type:

int

Raises:

TypeError – Incorrect datatype of input parameter.

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5config_comment = "Just an empty example"
 6instance_name = "Example"
 7settings = {
 8    "PIPELINE": {
 9        "CONFIGPATH": "/etc/opt/senzing",
10        "RESOURCEPATH": "/opt/senzing/er/resources",
11        "SUPPORTPATH": "/opt/senzing/data",
12    },
13    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
14}
15
16
17try:
18    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
19    sz_configmanager = sz_abstract_factory.create_configmanager()
20    sz_config = sz_configmanager.create_config_from_template()
21    config_definition = sz_config.export()
22    config_id = sz_configmanager.register_config(config_definition, config_comment)
23except SzError as err:
24    print(f"\nERROR: {err}\n")

Output:

1// No output from this example.
replace_default_config_id(current_default_config_id: int, new_default_config_id: int) None[source]

The replace_default_config_id method replaces the old configuration identifier with a new configuration identifier in the Senzing database. It is like a “compare-and-swap” instruction to serialize concurrent editing of configuration. If current_default_config_id is no longer the “current configuration identifier”, the operation will fail. To simply set the default configuration ID, use set_default_config_id.

Parameters:
  • current_default_config_id (int) – The configuration identifier to replace.

  • new_default_config_id (int) – The configuration identifier to use as the default.

Raises:

TypeError – Incorrect datatype of input parameter.

Example:
 1import time
 2
 3from senzing import SzError
 4
 5from senzing_core import SzAbstractFactoryCore
 6
 7config_comment = "Just an example"
 8data_source_code = f"REPLACE_DEFAULT_CONFIG_ID_{time.time()}"
 9instance_name = "Example"
10settings = {
11    "PIPELINE": {
12        "CONFIGPATH": "/etc/opt/senzing",
13        "RESOURCEPATH": "/opt/senzing/er/resources",
14        "SUPPORTPATH": "/opt/senzing/data",
15    },
16    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
17}
18
19try:
20    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
21    sz_configmanager = sz_abstract_factory.create_configmanager()
22    sz_config = sz_configmanager.create_config_from_template()
23    current_default_config_id = sz_configmanager.get_default_config_id()
24
25    # Create a new config.
26
27    sz_config = sz_configmanager.create_config_from_config_id(current_default_config_id)
28    sz_config.add_data_source(data_source_code)
29
30    # Persist the new config.
31
32    config_definition = sz_config.export()
33    new_default_config_id = sz_configmanager.register_config(config_definition, config_comment)
34
35    # Replace default config id.
36
37    sz_configmanager.replace_default_config_id(current_default_config_id, new_default_config_id)
38except SzError as err:
39    print(f"\nERROR: {err}\n")
set_default_config(config_definition: str, config_comment: str) int[source]

The set_default_config method replaces the current default Senzing configuration in the Senzing database. To serialize modifying of the configuration identifier, see replace_default_config_id.

Parameters:
  • config_definition (str) – The Senzing configuration JSON document.

  • config_comment (str) – free-form string of comments describing the configuration document.

Raises:

TypeError – Incorrect datatype of input parameter.

Example:
 1import time
 2
 3from senzing import SzError
 4
 5from senzing_core import SzAbstractFactoryCore
 6
 7config_comment = "Just an example"
 8data_source_code = f"REPLACE_DEFAULT_CONFIG_ID_{time.time()}"
 9instance_name = "Example"
10settings = {
11    "PIPELINE": {
12        "CONFIGPATH": "/etc/opt/senzing",
13        "RESOURCEPATH": "/opt/senzing/er/resources",
14        "SUPPORTPATH": "/opt/senzing/data",
15    },
16    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
17}
18
19try:
20    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
21    sz_configmanager = sz_abstract_factory.create_configmanager()
22
23    # Create a new config.
24
25    sz_config = sz_configmanager.create_config_from_template()
26    sz_config.add_data_source(data_source_code)
27
28    # Persist the new default config.
29
30    config_definition = sz_config.export()
31    config_id = sz_configmanager.set_default_config(config_definition, config_comment)
32except SzError as err:
33    print(f"\nERROR: {err}\n")

Output:

1
set_default_config_id(config_id: int) None[source]

The set_default_config_id method replaces and sets a new configuration identifier in the Senzing database. To serialize modifying of the configuration identifier, see replace_default_config_id.

Parameters:

config_id (int) – The configuration identifier of the Senzing Engine configuration to use as the default.

Raises:

TypeError – Incorrect datatype of input parameter.

Example:
 1import time
 2
 3from senzing import SzError
 4
 5from senzing_core import SzAbstractFactoryCore
 6
 7config_comment = "Just an example"
 8data_source_code = f"REPLACE_DEFAULT_CONFIG_ID_{time.time()}"
 9instance_name = "Example"
10settings = {
11    "PIPELINE": {
12        "CONFIGPATH": "/etc/opt/senzing",
13        "RESOURCEPATH": "/opt/senzing/er/resources",
14        "SUPPORTPATH": "/opt/senzing/data",
15    },
16    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
17}
18
19try:
20    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
21    sz_configmanager = sz_abstract_factory.create_configmanager()
22
23    # Create a new config.
24
25    sz_config = sz_configmanager.create_config_from_template()
26    sz_config.add_data_source(data_source_code)
27
28    # Persist the new config.
29
30    config_definition = sz_config.export()
31    new_default_config_id = sz_configmanager.register_config(config_definition, config_comment)
32
33    # Set default config id.
34
35    sz_configmanager.set_default_config_id(new_default_config_id)
36except SzError as err:
37    print(f"\nERROR: {err}\n")

szdiagnostic

senzing_core.szdiagnostic.SzDiagnosticCore is an implementation of the senzing.szdiagnostic.SzDiagnostic interface that communicates with the Senzing binaries.

To use szdiagnostic, the LD_LIBRARY_PATH environment variable must include a path to Senzing’s libraries.

Example:

export LD_LIBRARY_PATH=/opt/senzing/er/lib
class senzing_core.szdiagnostic.SzDiagnosticCore(**kwargs: Any)[source]

Bases: SzDiagnostic

Use SzAbstractFactoryCore.create_diagnostic() to create an SzDiagnostic object. The SzDiagnostic object uses the parameters provided to SzAbstractFactoryCore().

Example:

from senzing_core import SzAbstractFactoryCore

sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
sz_diagnostic = sz_abstract_factory.create_diagnostic()

Parameters:

Raises:

check_datastore_performance(seconds_to_run: int) str[source]

The check_datastore_performance method performs inserts to determine rate of insertion.

Parameters:

seconds_to_run (int) – Duration of the test in seconds.

Returns:

A string containing a JSON document.

Return type:

str

Raises:
  • TypeError – Incorrect datatype of input parameter.

  • szexception.SzError

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6seconds_to_run = 3
 7settings = {
 8    "PIPELINE": {
 9        "CONFIGPATH": "/etc/opt/senzing",
10        "RESOURCEPATH": "/opt/senzing/er/resources",
11        "SUPPORTPATH": "/opt/senzing/data",
12    },
13    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
14}
15
16try:
17    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
18    sz_diagnostic = sz_abstract_factory.create_diagnostic()
19    result = sz_diagnostic.check_datastore_performance(seconds_to_run)
20    print(f"\n{result}\n")
21except SzError as err:
22    print(f"\nERROR: {err}\n")

Output:

1// Output has been formatted for easier reading.
2
3{
4    "numRecordsInserted": 0,
5    "insertTime": 0
6}
get_datastore_info() str[source]

The get_datastore_info method returns a JSON document with details of the datastore currently in use by Senzing.

Raises:

szexception.SzError

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_diagnostic = sz_abstract_factory.create_diagnostic()
18    result = sz_diagnostic.get_datastore_info()
19    print(f"\n{result}\n")
20except SzError as err:
21    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4    "dataStores": [
 5        {
 6            "id": "CORE",
 7            "type": "sqlite3",
 8            "location": "/tmp/sqlite/G2C.db"
 9        }
10    ]
11}
get_feature(feature_id: int) str[source]
help(method_name: str = '') str

Return the help for a particular message.

Parameters:

method_name (str) – The name of the method. (e.g. “init”). If empty, a list of methods and descriptions is returned.

Returns:

The Help information about the requested method

Return type:

str

initialize(instance_name: str, settings: str | Dict[Any, Any], config_id: int = 0, verbose_logging: int = 0) None[source]

Initialize the C-based Senzing SzDiagnostic.

Parameters:
  • instance_name (str) – A name to distinguish this instance of the SzDiagnostic.

  • settings (Union[str, Dict[Any, Any]]) – A JSON document defining runtime configuration.

  • verbose_logging (int, optional) – Send debug statements to STDOUT. Defaults to 0.

purge_repository() None[source]

Warning: The purge_repository method removes every record in the Senzing repository.

Before calling purge_repository all other instances of the Senzing API MUST be destroyed or shutdown.

Raises:

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_diagnostic = sz_abstract_factory.create_diagnostic()
18    # WARNING
19    # WARNING - This will remove all loaded and entity resolved data from the Senzing repository, use with caution!
20    # WARNING - Uncomment the purge_repository() call below to complete a purge
21    # WARNING
22
23    # sz_diagnostic.purge_repository()
24except SzError as err:
25    print(f"\nERROR: {err}\n")
reinitialize(config_id: int) None[source]

The reinitialize method reinitializes the Senzing object using a specific configuration identifier. A list of available configuration identifiers can be retrieved using szconfigmanager.get_configs.

szengine

senzing_core.szengine.SzEngineCore is an implementation of the senzing.szengine.SzEngine interface that communicates with the Senzing binaries.

To use szengine, the LD_LIBRARY_PATH environment variable must include a path to Senzing’s libraries.

Example:

export LD_LIBRARY_PATH=/opt/senzing/er/lib
class senzing_core.szengine.SzEngineCore(**kwargs: Any)[source]

Bases: SzEngine

Use SzAbstractFactoryCore.create_engine() to create an SzEngine object. The SzEngine object uses the parameters provided to SzAbstractFactoryCore().

Example:

from senzing_core import SzAbstractFactoryCore

sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
sz_engine = sz_abstract_factory.create_engine()

Parameters:

Raises:

add_record(data_source_code: str, record_id: str, record_definition: str, flags: int = 0) str[source]

The add_record method adds a record into the Senzing repository. Can be called as many times as desired and from multiple threads at the same time.

Parameters:
  • data_source_code (str) – Identifies the provenance of the data.

  • record_id (str) – The unique identifier within the records of the same data source.

  • record_definition (str) – A JSON document containing the record to be added to the Senzing repository.

  • flags (int, optional) – Flags used to control information returned. Defaults to 0.

Returns:

If flags are set to return the WITH_INFO response a JSON document containing the details, otherwise an empty string.

Return type:

str

Raises:

Example:
 1import json
 2
 3from senzing import SzEngineFlags, SzError
 4
 5from senzing_core import SzAbstractFactoryCore
 6
 7data_source_code = "TEST"
 8flags = SzEngineFlags.SZ_WITH_INFO
 9instance_name = "Example"
10record_definition = json.dumps(
11    {
12        "RECORD_TYPE": "PERSON",
13        "PRIMARY_NAME_LAST": "Smith",
14        "PRIMARY_NAME_FIRST": "Robert",
15        "DATE_OF_BIRTH": "12/11/1978",
16        "ADDR_TYPE": "MAILING",
17        "ADDR_LINE1": "123 Main Street, Las Vegas NV 89132",
18        "PHONE_TYPE": "HOME",
19        "PHONE_NUMBER": "702-919-1300",
20        "EMAIL_ADDRESS": "bsmith@work.com",
21        "DATE": "1/2/18",
22        "STATUS": "Active",
23        "AMOUNT": "100",
24    }
25)
26record_id = "1"
27settings = {
28    "PIPELINE": {
29        "CONFIGPATH": "/etc/opt/senzing",
30        "RESOURCEPATH": "/opt/senzing/er/resources",
31        "SUPPORTPATH": "/opt/senzing/data",
32    },
33    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
34}
35
36try:
37    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
38    sz_engine = sz_abstract_factory.create_engine()
39    result = sz_engine.add_record(data_source_code, record_id, record_definition, flags)
40    print(f"\n{result}\n")
41except SzError as err:
42    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4    "DATA_SOURCE": "TEST",
 5    "RECORD_ID": "1",
 6    "AFFECTED_ENTITIES": [
 7        {
 8            "ENTITY_ID": 1
 9        },
10        {
11            "ENTITY_ID": 35
12        }
13    ],
14    "INTERESTING_ENTITIES": {
15        "ENTITIES": []
16    }
17}
bulk_load(records: List[str]) str[source]

Internal method

close_export(export_handle: int) None[source]

The close_export method closes the exported document created by export_json_entity_report. It is part of the export_json_entity_report, fetch_next, close_export lifecycle of a list of sized entities.

Parameters:

export_handle (int) – A handle created by export_json_entity_report or export_csv_entity_report.

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5flags = SzEngineFlags.SZ_EXPORT_DEFAULT_FLAGS
 6instance_name = "Example"
 7settings = {
 8    "PIPELINE": {
 9        "CONFIGPATH": "/etc/opt/senzing",
10        "RESOURCEPATH": "/opt/senzing/er/resources",
11        "SUPPORTPATH": "/opt/senzing/data",
12    },
13    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
14}
15
16try:
17    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
18    sz_engine = sz_abstract_factory.create_engine()
19    export_handle = sz_engine.export_json_entity_report(flags)
20    while True:
21        fragment = sz_engine.fetch_next(export_handle)
22        if not fragment:
23            break
24        print(fragment, end="")
25    sz_engine.close_export(export_handle)
26except SzError as err:
27    print(f"\nERROR: {err}\n")

Output:

1{"RESOLVED_ENTITY":{"ENTITY_ID":1,"ENTITY_NAME":"","FEATURES":{},"RECORD_SUMMARY":[{"DATA_SOURCE":"TEST","RECORD_COUNT":1}],"RECORDS":[{"DATA_SOURCE":"TEST","RECORD_ID":"2","INTERNAL_ID":1,"MATCH_KEY":"","MATCH_LEVEL_CODE":"","ERRULE_CODE":"","FIRST_SEEN_DT":"2024-10-25T17:38:57Z","LAST_SEEN_DT":"2024-10-25T17:38:57Z"}]},"RELATED_ENTITIES":[]}
2{"RESOLVED_ENTITY":{"ENTITY_ID":35,"ENTITY_NAME":"Robert Smith","FEATURES":{"ADDRESS":[{"FEAT_DESC":"1515 Adela Lane Las Vegas NV 89111","LIB_FEAT_ID":22,"USAGE_TYPE":"HOME","FEAT_DESC_VALUES":[{"FEAT_DESC":"1515 Adela Lane Las Vegas NV 89111","LIB_FEAT_ID":22}]},{"FEAT_DESC":"123 Main Street, Las Vegas NV 89132","LIB_FEAT_ID":3,"USAGE_TYPE":"MAILING","FEAT_DESC_VALUES":[{"FEAT_DESC":"123 Main Street, Las Vegas NV 89132","LIB_FEAT_ID":3}]}],"DOB":[{"FEAT_DESC":"12/11/1978","LIB_FEAT_ID":2,"FEAT_DESC_VALUES":[{"FEAT_DESC":"12/11/1978","LIB_FEAT_ID":2},{"FEAT_DESC":"11/12/1978","LIB_FEAT_ID":21}]}],"EMAIL":[{"FEAT_DESC":"bsmith@work.com","LIB_FEAT_ID":5,"FEAT_DESC_VALUES":[{"FEAT_DESC":"bsmith@work.com","LIB_FEAT_ID":5}]}],"NAME":[{"FEAT_DESC":"Robert Smith","LIB_FEAT_ID":1,"USAGE_TYPE":"PRIMARY","FEAT_DESC_VALUES":[{"FEAT_DESC":"Robert Smith","LIB_FEAT_ID":1},{"FEAT_DESC":"Bob J Smith","LIB_FEAT_ID":38},{"FEAT_DESC":"Bob Smith","LIB_FEAT_ID":20}]}],"PHONE":[{"FEAT_DESC":"702-919-1300","LIB_FEAT_ID":4,"USAGE_TYPE":"HOME","FEAT_DESC_VALUES":[{"FEAT_DESC":"702-919-1300","LIB_FEAT_ID":4}]},{"FEAT_DESC":"702-919-1300","LIB_FEAT_ID":4,"USAGE_TYPE":"MOBILE","FEAT_DESC_VALUES":[{"FEAT_DESC":"702-919-1300","LIB_FEAT_ID":4}]}],"RECORD_TYPE":[{"FEAT_DESC":"PERSON","LIB_FEAT_ID":10,"FEAT_DESC_VALUES":[{"FEAT_DESC":"PERSON","LIB_FEAT_ID":10}]}]},"RECORD_SUMMARY":[{"DATA_SOURCE":"CUSTOMERS","RECORD_COUNT":3}],"RECORDS":[{"DATA_SOURCE":"CUSTOMERS","RECORD_ID":"1001","INTERNAL_ID":35,"MATCH_KEY":"","MATCH_LEVEL_CODE":"","ERRULE_CODE":"","FIRST_SEEN_DT":"2024-10-25T17:39:00Z","LAST_SEEN_DT":"2024-10-25T17:39:00Z"},{"DATA_SOURCE":"CUSTOMERS","RECORD_ID":"1002","INTERNAL_ID":36,"MATCH_KEY":"+NAME+DOB+PHONE","MATCH_LEVEL_CODE":"RESOLVED","ERRULE_CODE":"CNAME_CFF_CEXCL","FIRST_SEEN_DT":"2024-10-25T17:39:00Z","LAST_SEEN_DT":"2024-10-25T17:39:00Z"},{"DATA_SOURCE":"CUSTOMERS","RECORD_ID":"1003","INTERNAL_ID":37,"MATCH_KEY":"+NAME+DOB+EMAIL","MATCH_LEVEL_CODE":"RESOLVED","ERRULE_CODE":"SF1_PNAME_CSTAB","FIRST_SEEN_DT":"2024-10-25T17:39:00Z","LAST_SEEN_DT":"2024-10-25T17:39:00Z"}]},"RELATED_ENTITIES":[]}
3{"RESOLVED_ENTITY":{"ENTITY_ID":38,"ENTITY_NAME":"Edward Kusha","FEATURES":{"ADDRESS":[{"FEAT_DESC":"1304 Poppy Hills Dr Blacklick OH 43004","LIB_FEAT_ID":46,"USAGE_TYPE":"HOME","FEAT_DESC_VALUES":[{"FEAT_DESC":"1304 Poppy Hills Dr Blacklick OH 43004","LIB_FEAT_ID":46}]}],"DOB":[{"FEAT_DESC":"3/1/1970","LIB_FEAT_ID":45,"FEAT_DESC_VALUES":[{"FEAT_DESC":"3/1/1970","LIB_FEAT_ID":45}]}],"EMAIL":[{"FEAT_DESC":"Kusha123@hmail.com","LIB_FEAT_ID":48,"FEAT_DESC_VALUES":[{"FEAT_DESC":"Kusha123@hmail.com","LIB_FEAT_ID":48}]}],"NAME":[{"FEAT_DESC":"Edward Kusha","LIB_FEAT_ID":44,"USAGE_TYPE":"PRIMARY","FEAT_DESC_VALUES":[{"FEAT_DESC":"Edward Kusha","LIB_FEAT_ID":44}]}],"RECORD_TYPE":[{"FEAT_DESC":"PERSON","LIB_FEAT_ID":10,"FEAT_DESC_VALUES":[{"FEAT_DESC":"PERSON","LIB_FEAT_ID":10}]}],"SSN":[{"FEAT_DESC":"294-66-9999","LIB_FEAT_ID":47,"FEAT_DESC_VALUES":[{"FEAT_DESC":"294-66-9999","LIB_FEAT_ID":47}]}]},"RECORD_SUMMARY":[{"DATA_SOURCE":"CUSTOMERS","RECORD_COUNT":1}],"RECORDS":[{"DATA_SOURCE":"CUSTOMERS","RECORD_ID":"1009","INTERNAL_ID":38,"MATCH_KEY":"","MATCH_LEVEL_CODE":"","ERRULE_CODE":"","FIRST_SEEN_DT":"2024-10-25T17:39:00Z","LAST_SEEN_DT":"2024-10-25T17:39:00Z"}]},"RELATED_ENTITIES":[]}
count_redo_records() int[source]

The count_redo_records method returns the number of records in need of redo-ing.

Returns:

The number of redo records in Senzing’s redo queue.

Return type:

int

Raises:

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_engine = sz_abstract_factory.create_engine()
18    result = sz_engine.count_redo_records()
19    print(f"\n{result}\n")
20except SzError as err:
21    print(f"\nERROR: {err}\n")

Output:

12
delete_record(data_source_code: str, record_id: str, flags: int = 0) str[source]

The delete_record method deletes a record from the Senzing repository. Can be called as many times as desired and from multiple threads at the same time.

Parameters:
  • data_source_code (str) – Identifies the provenance of the data.

  • record_id (str) – The unique identifier within the records of the same data source.

  • flags (int, optional) – Flags used to control information returned. Defaults to 0.

Returns:

If flags are set to return the WITH_INFO response a JSON document containing the details, otherwise an empty string.

Return type:

str

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5data_source_code = "TEST"
 6flags = SzEngineFlags.SZ_WITH_INFO
 7instance_name = "Example"
 8record_id = "1"
 9settings = {
10    "PIPELINE": {
11        "CONFIGPATH": "/etc/opt/senzing",
12        "RESOURCEPATH": "/opt/senzing/er/resources",
13        "SUPPORTPATH": "/opt/senzing/data",
14    },
15    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
16}
17
18try:
19    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
20    sz_engine = sz_abstract_factory.create_engine()
21    result = sz_engine.delete_record(data_source_code, record_id, flags)
22    print(f"\n{result}\n")
23except SzError as err:
24    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4    "DATA_SOURCE": "TEST",
 5    "RECORD_ID": "1",
 6    "AFFECTED_ENTITIES": [
 7        {
 8            "ENTITY_ID": 35
 9        }
10    ],
11    "INTERESTING_ENTITIES": {
12        "ENTITIES": []
13    }
14}
export_csv_entity_report(csv_column_list: str, flags: int = <SzEngineFlags.SZ_EXPORT_DEFAULT_FLAGS: 3734497>) int[source]

Warning: export_csv_entity_report is not recommended for large systems as it does not scale. It is recommended larger systems implement real-time replication to a data warehouse.

The export_csv_entity_report method initializes a cursor over a document of exported entities. It is part of the export_csv_entity_report, fetch_next, close_export lifecycle of a list of entities to export.

Available CSV columns: RESOLVED_ENTITY_ID, RESOLVED_ENTITY_NAME, RELATED_ENTITY_ID, MATCH_LEVEL,

MATCH_LEVEL_CODE, MATCH_KEY, MATCH_KEY_DETAILS,I S_DISCLOSED, IS_AMBIGUOUS, DATA_SOURCE, RECORD_ID, JSON_DATA, FIRST_SEEN_DT, LAST_SEEN_DT, UNMAPPED_DATA, ERRULE_CODE, RELATED_ENTITY_NAME

Suggested CSV columns: RESOLVED_ENTITY_ID, RELATED_ENTITY_ID, RESOLVED_ENTITY_NAME, MATCH_LEVEL,

MATCH_KEY, DATA_SOURCE, RECORD_ID

Parameters:
  • csv_column_list (str) – A comma-separated list of column names for the CSV export.

  • flags (int, optional) – Flags used to control information returned. Defaults to SzEngineFlags.SZ_EXPORT_DEFAULT_FLAGS.

Returns:

A handle that identifies the document to be scrolled through using fetch_next.

Return type:

int

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5csv_column_list = (
 6    "RESOLVED_ENTITY_ID,RELATED_ENTITY_ID,RESOLVED_ENTITY_NAME,MATCH_LEVEL,MATCH_KEY,DATA_SOURCE,RECORD_ID"
 7)
 8flags = SzEngineFlags.SZ_EXPORT_DEFAULT_FLAGS
 9instance_name = "Example"
10settings = {
11    "PIPELINE": {
12        "CONFIGPATH": "/etc/opt/senzing",
13        "RESOURCEPATH": "/opt/senzing/er/resources",
14        "SUPPORTPATH": "/opt/senzing/data",
15    },
16    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
17}
18
19try:
20    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
21    sz_engine = sz_abstract_factory.create_engine()
22    export_handle = sz_engine.export_csv_entity_report(csv_column_list, flags)
23    while True:
24        fragment = sz_engine.fetch_next(export_handle)
25        if not fragment:
26            break
27        print(fragment, end="")
28    sz_engine.close_export(export_handle)
29except SzError as err:
30    print(f"\nERROR: {err}\n")

Output:

1RESOLVED_ENTITY_ID,RESOLVED_ENTITY_NAME,RELATED_ENTITY_ID,MATCH_LEVEL,MATCH_KEY,DATA_SOURCE,RECORD_ID
21,"",0,0,"","TEST","2"
335,"Robert Smith",0,0,"","CUSTOMERS","1001"
435,"Robert Smith",0,1,"+NAME+DOB+PHONE","CUSTOMERS","1002"
535,"Robert Smith",0,1,"+NAME+DOB+EMAIL","CUSTOMERS","1003"
638,"Edward Kusha",0,0,"","CUSTOMERS","1009"
export_json_entity_report(flags: int = <SzEngineFlags.SZ_EXPORT_DEFAULT_FLAGS: 3734497>) int[source]

Warning: export_json_entity_report is not recommended for large systems as it does not scale. It is recommended larger systems implement real-time replication to a data warehouse.

The export_json_entity_report method initializes a cursor over a document of exported entities. It is part of the export_json_entity_report, fetch_next, close_export lifecycle of a list of entities to export.

Parameters:

flags (int, optional) – Flags used to control information returned. Defaults to SzEngineFlags.SZ_EXPORT_DEFAULT_FLAGS.

Returns:

A handle that identifies the document to be scrolled through using fetch_next.

Return type:

int

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5flags = SzEngineFlags.SZ_EXPORT_DEFAULT_FLAGS
 6instance_name = "Example"
 7settings = {
 8    "PIPELINE": {
 9        "CONFIGPATH": "/etc/opt/senzing",
10        "RESOURCEPATH": "/opt/senzing/er/resources",
11        "SUPPORTPATH": "/opt/senzing/data",
12    },
13    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
14}
15
16try:
17    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
18    sz_engine = sz_abstract_factory.create_engine()
19    export_handle = sz_engine.export_json_entity_report(flags)
20    while True:
21        fragment = sz_engine.fetch_next(export_handle)
22        if not fragment:
23            break
24        print(fragment, end="")
25    sz_engine.close_export(export_handle)
26except SzError as err:
27    print(f"\nERROR: {err}\n")

Output:

1{"RESOLVED_ENTITY":{"ENTITY_ID":1,"ENTITY_NAME":"","FEATURES":{},"RECORD_SUMMARY":[{"DATA_SOURCE":"TEST","RECORD_COUNT":1}],"RECORDS":[{"DATA_SOURCE":"TEST","RECORD_ID":"2","INTERNAL_ID":1,"MATCH_KEY":"","MATCH_LEVEL_CODE":"","ERRULE_CODE":"","FIRST_SEEN_DT":"2024-10-25T17:38:57Z","LAST_SEEN_DT":"2024-10-25T17:38:57Z"}]},"RELATED_ENTITIES":[]}
2{"RESOLVED_ENTITY":{"ENTITY_ID":35,"ENTITY_NAME":"Robert Smith","FEATURES":{"ADDRESS":[{"FEAT_DESC":"1515 Adela Lane Las Vegas NV 89111","LIB_FEAT_ID":22,"USAGE_TYPE":"HOME","FEAT_DESC_VALUES":[{"FEAT_DESC":"1515 Adela Lane Las Vegas NV 89111","LIB_FEAT_ID":22}]},{"FEAT_DESC":"123 Main Street, Las Vegas NV 89132","LIB_FEAT_ID":3,"USAGE_TYPE":"MAILING","FEAT_DESC_VALUES":[{"FEAT_DESC":"123 Main Street, Las Vegas NV 89132","LIB_FEAT_ID":3}]}],"DOB":[{"FEAT_DESC":"12/11/1978","LIB_FEAT_ID":2,"FEAT_DESC_VALUES":[{"FEAT_DESC":"12/11/1978","LIB_FEAT_ID":2},{"FEAT_DESC":"11/12/1978","LIB_FEAT_ID":21}]}],"EMAIL":[{"FEAT_DESC":"bsmith@work.com","LIB_FEAT_ID":5,"FEAT_DESC_VALUES":[{"FEAT_DESC":"bsmith@work.com","LIB_FEAT_ID":5}]}],"NAME":[{"FEAT_DESC":"Robert Smith","LIB_FEAT_ID":1,"USAGE_TYPE":"PRIMARY","FEAT_DESC_VALUES":[{"FEAT_DESC":"Robert Smith","LIB_FEAT_ID":1},{"FEAT_DESC":"Bob J Smith","LIB_FEAT_ID":38},{"FEAT_DESC":"Bob Smith","LIB_FEAT_ID":20}]}],"PHONE":[{"FEAT_DESC":"702-919-1300","LIB_FEAT_ID":4,"USAGE_TYPE":"HOME","FEAT_DESC_VALUES":[{"FEAT_DESC":"702-919-1300","LIB_FEAT_ID":4}]},{"FEAT_DESC":"702-919-1300","LIB_FEAT_ID":4,"USAGE_TYPE":"MOBILE","FEAT_DESC_VALUES":[{"FEAT_DESC":"702-919-1300","LIB_FEAT_ID":4}]}],"RECORD_TYPE":[{"FEAT_DESC":"PERSON","LIB_FEAT_ID":10,"FEAT_DESC_VALUES":[{"FEAT_DESC":"PERSON","LIB_FEAT_ID":10}]}]},"RECORD_SUMMARY":[{"DATA_SOURCE":"CUSTOMERS","RECORD_COUNT":3}],"RECORDS":[{"DATA_SOURCE":"CUSTOMERS","RECORD_ID":"1001","INTERNAL_ID":35,"MATCH_KEY":"","MATCH_LEVEL_CODE":"","ERRULE_CODE":"","FIRST_SEEN_DT":"2024-10-25T17:39:00Z","LAST_SEEN_DT":"2024-10-25T17:39:00Z"},{"DATA_SOURCE":"CUSTOMERS","RECORD_ID":"1002","INTERNAL_ID":36,"MATCH_KEY":"+NAME+DOB+PHONE","MATCH_LEVEL_CODE":"RESOLVED","ERRULE_CODE":"CNAME_CFF_CEXCL","FIRST_SEEN_DT":"2024-10-25T17:39:00Z","LAST_SEEN_DT":"2024-10-25T17:39:00Z"},{"DATA_SOURCE":"CUSTOMERS","RECORD_ID":"1003","INTERNAL_ID":37,"MATCH_KEY":"+NAME+DOB+EMAIL","MATCH_LEVEL_CODE":"RESOLVED","ERRULE_CODE":"SF1_PNAME_CSTAB","FIRST_SEEN_DT":"2024-10-25T17:39:00Z","LAST_SEEN_DT":"2024-10-25T17:39:00Z"}]},"RELATED_ENTITIES":[]}
3{"RESOLVED_ENTITY":{"ENTITY_ID":38,"ENTITY_NAME":"Edward Kusha","FEATURES":{"ADDRESS":[{"FEAT_DESC":"1304 Poppy Hills Dr Blacklick OH 43004","LIB_FEAT_ID":46,"USAGE_TYPE":"HOME","FEAT_DESC_VALUES":[{"FEAT_DESC":"1304 Poppy Hills Dr Blacklick OH 43004","LIB_FEAT_ID":46}]}],"DOB":[{"FEAT_DESC":"3/1/1970","LIB_FEAT_ID":45,"FEAT_DESC_VALUES":[{"FEAT_DESC":"3/1/1970","LIB_FEAT_ID":45}]}],"EMAIL":[{"FEAT_DESC":"Kusha123@hmail.com","LIB_FEAT_ID":48,"FEAT_DESC_VALUES":[{"FEAT_DESC":"Kusha123@hmail.com","LIB_FEAT_ID":48}]}],"NAME":[{"FEAT_DESC":"Edward Kusha","LIB_FEAT_ID":44,"USAGE_TYPE":"PRIMARY","FEAT_DESC_VALUES":[{"FEAT_DESC":"Edward Kusha","LIB_FEAT_ID":44}]}],"RECORD_TYPE":[{"FEAT_DESC":"PERSON","LIB_FEAT_ID":10,"FEAT_DESC_VALUES":[{"FEAT_DESC":"PERSON","LIB_FEAT_ID":10}]}],"SSN":[{"FEAT_DESC":"294-66-9999","LIB_FEAT_ID":47,"FEAT_DESC_VALUES":[{"FEAT_DESC":"294-66-9999","LIB_FEAT_ID":47}]}]},"RECORD_SUMMARY":[{"DATA_SOURCE":"CUSTOMERS","RECORD_COUNT":1}],"RECORDS":[{"DATA_SOURCE":"CUSTOMERS","RECORD_ID":"1009","INTERNAL_ID":38,"MATCH_KEY":"","MATCH_LEVEL_CODE":"","ERRULE_CODE":"","FIRST_SEEN_DT":"2024-10-25T17:39:00Z","LAST_SEEN_DT":"2024-10-25T17:39:00Z"}]},"RELATED_ENTITIES":[]}
fetch_next(export_handle: int) str[source]

The fetch_next method is used to scroll through an exported document one entity at a time. Successive calls of fetch_next will export successive rows of entity data until there is no more. It is part of the export_json_entity_report or export_json_entity_report, fetch_next, close_export lifecycle of a list of exported entities.

Parameters:

export_handle (int) – A handle created by export_json_entity_report or export_json_entity_report.

Returns:

TODO:

Return type:

str

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5flags = SzEngineFlags.SZ_EXPORT_DEFAULT_FLAGS
 6instance_name = "Example"
 7settings = {
 8    "PIPELINE": {
 9        "CONFIGPATH": "/etc/opt/senzing",
10        "RESOURCEPATH": "/opt/senzing/er/resources",
11        "SUPPORTPATH": "/opt/senzing/data",
12    },
13    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
14}
15
16try:
17    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
18    sz_engine = sz_abstract_factory.create_engine()
19    export_handle = sz_engine.export_json_entity_report(flags)
20    while True:
21        fragment = sz_engine.fetch_next(export_handle)
22        if not fragment:
23            break
24        print(fragment, end="")
25    sz_engine.close_export(export_handle)
26except SzError as err:
27    print(f"\nERROR: {err}\n")

Output:

1{"RESOLVED_ENTITY":{"ENTITY_ID":1,"ENTITY_NAME":"","FEATURES":{},"RECORD_SUMMARY":[{"DATA_SOURCE":"TEST","RECORD_COUNT":1}],"RECORDS":[{"DATA_SOURCE":"TEST","RECORD_ID":"2","INTERNAL_ID":1,"MATCH_KEY":"","MATCH_LEVEL_CODE":"","ERRULE_CODE":"","FIRST_SEEN_DT":"2024-10-25T17:38:57Z","LAST_SEEN_DT":"2024-10-25T17:38:57Z"}]},"RELATED_ENTITIES":[]}
2{"RESOLVED_ENTITY":{"ENTITY_ID":35,"ENTITY_NAME":"Robert Smith","FEATURES":{"ADDRESS":[{"FEAT_DESC":"1515 Adela Lane Las Vegas NV 89111","LIB_FEAT_ID":22,"USAGE_TYPE":"HOME","FEAT_DESC_VALUES":[{"FEAT_DESC":"1515 Adela Lane Las Vegas NV 89111","LIB_FEAT_ID":22}]},{"FEAT_DESC":"123 Main Street, Las Vegas NV 89132","LIB_FEAT_ID":3,"USAGE_TYPE":"MAILING","FEAT_DESC_VALUES":[{"FEAT_DESC":"123 Main Street, Las Vegas NV 89132","LIB_FEAT_ID":3}]}],"DOB":[{"FEAT_DESC":"12/11/1978","LIB_FEAT_ID":2,"FEAT_DESC_VALUES":[{"FEAT_DESC":"12/11/1978","LIB_FEAT_ID":2},{"FEAT_DESC":"11/12/1978","LIB_FEAT_ID":21}]}],"EMAIL":[{"FEAT_DESC":"bsmith@work.com","LIB_FEAT_ID":5,"FEAT_DESC_VALUES":[{"FEAT_DESC":"bsmith@work.com","LIB_FEAT_ID":5}]}],"NAME":[{"FEAT_DESC":"Robert Smith","LIB_FEAT_ID":1,"USAGE_TYPE":"PRIMARY","FEAT_DESC_VALUES":[{"FEAT_DESC":"Robert Smith","LIB_FEAT_ID":1},{"FEAT_DESC":"Bob J Smith","LIB_FEAT_ID":38},{"FEAT_DESC":"Bob Smith","LIB_FEAT_ID":20}]}],"PHONE":[{"FEAT_DESC":"702-919-1300","LIB_FEAT_ID":4,"USAGE_TYPE":"HOME","FEAT_DESC_VALUES":[{"FEAT_DESC":"702-919-1300","LIB_FEAT_ID":4}]},{"FEAT_DESC":"702-919-1300","LIB_FEAT_ID":4,"USAGE_TYPE":"MOBILE","FEAT_DESC_VALUES":[{"FEAT_DESC":"702-919-1300","LIB_FEAT_ID":4}]}],"RECORD_TYPE":[{"FEAT_DESC":"PERSON","LIB_FEAT_ID":10,"FEAT_DESC_VALUES":[{"FEAT_DESC":"PERSON","LIB_FEAT_ID":10}]}]},"RECORD_SUMMARY":[{"DATA_SOURCE":"CUSTOMERS","RECORD_COUNT":3}],"RECORDS":[{"DATA_SOURCE":"CUSTOMERS","RECORD_ID":"1001","INTERNAL_ID":35,"MATCH_KEY":"","MATCH_LEVEL_CODE":"","ERRULE_CODE":"","FIRST_SEEN_DT":"2024-10-25T17:39:00Z","LAST_SEEN_DT":"2024-10-25T17:39:00Z"},{"DATA_SOURCE":"CUSTOMERS","RECORD_ID":"1002","INTERNAL_ID":36,"MATCH_KEY":"+NAME+DOB+PHONE","MATCH_LEVEL_CODE":"RESOLVED","ERRULE_CODE":"CNAME_CFF_CEXCL","FIRST_SEEN_DT":"2024-10-25T17:39:00Z","LAST_SEEN_DT":"2024-10-25T17:39:00Z"},{"DATA_SOURCE":"CUSTOMERS","RECORD_ID":"1003","INTERNAL_ID":37,"MATCH_KEY":"+NAME+DOB+EMAIL","MATCH_LEVEL_CODE":"RESOLVED","ERRULE_CODE":"SF1_PNAME_CSTAB","FIRST_SEEN_DT":"2024-10-25T17:39:00Z","LAST_SEEN_DT":"2024-10-25T17:39:00Z"}]},"RELATED_ENTITIES":[]}
3{"RESOLVED_ENTITY":{"ENTITY_ID":38,"ENTITY_NAME":"Edward Kusha","FEATURES":{"ADDRESS":[{"FEAT_DESC":"1304 Poppy Hills Dr Blacklick OH 43004","LIB_FEAT_ID":46,"USAGE_TYPE":"HOME","FEAT_DESC_VALUES":[{"FEAT_DESC":"1304 Poppy Hills Dr Blacklick OH 43004","LIB_FEAT_ID":46}]}],"DOB":[{"FEAT_DESC":"3/1/1970","LIB_FEAT_ID":45,"FEAT_DESC_VALUES":[{"FEAT_DESC":"3/1/1970","LIB_FEAT_ID":45}]}],"EMAIL":[{"FEAT_DESC":"Kusha123@hmail.com","LIB_FEAT_ID":48,"FEAT_DESC_VALUES":[{"FEAT_DESC":"Kusha123@hmail.com","LIB_FEAT_ID":48}]}],"NAME":[{"FEAT_DESC":"Edward Kusha","LIB_FEAT_ID":44,"USAGE_TYPE":"PRIMARY","FEAT_DESC_VALUES":[{"FEAT_DESC":"Edward Kusha","LIB_FEAT_ID":44}]}],"RECORD_TYPE":[{"FEAT_DESC":"PERSON","LIB_FEAT_ID":10,"FEAT_DESC_VALUES":[{"FEAT_DESC":"PERSON","LIB_FEAT_ID":10}]}],"SSN":[{"FEAT_DESC":"294-66-9999","LIB_FEAT_ID":47,"FEAT_DESC_VALUES":[{"FEAT_DESC":"294-66-9999","LIB_FEAT_ID":47}]}]},"RECORD_SUMMARY":[{"DATA_SOURCE":"CUSTOMERS","RECORD_COUNT":1}],"RECORDS":[{"DATA_SOURCE":"CUSTOMERS","RECORD_ID":"1009","INTERNAL_ID":38,"MATCH_KEY":"","MATCH_LEVEL_CODE":"","ERRULE_CODE":"","FIRST_SEEN_DT":"2024-10-25T17:39:00Z","LAST_SEEN_DT":"2024-10-25T17:39:00Z"}]},"RELATED_ENTITIES":[]}
find_interesting_entities_by_entity_id(entity_id: int, flags: int = 0) str[source]
find_interesting_entities_by_record_id(data_source_code: str, record_id: str, flags: int = 0) str[source]
find_network_by_entity_id(entity_ids: ~typing.List[int], max_degrees: int, build_out_degrees: int, build_out_max_entities: int, flags: int = <SzEngineFlags.SZ_FIND_NETWORK_DEFAULT_FLAGS: 8589946880>) str[source]

The find_network_by_entity_id method finds all entities surrounding a requested set of entities. This includes the requested entities, paths between them, and relations to other nearby entities. Returns a JSON document that identifies the path between the each set of search entities (if the path exists), and the information for the entities in the path.

Parameters:
  • entity_ids (list(int)) – The entity IDs to find the network between.

  • max_degrees (int) – The maximum number of degrees in paths between search entities.

  • build_out_degrees (int) – The number of degrees of relationships to show around each search entity.

  • build_out_max_entities (int) – The maximum number of entities to return in the discovered network.

  • flags (int, optional) – The maximum number of entities to return in the discovered network. Defaults to SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS.

Returns:

A JSON document.

Return type:

str

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5build_out_degrees = 1
 6entity_list = [1, 4]
 7flags = SzEngineFlags.SZ_FIND_NETWORK_DEFAULT_FLAGS
 8instance_name = "Example"
 9max_degrees = 2
10max_entities = 10
11settings = {
12    "PIPELINE": {
13        "CONFIGPATH": "/etc/opt/senzing",
14        "RESOURCEPATH": "/opt/senzing/er/resources",
15        "SUPPORTPATH": "/opt/senzing/data",
16    },
17    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
18}
19
20try:
21    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
22    sz_engine = sz_abstract_factory.create_engine()
23    result = sz_engine.find_network_by_entity_id(entity_list, max_degrees, build_out_degrees, max_entities, flags)
24    print(f"\n{result}\n")
25except SzError as err:
26    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4    "ENTITY_PATHS": [
 5        {
 6            "START_ENTITY_ID": 1,
 7            "END_ENTITY_ID": 35,
 8            "ENTITIES": []
 9        }
10    ],
11    "ENTITY_NETWORK_LINKS": [],
12    "ENTITIES": [
13        {
14            "RESOLVED_ENTITY": {
15                "ENTITY_ID": 1,
16                "ENTITY_NAME": "",
17                "RECORD_SUMMARY": [
18                    {
19                        "DATA_SOURCE": "TEST",
20                        "RECORD_COUNT": 1
21                    }
22                ]
23            }
24        },
25        {
26            "RESOLVED_ENTITY": {
27                "ENTITY_ID": 35,
28                "ENTITY_NAME": "Robert Smith",
29                "RECORD_SUMMARY": [
30                    {
31                        "DATA_SOURCE": "CUSTOMERS",
32                        "RECORD_COUNT": 3
33                    }
34                ]
35            }
36        }
37    ]
38}
find_network_by_record_id(record_keys: ~typing.List[~typing.Tuple[str, str]], max_degrees: int, build_out_degrees: int, build_out_max_entities: int, flags: int = <SzEngineFlags.SZ_FIND_NETWORK_DEFAULT_FLAGS: 8589946880>) str[source]

The find_network_by_record_id method finds all entities surrounding a requested set of entities by their RECORD_ID values. This includes the requested entities, paths between them, and relations to other nearby entities. Returns a JSON document that identifies the path between the each set of search entities (if the path exists), and the information for the entities in the path.

Parameters:
  • record_keys (list(tuple(str, str))) – The data source codes and record IDs to find the network between.

  • max_degrees (int) – The maximum number of degrees in paths between search entities.

  • build_out_degrees (int) – The number of degrees of relationships to show around each search entity.

  • build_out_max_entities (int) – The maximum number of entities to return in the discovered network.

  • flags (int, optional) – Flags used to control information returned. Defaults to SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS.

Returns:

A JSON document.

Return type:

str

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5build_out_degrees = 1
 6flags = SzEngineFlags.SZ_FIND_NETWORK_DEFAULT_FLAGS
 7instance_name = "Example"
 8max_degrees = 2
 9max_entities = 10
10record_list = [("CUSTOMERS", "1001"), ("CUSTOMERS", "1009")]
11settings = {
12    "PIPELINE": {
13        "CONFIGPATH": "/etc/opt/senzing",
14        "RESOURCEPATH": "/opt/senzing/er/resources",
15        "SUPPORTPATH": "/opt/senzing/data",
16    },
17    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
18}
19
20try:
21    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
22    sz_engine = sz_abstract_factory.create_engine()
23    result = sz_engine.find_network_by_record_id(record_list, max_degrees, build_out_degrees, max_entities, flags)
24    print(f"\n{result}\n")
25except SzError as err:
26    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4    "ENTITY_PATHS": [
 5        {
 6            "START_ENTITY_ID": 35,
 7            "END_ENTITY_ID": 38,
 8            "ENTITIES": []
 9        }
10    ],
11    "ENTITY_NETWORK_LINKS": [],
12    "ENTITIES": [
13        {
14            "RESOLVED_ENTITY": {
15                "ENTITY_ID": 35,
16                "ENTITY_NAME": "Robert Smith",
17                "RECORD_SUMMARY": [
18                    {
19                        "DATA_SOURCE": "CUSTOMERS",
20                        "RECORD_COUNT": 3
21                    }
22                ]
23            }
24        },
25        {
26            "RESOLVED_ENTITY": {
27                "ENTITY_ID": 38,
28                "ENTITY_NAME": "Edward Kusha",
29                "RECORD_SUMMARY": [
30                    {
31                        "DATA_SOURCE": "CUSTOMERS",
32                        "RECORD_COUNT": 1
33                    }
34                ]
35            }
36        }
37    ]
38}
find_path_by_entity_id(start_entity_id: int, end_entity_id: int, max_degrees: int, avoid_entity_ids: ~typing.List[int] | None = None, required_data_sources: ~typing.List[str] | None = None, flags: int = <SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS: 1073754112>) str[source]

The find_path_by_entity_id method finds the most efficient relationship between two entities path based on the parameters and returns a JSON document with an ENTITY_PATHS section that details the path between the entities. The ENTITIES sections details information on the entities. Paths are found using known relationships with other entities. Paths are found using known relationships with other entities.

Parameters:
  • start_entity_id (int) – The entity ID for the starting entity of the search path.

  • end_entity_id (int) – The entity ID for the ending entity of the search path.

  • max_degrees (int) – The maximum number of degrees in paths between search entities.

  • avoid_entity_ids (list(int), optional) – The entity IDs to avoid when finding a path.

  • required_data_sources (list(str), optional) – The data source code(s) that must be in a path.

  • flags (int, optional) – Flags used to control information returned. Defaults to SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS.

Returns:

A JSON document with an ENTITY_PATHS section that details the path between the entities.

Return type:

str

Raises:

Example:
 1from typing import List
 2
 3from senzing import SzEngineFlags, SzError
 4
 5from senzing_core import SzAbstractFactoryCore
 6
 7avoid_entity_ids: List[int] = []
 8end_entity_id = 4
 9flags = SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS
10instance_name = "Example"
11max_degrees = 2
12required_data_sources: List[str] = []
13settings = {
14    "PIPELINE": {
15        "CONFIGPATH": "/etc/opt/senzing",
16        "RESOURCEPATH": "/opt/senzing/er/resources",
17        "SUPPORTPATH": "/opt/senzing/data",
18    },
19    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
20}
21start_entity_id = 1
22
23try:
24    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
25    sz_engine = sz_abstract_factory.create_engine()
26    result = sz_engine.find_path_by_entity_id(
27        start_entity_id,
28        end_entity_id,
29        max_degrees,
30        avoid_entity_ids,
31        required_data_sources,
32        flags,
33    )
34    print(f"\n{result}\n")
35except SzError as err:
36    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4    "ENTITY_PATHS": [
 5        {
 6            "START_ENTITY_ID": 1,
 7            "END_ENTITY_ID": 35,
 8            "ENTITIES": []
 9        }
10    ],
11    "ENTITY_PATH_LINKS": [],
12    "ENTITIES": [
13        {
14            "RESOLVED_ENTITY": {
15                "ENTITY_ID": 1,
16                "ENTITY_NAME": "",
17                "RECORD_SUMMARY": [
18                    {
19                        "DATA_SOURCE": "TEST",
20                        "RECORD_COUNT": 1
21                    }
22                ]
23            }
24        },
25        {
26            "RESOLVED_ENTITY": {
27                "ENTITY_ID": 35,
28                "ENTITY_NAME": "Robert Smith",
29                "RECORD_SUMMARY": [
30                    {
31                        "DATA_SOURCE": "CUSTOMERS",
32                        "RECORD_COUNT": 3
33                    }
34                ]
35            }
36        }
37    ]
38}
find_path_by_record_id(start_data_source_code: str, start_record_id: str, end_data_source_code: str, end_record_id: str, max_degrees: int, avoid_record_keys: ~typing.List[~typing.Tuple[str, str]] | None = None, required_data_sources: ~typing.List[str] | None = None, flags: int = <SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS: 1073754112>) str[source]

The find_path_by_record_id method finds the most efficient relationship between two entities path based on the parameters by RECORD_ID values and returns a JSON document with an ENTITY_PATHS section that details the path between the entities. The ENTITIES sections details information on the entities. Paths are found using known relationships with other entities. The entities are identified by starting and ending records.

Parameters:
  • start_data_source_code (str) – Identifies the provenance of the record for the starting entity of the search path.

  • start_record_id (str) – The unique identifier within the records of the same data source for the starting entity of the search path.

  • end_data_source_code (str) – Identifies the provenance of the record for the ending entity of the search path.

  • end_record_id (str) – The unique identifier within the records of the same data source for the ending entity of the search path.

  • max_degrees (int) – The maximum number of degrees in paths between search entities.

  • avoid_record_keys (list(tuple(str, str)), optional) – The data source codes and record IDs to avoid when finding a path.

  • required_data_sources (list(str), optional) – The data source code(s) that must be in a path.

  • flags (int, optional) – Flags used to control information returned. Defaults to SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS.

Returns:

A JSON document.

Return type:

str

Raises:

Example:
 1from typing import List, Tuple
 2
 3from senzing import SzEngineFlags, SzError
 4
 5from senzing_core import SzAbstractFactoryCore
 6
 7avoid_record_keys: List[Tuple[str, str]] = []
 8end_data_source_code = "CUSTOMERS"
 9end_record_id = "1009"
10flags = SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS
11instance_name = "Example"
12max_degrees = 2
13required_data_sources: List[str] = []
14settings = {
15    "PIPELINE": {
16        "CONFIGPATH": "/etc/opt/senzing",
17        "RESOURCEPATH": "/opt/senzing/er/resources",
18        "SUPPORTPATH": "/opt/senzing/data",
19    },
20    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
21}
22start_data_source_code = "CUSTOMERS"
23start_record_id = "1001"
24
25try:
26    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
27    sz_engine = sz_abstract_factory.create_engine()
28    result = sz_engine.find_path_by_record_id(
29        start_data_source_code,
30        start_record_id,
31        end_data_source_code,
32        end_record_id,
33        max_degrees,
34        avoid_record_keys,
35        required_data_sources,
36        flags,
37    )
38    print(f"\n{result}\n")
39except SzError as err:
40    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4    "ENTITY_PATHS": [
 5        {
 6            "START_ENTITY_ID": 35,
 7            "END_ENTITY_ID": 38,
 8            "ENTITIES": []
 9        }
10    ],
11    "ENTITY_PATH_LINKS": [],
12    "ENTITIES": [
13        {
14            "RESOLVED_ENTITY": {
15                "ENTITY_ID": 35,
16                "ENTITY_NAME": "Robert Smith",
17                "RECORD_SUMMARY": [
18                    {
19                        "DATA_SOURCE": "CUSTOMERS",
20                        "RECORD_COUNT": 3
21                    }
22                ]
23            }
24        },
25        {
26            "RESOLVED_ENTITY": {
27                "ENTITY_ID": 38,
28                "ENTITY_NAME": "Edward Kusha",
29                "RECORD_SUMMARY": [
30                    {
31                        "DATA_SOURCE": "CUSTOMERS",
32                        "RECORD_COUNT": 1
33                    }
34                ]
35            }
36        }
37    ]
38}
get_active_config_id() int[source]

The get_active_config_id method returns the identifier of the currently active Senzing engine configuration.

Returns:

The identifier of the active Senzing Engine configuration.

Return type:

int

Raises:

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_engine = sz_abstract_factory.create_engine()
18    result = sz_engine.get_active_config_id()
19    print(f"\n{result}\n")
20except SzError as err:
21    print(f"\nERROR: {err}\n")

Output:

14030462317
get_entity_by_entity_id(entity_id: int, flags: int = <SzEngineFlags.SZ_ENTITY_DEFAULT_FLAGS: 3734464>) str[source]

The get_entity_by_entity_id method returns entity data based on the ID of a resolved identity.

Parameters:
  • entity_id (int) – The unique identifier of an entity.

  • flags (int, optional) – Flags used to control information returned. Defaults to SzEngineFlags.SZ_ENTITY_DEFAULT_FLAGS.

Returns:

A JSON document.

Return type:

str

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5entity_id = 1
 6flags = SzEngineFlags.SZ_ENTITY_DEFAULT_FLAGS
 7instance_name = "Example"
 8settings = {
 9    "PIPELINE": {
10        "CONFIGPATH": "/etc/opt/senzing",
11        "RESOURCEPATH": "/opt/senzing/er/resources",
12        "SUPPORTPATH": "/opt/senzing/data",
13    },
14    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
15}
16
17try:
18    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
19    sz_engine = sz_abstract_factory.create_engine()
20    result = sz_engine.get_entity_by_entity_id(entity_id, flags)
21    print(f"\n{result}\n")
22except SzError as err:
23    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4    "RESOLVED_ENTITY": {
 5        "ENTITY_ID": 1,
 6        "ENTITY_NAME": "",
 7        "FEATURES": {},
 8        "RECORD_SUMMARY": [
 9            {
10                "DATA_SOURCE": "TEST",
11                "RECORD_COUNT": 1
12            }
13        ],
14        "RECORDS": [
15            {
16                "DATA_SOURCE": "TEST",
17                "RECORD_ID": "2",
18                "INTERNAL_ID": 1,
19                "MATCH_KEY": "",
20                "MATCH_LEVEL_CODE": "",
21                "ERRULE_CODE": "",
22                "FIRST_SEEN_DT": "YYYY-MM-DDThh:mm:ssZ",
23                "LAST_SEEN_DT": "YYYY-MM-DDThh:mm:ssZ"
24            }
25        ]
26    },
27    "RELATED_ENTITIES": []
28}
get_entity_by_record_id(data_source_code: str, record_id: str, flags: int = <SzEngineFlags.SZ_ENTITY_DEFAULT_FLAGS: 3734464>) str[source]

The get_entity_by_record_id method returns entity data based on the ID of a record which is a member of the entity.

Parameters:
  • data_source_code (str) – Identifies the provenance of the data.

  • record_id (str) – The unique identifier within the records of the same data source.

  • flags (int, optional) – Flags used to control information returned. Defaults to SzEngineFlags.SZ_ENTITY_DEFAULT_FLAGS.

Returns:

A JSON document.

Return type:

str

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5data_source_code = "CUSTOMERS"
 6flags = SzEngineFlags.SZ_ENTITY_DEFAULT_FLAGS
 7instance_name = "Example"
 8settings = {
 9    "PIPELINE": {
10        "CONFIGPATH": "/etc/opt/senzing",
11        "RESOURCEPATH": "/opt/senzing/er/resources",
12        "SUPPORTPATH": "/opt/senzing/data",
13    },
14    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
15}
16record_id = "1001"
17
18try:
19    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
20    sz_engine = sz_abstract_factory.create_engine()
21    result = sz_engine.get_entity_by_record_id(data_source_code, record_id, flags)
22    print(f"\n{result}\n")
23except SzError as err:
24    print(f"\nERROR: {err}\n")

Output:

  1// Output has been formatted for easier reading.
  2
  3{
  4    "RESOLVED_ENTITY": {
  5        "ENTITY_ID": 35,
  6        "ENTITY_NAME": "Robert Smith",
  7        "FEATURES": {
  8            "ADDRESS": [
  9                {
 10                    "FEAT_DESC": "1515 Adela Lane Las Vegas NV 89111",
 11                    "LIB_FEAT_ID": 22,
 12                    "USAGE_TYPE": "HOME",
 13                    "FEAT_DESC_VALUES": [
 14                        {
 15                            "FEAT_DESC": "1515 Adela Lane Las Vegas NV 89111",
 16                            "LIB_FEAT_ID": 22
 17                        }
 18                    ]
 19                },
 20                {
 21                    "FEAT_DESC": "123 Main Street, Las Vegas NV 89132",
 22                    "LIB_FEAT_ID": 3,
 23                    "USAGE_TYPE": "MAILING",
 24                    "FEAT_DESC_VALUES": [
 25                        {
 26                            "FEAT_DESC": "123 Main Street, Las Vegas NV 89132",
 27                            "LIB_FEAT_ID": 3
 28                        }
 29                    ]
 30                }
 31            ],
 32            "DOB": [
 33                {
 34                    "FEAT_DESC": "12/11/1978",
 35                    "LIB_FEAT_ID": 2,
 36                    "FEAT_DESC_VALUES": [
 37                        {
 38                            "FEAT_DESC": "12/11/1978",
 39                            "LIB_FEAT_ID": 2
 40                        },
 41                        {
 42                            "FEAT_DESC": "11/12/1978",
 43                            "LIB_FEAT_ID": 21
 44                        }
 45                    ]
 46                }
 47            ],
 48            "EMAIL": [
 49                {
 50                    "FEAT_DESC": "bsmith@work.com",
 51                    "LIB_FEAT_ID": 5,
 52                    "FEAT_DESC_VALUES": [
 53                        {
 54                            "FEAT_DESC": "bsmith@work.com",
 55                            "LIB_FEAT_ID": 5
 56                        }
 57                    ]
 58                }
 59            ],
 60            "NAME": [
 61                {
 62                    "FEAT_DESC": "Robert Smith",
 63                    "LIB_FEAT_ID": 1,
 64                    "USAGE_TYPE": "PRIMARY",
 65                    "FEAT_DESC_VALUES": [
 66                        {
 67                            "FEAT_DESC": "Robert Smith",
 68                            "LIB_FEAT_ID": 1
 69                        },
 70                        {
 71                            "FEAT_DESC": "Bob J Smith",
 72                            "LIB_FEAT_ID": 38
 73                        },
 74                        {
 75                            "FEAT_DESC": "Bob Smith",
 76                            "LIB_FEAT_ID": 20
 77                        }
 78                    ]
 79                }
 80            ],
 81            "PHONE": [
 82                {
 83                    "FEAT_DESC": "702-919-1300",
 84                    "LIB_FEAT_ID": 4,
 85                    "USAGE_TYPE": "HOME",
 86                    "FEAT_DESC_VALUES": [
 87                        {
 88                            "FEAT_DESC": "702-919-1300",
 89                            "LIB_FEAT_ID": 4
 90                        }
 91                    ]
 92                },
 93                {
 94                    "FEAT_DESC": "702-919-1300",
 95                    "LIB_FEAT_ID": 4,
 96                    "USAGE_TYPE": "MOBILE",
 97                    "FEAT_DESC_VALUES": [
 98                        {
 99                            "FEAT_DESC": "702-919-1300",
100                            "LIB_FEAT_ID": 4
101                        }
102                    ]
103                }
104            ],
105            "RECORD_TYPE": [
106                {
107                    "FEAT_DESC": "PERSON",
108                    "LIB_FEAT_ID": 10,
109                    "FEAT_DESC_VALUES": [
110                        {
111                            "FEAT_DESC": "PERSON",
112                            "LIB_FEAT_ID": 10
113                        }
114                    ]
115                }
116            ]
117        },
118        "RECORD_SUMMARY": [
119            {
120                "DATA_SOURCE": "CUSTOMERS",
121                "RECORD_COUNT": 3
122            }
123        ],
124        "RECORDS": [
125            {
126                "DATA_SOURCE": "CUSTOMERS",
127                "RECORD_ID": "1001",
128                "INTERNAL_ID": 35,
129                "MATCH_KEY": "",
130                "MATCH_LEVEL_CODE": "",
131                "ERRULE_CODE": "",
132                "FIRST_SEEN_DT": "2024-10-25T17:39:00Z",
133                "LAST_SEEN_DT": "2024-10-25T17:39:00Z"
134            },
135            {
136                "DATA_SOURCE": "CUSTOMERS",
137                "RECORD_ID": "1002",
138                "INTERNAL_ID": 36,
139                "MATCH_KEY": "+NAME+DOB+PHONE",
140                "MATCH_LEVEL_CODE": "RESOLVED",
141                "ERRULE_CODE": "CNAME_CFF_CEXCL",
142                "FIRST_SEEN_DT": "2024-10-25T17:39:00Z",
143                "LAST_SEEN_DT": "2024-10-25T17:39:00Z"
144            },
145            {
146                "DATA_SOURCE": "CUSTOMERS",
147                "RECORD_ID": "1003",
148                "INTERNAL_ID": 37,
149                "MATCH_KEY": "+NAME+DOB+EMAIL",
150                "MATCH_LEVEL_CODE": "RESOLVED",
151                "ERRULE_CODE": "SF1_PNAME_CSTAB",
152                "FIRST_SEEN_DT": "2024-10-25T17:39:00Z",
153                "LAST_SEEN_DT": "2024-10-25T17:39:00Z"
154            }
155        ]
156    },
157    "RELATED_ENTITIES": []
158}
get_record(data_source_code: str, record_id: str, flags: int = <SzEngineFlags.SZ_ENTITY_INCLUDE_RECORD_JSON_DATA: 65536>) str[source]

The get_record method returns a JSON document of a single record from the Senzing repository. Can be called as many times as desired and from multiple threads at the same time.

Parameters:
  • data_source_code (str) – Identifies the provenance of the data.

  • record_id (str) – The unique identifier within the records of the same data source.

  • flags (int, optional) – Flags used to control information returned. Defaults to SzEngineFlags.SZ_RECORD_DEFAULT_FLAGS.

Returns:

A JSON document of a single record.

Return type:

str

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5data_source_code = "CUSTOMERS"
 6flags = SzEngineFlags.SZ_RECORD_DEFAULT_FLAGS
 7instance_name = "Example"
 8record_id = "1001"
 9settings = {
10    "PIPELINE": {
11        "CONFIGPATH": "/etc/opt/senzing",
12        "RESOURCEPATH": "/opt/senzing/er/resources",
13        "SUPPORTPATH": "/opt/senzing/data",
14    },
15    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
16}
17
18
19try:
20    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
21    sz_engine = sz_abstract_factory.create_engine()
22    result = sz_engine.get_record(data_source_code, record_id, flags)
23    print(f"\n{result}\n")
24except SzError as err:
25    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4    "DATA_SOURCE": "CUSTOMERS",
 5    "RECORD_ID": "1001",
 6    "JSON_DATA": {
 7        "DATA_SOURCE": "CUSTOMERS",
 8        "RECORD_ID": "1001",
 9        "RECORD_TYPE": "PERSON",
10        "PRIMARY_NAME_LAST": "Smith",
11        "PRIMARY_NAME_FIRST": "Robert",
12        "DATE_OF_BIRTH": "12/11/1978",
13        "ADDR_TYPE": "MAILING",
14        "ADDR_LINE1": "123 Main Street, Las Vegas NV 89132",
15        "PHONE_TYPE": "HOME",
16        "PHONE_NUMBER": "702-919-1300",
17        "EMAIL_ADDRESS": "bsmith@work.com",
18        "DATE": "1/2/18",
19        "STATUS": "Active",
20        "AMOUNT": "100"
21    }
22}
get_redo_record() str[source]

The get_redo_record method returns the next internally queued redo record from the Senzing repository. The process_redo_record method is called to process the redo record retrieved by get_redo_record.

Returns:

A JSON document.

Return type:

str

Raises:

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_engine = sz_abstract_factory.create_engine()
18    result = sz_engine.get_redo_record()
19    print(f"\n{result}\n")
20except SzError as err:
21    print(f"\nERROR: {err}\n")

Output:

1// Output has been formatted for easier reading.
2
3{
4    "REASON": "deferred delete",
5    "DATA_SOURCE": "CUSTOMERS",
6    "RECORD_ID": "1001",
7    "DSRC_ACTION": "X"
8}
get_stats() str[source]

The get_stats method retrieves workload statistics for the current process. These statistics will automatically reset after retrieval.

Returns:

A JSON document.

Return type:

str

Raises:

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_engine = sz_abstract_factory.create_engine()
18    result = sz_engine.get_stats()
19    print(f"\n{result}\n")
20except SzError as err:
21    print(f"\nERROR: {err}\n")

Output:

  1// Output has been formatted for easier reading.
  2
  3{
  4    "workload": {
  5        "apiVersion": "4.0.0.24289",
  6        "loadedRecords": 6,
  7        "addedRecords": 20,
  8        "bulkAddedRecords": 0,
  9        "optimizedOut": 3,
 10        "optimizedOutSkipped": 6,
 11        "newObsEnt": 18,
 12        "obsEntHashSame": 4,
 13        "obsEntHashDiff": 1,
 14        "partiallyResolved": 0,
 15        "deletedRecords": 15,
 16        "changeDeletes": 4,
 17        "reevaluations": 4,
 18        "repairedEntities": 6,
 19        "duration": 96,
 20        "retries": 0,
 21        "candidates": 11,
 22        "actualAmbiguousTest": 0,
 23        "cachedAmbiguousTest": 0,
 24        "libFeatCacheHit": 706,
 25        "libFeatCacheMiss": 589,
 26        "resFeatStatCacheHit": 6211,
 27        "resFeatStatCacheMiss": 1052,
 28        "libFeatInsert": 28,
 29        "resFeatStatInsert": 28,
 30        "resFeatStatUpdateAttempt": 522,
 31        "resFeatStatUpdateFail": 0,
 32        "unresolveTest": 4,
 33        "abortedUnresolve": 0,
 34        "lockWaits": {
 35            "maxRefreshLocksMS": 0,
 36            "totalRefreshLocksMS": 0,
 37            "countRefreshLocks": 0
 38        },
 39        "unresolveTriggers": {
 40            "normalResolve": 0,
 41            "update": 0,
 42            "relLink": 0,
 43            "extensiveResolve": 4,
 44            "ambiguousNoResolve": 0,
 45            "ambiguousMultiResolve": 0
 46        },
 47        "reresolveTriggers": {
 48            "abortRetry": 0,
 49            "unresolveMovement": 0,
 50            "multipleResolvableCandidates": 0,
 51            "resolveNewFeatures": 7,
 52            "newFeatureFTypes": [
 53                {
 54                    "ADDRESS": 5
 55                },
 56                {
 57                    "ADDR_KEY": 5
 58                },
 59                {
 60                    "DOB": 5
 61                },
 62                {
 63                    "NAME": 7
 64                },
 65                {
 66                    "NAMEADDR_KEY": 5
 67                },
 68                {
 69                    "NAMEDATE_KEY": 7
 70                },
 71                {
 72                    "NAMEPHONE_KEY": 5
 73                },
 74                {
 75                    "NAMEREGION_KEY": 5
 76                },
 77                {
 78                    "NAME_KEY": 7
 79                },
 80                {
 81                    "PHONE": 5
 82                }
 83            ]
 84        },
 85        "reresolveSkipped": 1,
 86        "filteredObsFeat": 0,
 87        "expressedFeatureCalls": [
 88            {
 89                "EFCALL_ID": 1,
 90                "EFUNC_CODE": "PHONE_HASHER",
 91                "numCalls": 20
 92            },
 93            {
 94                "EFCALL_ID": 7,
 95                "EFUNC_CODE": "NAME_HASHER",
 96                "numCalls": 45
 97            },
 98            {
 99                "EFCALL_ID": 9,
100                "EFUNC_CODE": "ADDR_HASHER",
101                "numCalls": 21
102            },
103            {
104                "EFCALL_ID": 10,
105                "EFUNC_CODE": "EXPRESS_BOM",
106                "numCalls": 1
107            },
108            {
109                "EFCALL_ID": 16,
110                "EFUNC_CODE": "EXPRESS_ID",
111                "numCalls": 1
112            },
113            {
114                "EFCALL_ID": 34,
115                "EFUNC_CODE": "FEAT_BUILDER",
116                "numCalls": 19
117            },
118            {
119                "EFCALL_ID": 92,
120                "EFUNC_CODE": "NAME_HASHER",
121                "numCalls": 21
122            },
123            {
124                "EFCALL_ID": 94,
125                "EFUNC_CODE": "NAME_HASHER",
126                "numCalls": 45
127            },
128            {
129                "EFCALL_ID": 95,
130                "EFUNC_CODE": "NAME_HASHER",
131                "numCalls": 2
132            },
133            {
134                "EFCALL_ID": 96,
135                "EFUNC_CODE": "NAME_HASHER",
136                "numCalls": 45
137            },
138            {
139                "EFCALL_ID": 97,
140                "EFUNC_CODE": "NAME_HASHER",
141                "numCalls": 45
142            },
143            {
144                "EFCALL_ID": 98,
145                "EFUNC_CODE": "NAME_HASHER",
146                "numCalls": 45
147            }
148        ],
149        "expressedFeaturesCreated": [
150            {
151                "ADDR_KEY": 42
152            },
153            {
154                "EMAIL_KEY": 19
155            },
156            {
157                "ID_KEY": 1
158            },
159            {
160                "NAMEADDR_KEY": 54
161            },
162            {
163                "NAMEDATE_KEY": 99
164            },
165            {
166                "NAMEID_KEY": 2
167            },
168            {
169                "NAMEPHONE_KEY": 25
170            },
171            {
172                "NAMEREGION_KEY": 54
173            },
174            {
175                "NAME_KEY": 35
176            },
177            {
178                "PHONE_KEY": 20
179            },
180            {
181                "SEARCH_KEY": 1
182            }
183        ],
184        "scoredPairs": [
185            {
186                "ADDRESS": 8
187            },
188            {
189                "DOB": 18
190            },
191            {
192                "EMAIL": 5
193            },
194            {
195                "NAME": 29
196            },
197            {
198                "PHONE": 9
199            },
200            {
201                "RECORD_TYPE": 10
202            }
203        ],
204        "cacheHit": [
205            {
206                "DOB": 1
207            },
208            {
209                "NAME": 3
210            }
211        ],
212        "cacheMiss": [
213            {
214                "ADDRESS": 8
215            },
216            {
217                "DOB": 17
218            },
219            {
220                "EMAIL": 5
221            },
222            {
223                "NAME": 26
224            },
225            {
226                "PHONE": 9
227            }
228        ],
229        "redoTriggers": [
230            {
231                "DEFERRED_DELETE": 6
232            }
233        ],
234        "latchContention": [],
235        "highContentionFeat": [],
236        "highContentionResEnt": [],
237        "genericDetect": [],
238        "candidateBuilders": [
239            {
240                "ADDR_KEY": 34
241            },
242            {
243                "DOB": 36
244            },
245            {
246                "EMAIL_KEY": 32
247            },
248            {
249                "ID_KEY": 1
250            },
251            {
252                "NAMEADDR_KEY": 34
253            },
254            {
255                "NAMEDATE_KEY": 36
256            },
257            {
258                "NAMEID_KEY": 1
259            },
260            {
261                "NAMEPHONE_KEY": 33
262            },
263            {
264                "NAMEREGION_KEY": 34
265            },
266            {
267                "NAME_KEY": 37
268            },
269            {
270                "PHONE_KEY": 33
271            },
272            {
273                "SEARCH_KEY": 1
274            },
275            {
276                "SSN": 1
277            }
278        ],
279        "suppressedCandidateBuilders": [],
280        "suppressedScoredFeatureType": [],
281        "suppressedCandidateBuildersForReresolve": [],
282        "suppressedScoredFeatureTypeForReresolve": [],
283        "suppressedDisclosedRelationshipDomainCount": 0,
284        "corruptEntityTestDiagnosis": {
285            "corruptionTypes": 0
286        },
287        "threadState": {
288            "active": 0,
289            "idle": 8,
290            "governorContention": 0,
291            "sqlExecuting": 0,
292            "loader": 0,
293            "resolver": 0,
294            "scoring": 0,
295            "dataLatchContention": 0,
296            "obsEntContention": 0,
297            "resEntContention": 0
298        },
299        "systemResources": {
300            "initResources": [
301                {
302                    "physicalCores": 16
303                },
304                {
305                    "logicalCores": 16
306                },
307                {
308                    "totalMemory": "62.6GB"
309                },
310                {
311                    "availableMemory": "52.7GB"
312                }
313            ],
314            "currResources": [
315                {
316                    "availableMemory": "48.5GB"
317                },
318                {
319                    "activeThreads": 0
320                },
321                {
322                    "workerThreads": 8
323                },
324                {
325                    "systemLoad": [
326                        {
327                            "cpuUser": 5.160142
328                        },
329                        {
330                            "cpuSystem": 3.932384
331                        },
332                        {
333                            "cpuIdle": 90.800713
334                        },
335                        {
336                            "cpuWait": 0.071174
337                        },
338                        {
339                            "cpuSoftIrq": 0.035587
340                        }
341                    ]
342                }
343            ]
344        }
345    }
346}
get_virtual_entity_by_record_id(record_keys: ~typing.List[~typing.Tuple[str, str]], flags: int = <SzEngineFlags.SZ_ENTITY_CORE_FLAGS: 63488>) str[source]

The get_virtual_entity_by_record_id method creates 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.

Parameters:
  • record_keys (list(tuple(str, str))) – The data source codes and record IDs identifying records to create the virtual entity from.

  • flags (int, optional) – Flags used to control information returned. Defaults to SzEngineFlags.SZ_HOW_ENTITY_DEFAULT_FLAGS.

Returns:

A JSON document.

Return type:

str

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5flags = SzEngineFlags.SZ_VIRTUAL_ENTITY_DEFAULT_FLAGS
 6instance_name = "Example"
 7record_list = [
 8    ("CUSTOMERS", "1001"),
 9    ("CUSTOMERS", "1002"),
10]
11settings = {
12    "PIPELINE": {
13        "CONFIGPATH": "/etc/opt/senzing",
14        "RESOURCEPATH": "/opt/senzing/er/resources",
15        "SUPPORTPATH": "/opt/senzing/data",
16    },
17    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
18}
19
20try:
21    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
22    sz_engine = sz_abstract_factory.create_engine()
23    result = sz_engine.get_virtual_entity_by_record_id(record_list, flags)
24    print(f"\n{result}\n")
25except SzError as err:
26    print(f"\nERROR: {err}\n")

Output:

  1// Output has been formatted for easier reading.
  2
  3{
  4    "RESOLVED_ENTITY": {
  5        "ENTITY_ID": 35,
  6        "ENTITY_NAME": "Robert Smith",
  7        "FEATURES": {
  8            "ADDRESS": [
  9                {
 10                    "FEAT_DESC": "1515 Adela Lane Las Vegas NV 89111",
 11                    "LIB_FEAT_ID": 22,
 12                    "USAGE_TYPE": "HOME",
 13                    "FEAT_DESC_VALUES": [
 14                        {
 15                            "FEAT_DESC": "1515 Adela Lane Las Vegas NV 89111",
 16                            "LIB_FEAT_ID": 22
 17                        }
 18                    ]
 19                },
 20                {
 21                    "FEAT_DESC": "123 Main Street, Las Vegas NV 89132",
 22                    "LIB_FEAT_ID": 3,
 23                    "USAGE_TYPE": "MAILING",
 24                    "FEAT_DESC_VALUES": [
 25                        {
 26                            "FEAT_DESC": "123 Main Street, Las Vegas NV 89132",
 27                            "LIB_FEAT_ID": 3
 28                        }
 29                    ]
 30                }
 31            ],
 32            "DOB": [
 33                {
 34                    "FEAT_DESC": "12/11/1978",
 35                    "LIB_FEAT_ID": 2,
 36                    "FEAT_DESC_VALUES": [
 37                        {
 38                            "FEAT_DESC": "12/11/1978",
 39                            "LIB_FEAT_ID": 2
 40                        },
 41                        {
 42                            "FEAT_DESC": "11/12/1978",
 43                            "LIB_FEAT_ID": 21
 44                        }
 45                    ]
 46                }
 47            ],
 48            "EMAIL": [
 49                {
 50                    "FEAT_DESC": "bsmith@work.com",
 51                    "LIB_FEAT_ID": 5,
 52                    "FEAT_DESC_VALUES": [
 53                        {
 54                            "FEAT_DESC": "bsmith@work.com",
 55                            "LIB_FEAT_ID": 5
 56                        }
 57                    ]
 58                }
 59            ],
 60            "NAME": [
 61                {
 62                    "FEAT_DESC": "Robert Smith",
 63                    "LIB_FEAT_ID": 1,
 64                    "USAGE_TYPE": "PRIMARY",
 65                    "FEAT_DESC_VALUES": [
 66                        {
 67                            "FEAT_DESC": "Robert Smith",
 68                            "LIB_FEAT_ID": 1
 69                        },
 70                        {
 71                            "FEAT_DESC": "Bob Smith",
 72                            "LIB_FEAT_ID": 20
 73                        }
 74                    ]
 75                }
 76            ],
 77            "PHONE": [
 78                {
 79                    "FEAT_DESC": "702-919-1300",
 80                    "LIB_FEAT_ID": 4,
 81                    "USAGE_TYPE": "HOME",
 82                    "FEAT_DESC_VALUES": [
 83                        {
 84                            "FEAT_DESC": "702-919-1300",
 85                            "LIB_FEAT_ID": 4
 86                        }
 87                    ]
 88                },
 89                {
 90                    "FEAT_DESC": "702-919-1300",
 91                    "LIB_FEAT_ID": 4,
 92                    "USAGE_TYPE": "MOBILE",
 93                    "FEAT_DESC_VALUES": [
 94                        {
 95                            "FEAT_DESC": "702-919-1300",
 96                            "LIB_FEAT_ID": 4
 97                        }
 98                    ]
 99                }
100            ],
101            "RECORD_TYPE": [
102                {
103                    "FEAT_DESC": "PERSON",
104                    "LIB_FEAT_ID": 10,
105                    "FEAT_DESC_VALUES": [
106                        {
107                            "FEAT_DESC": "PERSON",
108                            "LIB_FEAT_ID": 10
109                        }
110                    ]
111                }
112            ]
113        },
114        "RECORD_SUMMARY": [
115            {
116                "DATA_SOURCE": "CUSTOMERS",
117                "RECORD_COUNT": 2
118            }
119        ],
120        "RECORDS": [
121            {
122                "DATA_SOURCE": "CUSTOMERS",
123                "RECORD_ID": "1001",
124                "INTERNAL_ID": 35,
125                "FIRST_SEEN_DT": "2024-10-25T17:39:00Z",
126                "LAST_SEEN_DT": "2024-10-25T17:39:00Z"
127            },
128            {
129                "DATA_SOURCE": "CUSTOMERS",
130                "RECORD_ID": "1002",
131                "INTERNAL_ID": 36,
132                "FIRST_SEEN_DT": "2024-10-25T17:39:00Z",
133                "LAST_SEEN_DT": "2024-10-25T17:39:00Z"
134            }
135        ]
136    }
137}
help(method_name: str = '') str

Return the help for a particular message.

Parameters:

method_name (str) – The name of the method. (e.g. “init”). If empty, a list of methods and descriptions is returned.

Returns:

The Help information about the requested method

Return type:

str

how_entity_by_entity_id(entity_id: int, flags: int = <SzEngineFlags.SZ_INCLUDE_FEATURE_SCORES: 67108864>) str[source]

The how_entity_by_entity_id method determines and details steps-by-step how records resolved to a single entity.

In most cases, how provides more detailed information than why as the resolution is detailed step-by-step.

Parameters:
  • entity_id (int) – The unique identifier of an entity.

  • flags (int, optional) – Flags used to control information returned. Defaults to SzEngineFlags.SZ_HOW_ENTITY_DEFAULT_FLAGS.

Returns:

A JSON document.

Return type:

str

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5entity_id = 1
 6flags = SzEngineFlags.SZ_HOW_ENTITY_DEFAULT_FLAGS
 7instance_name = "Example"
 8settings = {
 9    "PIPELINE": {
10        "CONFIGPATH": "/etc/opt/senzing",
11        "RESOURCEPATH": "/opt/senzing/er/resources",
12        "SUPPORTPATH": "/opt/senzing/data",
13    },
14    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
15}
16
17try:
18    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
19    sz_engine = sz_abstract_factory.create_engine()
20    result = sz_engine.how_entity_by_entity_id(entity_id, flags)
21    print(f"\n{result}\n")
22except SzError as err:
23    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4    "HOW_RESULTS": {
 5        "RESOLUTION_STEPS": [],
 6        "FINAL_STATE": {
 7            "NEED_REEVALUATION": 0,
 8            "VIRTUAL_ENTITIES": [
 9                {
10                    "VIRTUAL_ENTITY_ID": "V1",
11                    "MEMBER_RECORDS": [
12                        {
13                            "INTERNAL_ID": 1,
14                            "RECORDS": [
15                                {
16                                    "DATA_SOURCE": "TEST",
17                                    "RECORD_ID": "2"
18                                }
19                            ]
20                        }
21                    ]
22                }
23            ]
24        }
25    }
26}
initialize(instance_name: str, settings: str | Dict[Any, Any], config_id: int = 0, verbose_logging: int = 0) None[source]

Initialize the C-based Senzing SzEngine.

Parameters:
  • instance_name (str) – A name to distinguish this instance of the SzEngine.

  • settings (Union[str, Dict[Any, Any]]) – A JSON document defining runtime configuration.

  • verbose_logging (int, optional) – Send debug statements to STDOUT. Defaults to 0.

preprocess_record(record_definition: str, flags: int = <SzEngineFlags.SZ_ENTITY_INCLUDE_RECORD_JSON_DATA: 65536>) str[source]

The preprocess_record method tests adding a record into the Senzing datastore.

Parameters:
  • record_definition (str) – A JSON document containing the record to be tested.

  • flags (int, optional) – Flags used to control information returned. Defaults to 0.

Returns:

A JSON document containing metadata as specified by the flags.

Return type:

str

Raises:

Example:
 1import json
 2
 3from senzing import SzEngineFlags, SzError
 4
 5from senzing_core import SzAbstractFactoryCore
 6
 7instance_name = "Example"
 8flags = SzEngineFlags.SZ_RECORD_DEFAULT_FLAGS
 9record_definition = json.dumps(
10    {
11        "RECORD_TYPE": "PERSON",
12        "PRIMARY_NAME_LAST": "Smith",
13        "PRIMARY_NAME_FIRST": "Robert",
14        "DATE_OF_BIRTH": "12/11/1978",
15        "ADDR_TYPE": "MAILING",
16        "ADDR_LINE1": "123 Main Street, Las Vegas NV 89132",
17        "PHONE_TYPE": "HOME",
18        "PHONE_NUMBER": "702-919-1300",
19        "EMAIL_ADDRESS": "bsmith@work.com",
20        "DATE": "1/2/18",
21        "STATUS": "Active",
22        "AMOUNT": "100",
23    }
24)
25settings = {
26    "PIPELINE": {
27        "CONFIGPATH": "/etc/opt/senzing",
28        "RESOURCEPATH": "/opt/senzing/er/resources",
29        "SUPPORTPATH": "/opt/senzing/data",
30    },
31    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
32}
33
34try:
35    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
36    sz_engine = sz_abstract_factory.create_engine()
37    result = sz_engine.preprocess_record(record_definition, flags)
38    print(f"\n{result}\n")
39except SzError as err:
40    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4    "JSON_DATA": {
 5        "RECORD_TYPE": "PERSON",
 6        "PRIMARY_NAME_LAST": "Smith",
 7        "PRIMARY_NAME_FIRST": "Robert",
 8        "DATE_OF_BIRTH": "12/11/1978",
 9        "ADDR_TYPE": "MAILING",
10        "ADDR_LINE1": "123 Main Street, Las Vegas NV 89132",
11        "PHONE_TYPE": "HOME",
12        "PHONE_NUMBER": "702-919-1300",
13        "EMAIL_ADDRESS": "bsmith@work.com",
14        "DATE": "1/2/18",
15        "STATUS": "Active",
16        "AMOUNT": "100"
17    }
18}
prime_engine() None[source]

The prime_engine method initializes high resource consumption components of Senzing used in some functions. If this call is not made, these resources are initialized the first time they are needed and can cause unusually long processing times the first time a function is called that requires these resources.

Raises:

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_engine = sz_abstract_factory.create_engine()
18    sz_engine.prime_engine()
19except SzError as err:
20    print(f"\nERROR: {err}\n")
process_redo_record(redo_record: str, flags: int = 0) str[source]

The process_redo_record method is called to process the redo record retrieved by get_redo_record.

Parameters:
  • redo_record (str) – A redo record retrieved from get_redo_record.

  • flags (int, optional) – Flags used to control information returned. Defaults to 0.

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5flags = SzEngineFlags.SZ_WITH_INFO
 6instance_name = "Example"
 7settings = {
 8    "PIPELINE": {
 9        "CONFIGPATH": "/etc/opt/senzing",
10        "RESOURCEPATH": "/opt/senzing/er/resources",
11        "SUPPORTPATH": "/opt/senzing/data",
12    },
13    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
14}
15
16try:
17    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
18    sz_engine = sz_abstract_factory.create_engine()
19    while True:
20        redo_record = sz_engine.get_redo_record()
21        if not redo_record:
22            break
23        result = sz_engine.process_redo_record(redo_record, flags)
24        print(result)
25except SzError as err:
26    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4  "DATA_SOURCE": "CUSTOMERS",
 5  "RECORD_ID": "2207",
 6  "AFFECTED_ENTITIES": [
 7    {
 8      "ENTITY_ID": 305
 9    }
10  ],
11  "INTERESTING_ENTITIES": {
12    "ENTITIES": []
13  }
14}
reevaluate_entity(entity_id: int, flags: int = 0) str[source]

The reevaluate_entity method reevaluates the specified entity.

Parameters:
  • entity_id (int) – The unique identifier of an entity.

  • flags (int, optional) – Flags used to control information returned. Defaults to 0.

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5entity_id = 1
 6flags = SzEngineFlags.SZ_WITH_INFO
 7instance_name = "Example"
 8settings = {
 9    "PIPELINE": {
10        "CONFIGPATH": "/etc/opt/senzing",
11        "RESOURCEPATH": "/opt/senzing/er/resources",
12        "SUPPORTPATH": "/opt/senzing/data",
13    },
14    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
15}
16
17try:
18    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
19    sz_engine = sz_abstract_factory.create_engine()
20    result = sz_engine.reevaluate_entity(entity_id, flags)
21    print(f"\n{result}\n")
22except SzError as err:
23    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4    "DATA_SOURCE": "TEST",
 5    "RECORD_ID": "2",
 6    "AFFECTED_ENTITIES": [
 7        {
 8            "ENTITY_ID": 1
 9        }
10    ],
11    "INTERESTING_ENTITIES": {
12        "ENTITIES": []
13    }
14}
reevaluate_record(data_source_code: str, record_id: str, flags: int = 0) str[source]

The reevaluate_record method reevaluates a specific record.

Parameters:
  • data_source_code (str) – Identifies the provenance of the data.

  • record_id (str) – The unique identifier within the records of the same data source.

  • flags (int, optional) – Flags used to control information returned. Defaults to 0.

Returns:

If flags are set to return the WITH_INFO response a JSON document containing the details, otherwise an empty string.

Return type:

str

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5data_source_code = "CUSTOMERS"
 6flags = SzEngineFlags.SZ_WITH_INFO
 7instance_name = "Example"
 8record_id = "1001"
 9settings = {
10    "PIPELINE": {
11        "CONFIGPATH": "/etc/opt/senzing",
12        "RESOURCEPATH": "/opt/senzing/er/resources",
13        "SUPPORTPATH": "/opt/senzing/data",
14    },
15    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
16}
17
18try:
19    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
20    sz_engine = sz_abstract_factory.create_engine()
21    result = sz_engine.reevaluate_record(data_source_code, record_id, flags)
22    print(f"\n{result}\n")
23except SzError as err:
24    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4    "DATA_SOURCE": "CUSTOMERS",
 5    "RECORD_ID": "1001",
 6    "AFFECTED_ENTITIES": [
 7        {
 8            "ENTITY_ID": 35
 9        }
10    ],
11    "INTERESTING_ENTITIES": {
12        "ENTITIES": []
13    }
14}
reinitialize(config_id: int) None[source]

The reinitialize method reinitializes the Senzing object using a specific configuration identifier. A list of available configuration identifiers can be retrieved using szconfigmanager.get_configs.

search_by_attributes(attributes: str, flags: int = <SzEngineFlags.SZ_SEARCH_BY_ATTRIBUTES_ALL: 67123215>, search_profile: str = '') str[source]

The search_by_attributes method retrieves entity data based on a user-specified set of entity attributes.

Parameters:
  • attributes (str) – A JSON document with the attribute data to search for.

  • flags (int, optional) – _description_. Defaults to SzEngineFlags.SZ_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS.

  • search_profile (str) – The name of a configured search profile. Defaults to SEARCH.

Returns:

A JSON document.

Return type:

str

Raises:

Example:
 1import json
 2
 3from senzing import SzEngineFlags, SzError
 4
 5from senzing_core import SzAbstractFactoryCore
 6
 7attributes = json.dumps({"NAME_FULL": "Bob Smith", "EMAIL_ADDRESS": "bsmith@work.com"})
 8flags = SzEngineFlags.SZ_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS
 9instance_name = "Example"
10settings = {
11    "PIPELINE": {
12        "CONFIGPATH": "/etc/opt/senzing",
13        "RESOURCEPATH": "/opt/senzing/er/resources",
14        "SUPPORTPATH": "/opt/senzing/data",
15    },
16    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
17}
18
19try:
20    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
21    sz_engine = sz_abstract_factory.create_engine()
22    result = sz_engine.search_by_attributes(attributes, flags)
23    print(f"\n{result}\n")
24except SzError as err:
25    print(f"\nERROR: {err}\n")

Output:

  1// Output has been formatted for easier reading.
  2{
  3    "RESOLVED_ENTITIES": [
  4        {
  5            "MATCH_INFO": {
  6                "MATCH_LEVEL_CODE": "RESOLVED",
  7                "MATCH_KEY": "+NAME+EMAIL",
  8                "ERRULE_CODE": "SF1_CNAME",
  9                "FEATURE_SCORES": {
 10                    "EMAIL": [
 11                        {
 12                            "INBOUND_FEAT_ID": 5,
 13                            "INBOUND_FEAT_DESC": "bsmith@work.com",
 14                            "INBOUND_FEAT_USAGE_TYPE": "",
 15                            "CANDIDATE_FEAT_ID": 5,
 16                            "CANDIDATE_FEAT_DESC": "bsmith@work.com",
 17                            "CANDIDATE_FEAT_USAGE_TYPE": "",
 18                            "SCORE": 100,
 19                            "ADDITIONAL_SCORES": {
 20                                "FULL_SCORE": 100
 21                            },
 22                            "SCORE_BUCKET": "SAME",
 23                            "SCORE_BEHAVIOR": "F1"
 24                        }
 25                    ],
 26                    "NAME": [
 27                        {
 28                            "INBOUND_FEAT_ID": -2,
 29                            "INBOUND_FEAT_DESC": "BOB SMITH",
 30                            "INBOUND_FEAT_USAGE_TYPE": "",
 31                            "CANDIDATE_FEAT_ID": 38,
 32                            "CANDIDATE_FEAT_DESC": "Bob J Smith",
 33                            "CANDIDATE_FEAT_USAGE_TYPE": "PRIMARY",
 34                            "SCORE": 93,
 35                            "ADDITIONAL_SCORES": {
 36                                "GENERATION_MATCH": -1,
 37                                "GNR_FN": 93,
 38                                "GNR_GN": -1,
 39                                "GNR_ON": -1,
 40                                "GNR_SN": -1
 41                            },
 42                            "SCORE_BUCKET": "CLOSE",
 43                            "SCORE_BEHAVIOR": "NAME"
 44                        },
 45                        {
 46                            "INBOUND_FEAT_ID": -2,
 47                            "INBOUND_FEAT_DESC": "BOB SMITH",
 48                            "INBOUND_FEAT_USAGE_TYPE": "",
 49                            "CANDIDATE_FEAT_ID": 1,
 50                            "CANDIDATE_FEAT_DESC": "Robert Smith",
 51                            "CANDIDATE_FEAT_USAGE_TYPE": "PRIMARY",
 52                            "SCORE": 97,
 53                            "ADDITIONAL_SCORES": {
 54                                "GENERATION_MATCH": -1,
 55                                "GNR_FN": 97,
 56                                "GNR_GN": -1,
 57                                "GNR_ON": -1,
 58                                "GNR_SN": -1
 59                            },
 60                            "SCORE_BUCKET": "CLOSE",
 61                            "SCORE_BEHAVIOR": "NAME"
 62                        }
 63                    ]
 64                }
 65            },
 66            "ENTITY": {
 67                "RESOLVED_ENTITY": {
 68                    "ENTITY_ID": 35,
 69                    "ENTITY_NAME": "Robert Smith",
 70                    "FEATURES": {
 71                        "ADDRESS": [
 72                            {
 73                                "FEAT_DESC": "1515 Adela Lane Las Vegas NV 89111",
 74                                "LIB_FEAT_ID": 22,
 75                                "USAGE_TYPE": "HOME",
 76                                "FEAT_DESC_VALUES": [
 77                                    {
 78                                        "FEAT_DESC": "1515 Adela Lane Las Vegas NV 89111",
 79                                        "LIB_FEAT_ID": 22
 80                                    }
 81                                ]
 82                            },
 83                            {
 84                                "FEAT_DESC": "123 Main Street, Las Vegas NV 89132",
 85                                "LIB_FEAT_ID": 3,
 86                                "USAGE_TYPE": "MAILING",
 87                                "FEAT_DESC_VALUES": [
 88                                    {
 89                                        "FEAT_DESC": "123 Main Street, Las Vegas NV 89132",
 90                                        "LIB_FEAT_ID": 3
 91                                    }
 92                                ]
 93                            }
 94                        ],
 95                        "DOB": [
 96                            {
 97                                "FEAT_DESC": "12/11/1978",
 98                                "LIB_FEAT_ID": 2,
 99                                "FEAT_DESC_VALUES": [
100                                    {
101                                        "FEAT_DESC": "12/11/1978",
102                                        "LIB_FEAT_ID": 2
103                                    },
104                                    {
105                                        "FEAT_DESC": "11/12/1978",
106                                        "LIB_FEAT_ID": 21
107                                    }
108                                ]
109                            }
110                        ],
111                        "EMAIL": [
112                            {
113                                "FEAT_DESC": "bsmith@work.com",
114                                "LIB_FEAT_ID": 5,
115                                "FEAT_DESC_VALUES": [
116                                    {
117                                        "FEAT_DESC": "bsmith@work.com",
118                                        "LIB_FEAT_ID": 5
119                                    }
120                                ]
121                            }
122                        ],
123                        "NAME": [
124                            {
125                                "FEAT_DESC": "Robert Smith",
126                                "LIB_FEAT_ID": 1,
127                                "USAGE_TYPE": "PRIMARY",
128                                "FEAT_DESC_VALUES": [
129                                    {
130                                        "FEAT_DESC": "Robert Smith",
131                                        "LIB_FEAT_ID": 1
132                                    },
133                                    {
134                                        "FEAT_DESC": "Bob J Smith",
135                                        "LIB_FEAT_ID": 38
136                                    },
137                                    {
138                                        "FEAT_DESC": "Bob Smith",
139                                        "LIB_FEAT_ID": 20
140                                    }
141                                ]
142                            }
143                        ],
144                        "PHONE": [
145                            {
146                                "FEAT_DESC": "702-919-1300",
147                                "LIB_FEAT_ID": 4,
148                                "USAGE_TYPE": "HOME",
149                                "FEAT_DESC_VALUES": [
150                                    {
151                                        "FEAT_DESC": "702-919-1300",
152                                        "LIB_FEAT_ID": 4
153                                    }
154                                ]
155                            },
156                            {
157                                "FEAT_DESC": "702-919-1300",
158                                "LIB_FEAT_ID": 4,
159                                "USAGE_TYPE": "MOBILE",
160                                "FEAT_DESC_VALUES": [
161                                    {
162                                        "FEAT_DESC": "702-919-1300",
163                                        "LIB_FEAT_ID": 4
164                                    }
165                                ]
166                            }
167                        ],
168                        "RECORD_TYPE": [
169                            {
170                                "FEAT_DESC": "PERSON",
171                                "LIB_FEAT_ID": 10,
172                                "FEAT_DESC_VALUES": [
173                                    {
174                                        "FEAT_DESC": "PERSON",
175                                        "LIB_FEAT_ID": 10
176                                    }
177                                ]
178                            }
179                        ]
180                    },
181                    "RECORD_SUMMARY": [
182                        {
183                            "DATA_SOURCE": "CUSTOMERS",
184                            "RECORD_COUNT": 3
185                        }
186                    ]
187                }
188            }
189        }
190    ]
191}
why_entities(entity_id_1: int, entity_id_2: int, flags: int = <SzEngineFlags.SZ_WHY_ENTITIES_DEFAULT_FLAGS: 96009152>) str[source]

The why_entities method determines why entities did not resolve or why they do relate.

Parameters:
  • entity_id_1 (int) – The entity ID for the starting entity of the search path.

  • entity_id_2 (int) – The entity ID for the ending entity of the search path.

  • flags (int, optional) – Flags used to control information returned. Defaults to SzEngineFlags.SZ_WHY_ENTITY_DEFAULT_FLAGS.

Returns:

A JSON document.

Return type:

str

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5entity_id_1 = 1
 6entity_id_2 = 4
 7flags = SzEngineFlags.SZ_WHY_ENTITIES_DEFAULT_FLAGS
 8instance_name = "Example"
 9settings = {
10    "PIPELINE": {
11        "CONFIGPATH": "/etc/opt/senzing",
12        "RESOURCEPATH": "/opt/senzing/er/resources",
13        "SUPPORTPATH": "/opt/senzing/data",
14    },
15    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
16}
17
18try:
19    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
20    sz_engine = sz_abstract_factory.create_engine()
21    result = sz_engine.why_entities(
22        entity_id_1,
23        entity_id_2,
24        flags,
25    )
26    print(f"\n{result}\n")
27except SzError as err:
28    print(f"\nERROR: {err}\n")

Output:

  1// Output has been formatted for easier reading.
  2
  3{
  4    "WHY_RESULTS": [
  5        {
  6            "ENTITY_ID": 1,
  7            "ENTITY_ID_2": 35,
  8            "MATCH_INFO": {
  9                "WHY_KEY": "",
 10                "WHY_ERRULE_CODE": "",
 11                "MATCH_LEVEL_CODE": "",
 12                "CANDIDATE_KEYS": {},
 13                "DISCLOSED_RELATIONS": {},
 14                "FEATURE_SCORES": {}
 15            }
 16        }
 17    ],
 18    "ENTITIES": [
 19        {
 20            "RESOLVED_ENTITY": {
 21                "ENTITY_ID": 1,
 22                "ENTITY_NAME": "",
 23                "FEATURES": {},
 24                "RECORD_SUMMARY": [
 25                    {
 26                        "DATA_SOURCE": "TEST",
 27                        "RECORD_COUNT": 1
 28                    }
 29                ],
 30                "RECORDS": [
 31                    {
 32                        "DATA_SOURCE": "TEST",
 33                        "RECORD_ID": "2",
 34                        "INTERNAL_ID": 1,
 35                        "MATCH_KEY": "",
 36                        "MATCH_LEVEL_CODE": "",
 37                        "ERRULE_CODE": "",
 38                        "FIRST_SEEN_DT": "2024-10-25T17:38:57Z",
 39                        "LAST_SEEN_DT": "2024-10-25T17:39:00Z"
 40                    }
 41                ]
 42            },
 43            "RELATED_ENTITIES": []
 44        },
 45        {
 46            "RESOLVED_ENTITY": {
 47                "ENTITY_ID": 35,
 48                "ENTITY_NAME": "Robert Smith",
 49                "FEATURES": {
 50                    "ADDRESS": [
 51                        {
 52                            "FEAT_DESC": "1515 Adela Lane Las Vegas NV 89111",
 53                            "LIB_FEAT_ID": 22,
 54                            "USAGE_TYPE": "HOME",
 55                            "FEAT_DESC_VALUES": [
 56                                {
 57                                    "FEAT_DESC": "1515 Adela Lane Las Vegas NV 89111",
 58                                    "LIB_FEAT_ID": 22,
 59                                    "USED_FOR_CAND": "N",
 60                                    "USED_FOR_SCORING": "Y",
 61                                    "ENTITY_COUNT": 1,
 62                                    "CANDIDATE_CAP_REACHED": "N",
 63                                    "SCORING_CAP_REACHED": "N",
 64                                    "SUPPRESSED": "N"
 65                                }
 66                            ]
 67                        },
 68                        {
 69                            "FEAT_DESC": "123 Main Street, Las Vegas NV 89132",
 70                            "LIB_FEAT_ID": 3,
 71                            "USAGE_TYPE": "MAILING",
 72                            "FEAT_DESC_VALUES": [
 73                                {
 74                                    "FEAT_DESC": "123 Main Street, Las Vegas NV 89132",
 75                                    "LIB_FEAT_ID": 3,
 76                                    "USED_FOR_CAND": "N",
 77                                    "USED_FOR_SCORING": "Y",
 78                                    "ENTITY_COUNT": 1,
 79                                    "CANDIDATE_CAP_REACHED": "N",
 80                                    "SCORING_CAP_REACHED": "N",
 81                                    "SUPPRESSED": "N"
 82                                }
 83                            ]
 84                        }
 85                    ],
 86                    "ADDR_KEY": [
 87                        {
 88                            "FEAT_DESC": "123|MN||89132",
 89                            "LIB_FEAT_ID": 8,
 90                            "FEAT_DESC_VALUES": [
 91                                {
 92                                    "FEAT_DESC": "123|MN||89132",
 93                                    "LIB_FEAT_ID": 8,
 94                                    "USED_FOR_CAND": "Y",
 95                                    "USED_FOR_SCORING": "N",
 96                                    "ENTITY_COUNT": 1,
 97                                    "CANDIDATE_CAP_REACHED": "N",
 98                                    "SCORING_CAP_REACHED": "N",
 99                                    "SUPPRESSED": "N"
100                                }
101                            ]
102                        },
103                        {
104                            "FEAT_DESC": "123|MN||LS FKS",
105                            "LIB_FEAT_ID": 7,
106                            "FEAT_DESC_VALUES": [
107                                {
108                                    "FEAT_DESC": "123|MN||LS FKS",
109                                    "LIB_FEAT_ID": 7,
110                                    "USED_FOR_CAND": "Y",
111                                    "USED_FOR_SCORING": "N",
112                                    "ENTITY_COUNT": 1,
113                                    "CANDIDATE_CAP_REACHED": "N",
114                                    "SCORING_CAP_REACHED": "N",
115                                    "SUPPRESSED": "N"
116                                }
117                            ]
118                        },
119                        {
120                            "FEAT_DESC": "1515|ATL||89111",
121                            "LIB_FEAT_ID": 24,
122                            "FEAT_DESC_VALUES": [
123                                {
124                                    "FEAT_DESC": "1515|ATL||89111",
125                                    "LIB_FEAT_ID": 24,
126                                    "USED_FOR_CAND": "Y",
127                                    "USED_FOR_SCORING": "N",
128                                    "ENTITY_COUNT": 1,
129                                    "CANDIDATE_CAP_REACHED": "N",
130                                    "SCORING_CAP_REACHED": "N",
131                                    "SUPPRESSED": "N"
132                                }
133                            ]
134                        },
135                        {
136                            "FEAT_DESC": "1515|ATL||LS FKS",
137                            "LIB_FEAT_ID": 25,
138                            "FEAT_DESC_VALUES": [
139                                {
140                                    "FEAT_DESC": "1515|ATL||LS FKS",
141                                    "LIB_FEAT_ID": 25,
142                                    "USED_FOR_CAND": "Y",
143                                    "USED_FOR_SCORING": "N",
144                                    "ENTITY_COUNT": 1,
145                                    "CANDIDATE_CAP_REACHED": "N",
146                                    "SCORING_CAP_REACHED": "N",
147                                    "SUPPRESSED": "N"
148                                }
149                            ]
150                        }
151                    ],
152                    "DOB": [
153                        {
154                            "FEAT_DESC": "12/11/1978",
155                            "LIB_FEAT_ID": 2,
156                            "FEAT_DESC_VALUES": [
157                                {
158                                    "FEAT_DESC": "12/11/1978",
159                                    "LIB_FEAT_ID": 2,
160                                    "USED_FOR_CAND": "Y",
161                                    "USED_FOR_SCORING": "Y",
162                                    "ENTITY_COUNT": 1,
163                                    "CANDIDATE_CAP_REACHED": "N",
164                                    "SCORING_CAP_REACHED": "N",
165                                    "SUPPRESSED": "N"
166                                },
167                                {
168                                    "FEAT_DESC": "11/12/1978",
169                                    "LIB_FEAT_ID": 21,
170                                    "USED_FOR_CAND": "Y",
171                                    "USED_FOR_SCORING": "Y",
172                                    "ENTITY_COUNT": 1,
173                                    "CANDIDATE_CAP_REACHED": "N",
174                                    "SCORING_CAP_REACHED": "N",
175                                    "SUPPRESSED": "N"
176                                }
177                            ]
178                        }
179                    ],
180                    "EMAIL": [
181                        {
182                            "FEAT_DESC": "bsmith@work.com",
183                            "LIB_FEAT_ID": 5,
184                            "FEAT_DESC_VALUES": [
185                                {
186                                    "FEAT_DESC": "bsmith@work.com",
187                                    "LIB_FEAT_ID": 5,
188                                    "USED_FOR_CAND": "N",
189                                    "USED_FOR_SCORING": "Y",
190                                    "ENTITY_COUNT": 1,
191                                    "CANDIDATE_CAP_REACHED": "N",
192                                    "SCORING_CAP_REACHED": "N",
193                                    "SUPPRESSED": "N"
194                                }
195                            ]
196                        }
197                    ],
198                    "EMAIL_KEY": [
199                        {
200                            "FEAT_DESC": "bsmith@WORK.COM",
201                            "LIB_FEAT_ID": 11,
202                            "FEAT_DESC_VALUES": [
203                                {
204                                    "FEAT_DESC": "bsmith@WORK.COM",
205                                    "LIB_FEAT_ID": 11,
206                                    "USED_FOR_CAND": "Y",
207                                    "USED_FOR_SCORING": "N",
208                                    "ENTITY_COUNT": 1,
209                                    "CANDIDATE_CAP_REACHED": "N",
210                                    "SCORING_CAP_REACHED": "N",
211                                    "SUPPRESSED": "N"
212                                }
213                            ]
214                        }
215                    ],
216                    "NAME": [
217                        {
218                            "FEAT_DESC": "Robert Smith",
219                            "LIB_FEAT_ID": 1,
220                            "USAGE_TYPE": "PRIMARY",
221                            "FEAT_DESC_VALUES": [
222                                {
223                                    "FEAT_DESC": "Robert Smith",
224                                    "LIB_FEAT_ID": 1,
225                                    "USED_FOR_CAND": "N",
226                                    "USED_FOR_SCORING": "Y",
227                                    "ENTITY_COUNT": 1,
228                                    "CANDIDATE_CAP_REACHED": "N",
229                                    "SCORING_CAP_REACHED": "N",
230                                    "SUPPRESSED": "N"
231                                },
232                                {
233                                    "FEAT_DESC": "Bob J Smith",
234                                    "LIB_FEAT_ID": 38,
235                                    "USED_FOR_CAND": "N",
236                                    "USED_FOR_SCORING": "Y",
237                                    "ENTITY_COUNT": 1,
238                                    "CANDIDATE_CAP_REACHED": "N",
239                                    "SCORING_CAP_REACHED": "N",
240                                    "SUPPRESSED": "N"
241                                },
242                                {
243                                    "FEAT_DESC": "Bob Smith",
244                                    "LIB_FEAT_ID": 20,
245                                    "USED_FOR_CAND": "N",
246                                    "USED_FOR_SCORING": "Y",
247                                    "ENTITY_COUNT": 1,
248                                    "CANDIDATE_CAP_REACHED": "N",
249                                    "SCORING_CAP_REACHED": "N",
250                                    "SUPPRESSED": "Y"
251                                }
252                            ]
253                        }
254                    ],
255                    "NAMEADDR_KEY": [
256                        {
257                            "FEAT_DESC": "PP|SM0|ADDR_KEY.EXPRESSION=1515|ATL||89111",
258                            "LIB_FEAT_ID": 27,
259                            "FEAT_DESC_VALUES": [
260                                {
261                                    "FEAT_DESC": "PP|SM0|ADDR_KEY.EXPRESSION=1515|ATL||89111",
262                                    "LIB_FEAT_ID": 27,
263                                    "USED_FOR_CAND": "Y",
264                                    "USED_FOR_SCORING": "N",
265                                    "ENTITY_COUNT": 1,
266                                    "CANDIDATE_CAP_REACHED": "N",
267                                    "SCORING_CAP_REACHED": "N",
268                                    "SUPPRESSED": "N"
269                                }
270                            ]
271                        },
272                        {
273                            "FEAT_DESC": "PP|SM0|ADDR_KEY.EXPRESSION=1515|ATL||LS FKS",
274                            "LIB_FEAT_ID": 28,
275                            "FEAT_DESC_VALUES": [
276                                {
277                                    "FEAT_DESC": "PP|SM0|ADDR_KEY.EXPRESSION=1515|ATL||LS FKS",
278                                    "LIB_FEAT_ID": 28,
279                                    "USED_FOR_CAND": "Y",
280                                    "USED_FOR_SCORING": "N",
281                                    "ENTITY_COUNT": 1,
282                                    "CANDIDATE_CAP_REACHED": "N",
283                                    "SCORING_CAP_REACHED": "N",
284                                    "SUPPRESSED": "N"
285                                }
286                            ]
287                        },
288                        {
289                            "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=123|MN||89132",
290                            "LIB_FEAT_ID": 12,
291                            "FEAT_DESC_VALUES": [
292                                {
293                                    "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=123|MN||89132",
294                                    "LIB_FEAT_ID": 12,
295                                    "USED_FOR_CAND": "Y",
296                                    "USED_FOR_SCORING": "N",
297                                    "ENTITY_COUNT": 1,
298                                    "CANDIDATE_CAP_REACHED": "N",
299                                    "SCORING_CAP_REACHED": "N",
300                                    "SUPPRESSED": "N"
301                                }
302                            ]
303                        },
304                        {
305                            "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=123|MN||LS FKS",
306                            "LIB_FEAT_ID": 13,
307                            "FEAT_DESC_VALUES": [
308                                {
309                                    "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=123|MN||LS FKS",
310                                    "LIB_FEAT_ID": 13,
311                                    "USED_FOR_CAND": "Y",
312                                    "USED_FOR_SCORING": "N",
313                                    "ENTITY_COUNT": 1,
314                                    "CANDIDATE_CAP_REACHED": "N",
315                                    "SCORING_CAP_REACHED": "N",
316                                    "SUPPRESSED": "N"
317                                }
318                            ]
319                        },
320                        {
321                            "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=1515|ATL||89111",
322                            "LIB_FEAT_ID": 29,
323                            "FEAT_DESC_VALUES": [
324                                {
325                                    "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=1515|ATL||89111",
326                                    "LIB_FEAT_ID": 29,
327                                    "USED_FOR_CAND": "Y",
328                                    "USED_FOR_SCORING": "N",
329                                    "ENTITY_COUNT": 1,
330                                    "CANDIDATE_CAP_REACHED": "N",
331                                    "SCORING_CAP_REACHED": "N",
332                                    "SUPPRESSED": "N"
333                                }
334                            ]
335                        },
336                        {
337                            "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=1515|ATL||LS FKS",
338                            "LIB_FEAT_ID": 26,
339                            "FEAT_DESC_VALUES": [
340                                {
341                                    "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=1515|ATL||LS FKS",
342                                    "LIB_FEAT_ID": 26,
343                                    "USED_FOR_CAND": "Y",
344                                    "USED_FOR_SCORING": "N",
345                                    "ENTITY_COUNT": 1,
346                                    "CANDIDATE_CAP_REACHED": "N",
347                                    "SCORING_CAP_REACHED": "N",
348                                    "SUPPRESSED": "N"
349                                }
350                            ]
351                        }
352                    ],
353                    "NAMEDATE_KEY": [
354                        {
355                            "FEAT_DESC": "J|PP|SM0|DOB.MMDD_HASH=1211",
356                            "LIB_FEAT_ID": 43,
357                            "FEAT_DESC_VALUES": [
358                                {
359                                    "FEAT_DESC": "J|PP|SM0|DOB.MMDD_HASH=1211",
360                                    "LIB_FEAT_ID": 43,
361                                    "USED_FOR_CAND": "Y",
362                                    "USED_FOR_SCORING": "N",
363                                    "ENTITY_COUNT": 1,
364                                    "CANDIDATE_CAP_REACHED": "N",
365                                    "SCORING_CAP_REACHED": "N",
366                                    "SUPPRESSED": "N"
367                                }
368                            ]
369                        },
370                        {
371                            "FEAT_DESC": "J|PP|SM0|DOB.MMYY_HASH=1278",
372                            "LIB_FEAT_ID": 41,
373                            "FEAT_DESC_VALUES": [
374                                {
375                                    "FEAT_DESC": "J|PP|SM0|DOB.MMYY_HASH=1278",
376                                    "LIB_FEAT_ID": 41,
377                                    "USED_FOR_CAND": "Y",
378                                    "USED_FOR_SCORING": "N",
379                                    "ENTITY_COUNT": 1,
380                                    "CANDIDATE_CAP_REACHED": "N",
381                                    "SCORING_CAP_REACHED": "N",
382                                    "SUPPRESSED": "N"
383                                }
384                            ]
385                        },
386                        {
387                            "FEAT_DESC": "J|PP|SM0|DOB=71211",
388                            "LIB_FEAT_ID": 40,
389                            "FEAT_DESC_VALUES": [
390                                {
391                                    "FEAT_DESC": "J|PP|SM0|DOB=71211",
392                                    "LIB_FEAT_ID": 40,
393                                    "USED_FOR_CAND": "Y",
394                                    "USED_FOR_SCORING": "N",
395                                    "ENTITY_COUNT": 1,
396                                    "CANDIDATE_CAP_REACHED": "N",
397                                    "SCORING_CAP_REACHED": "N",
398                                    "SUPPRESSED": "N"
399                                }
400                            ]
401                        },
402                        {
403                            "FEAT_DESC": "PP|SM0|DOB.MMDD_HASH=1211",
404                            "LIB_FEAT_ID": 32,
405                            "FEAT_DESC_VALUES": [
406                                {
407                                    "FEAT_DESC": "PP|SM0|DOB.MMDD_HASH=1211",
408                                    "LIB_FEAT_ID": 32,
409                                    "USED_FOR_CAND": "Y",
410                                    "USED_FOR_SCORING": "N",
411                                    "ENTITY_COUNT": 1,
412                                    "CANDIDATE_CAP_REACHED": "N",
413                                    "SCORING_CAP_REACHED": "N",
414                                    "SUPPRESSED": "N"
415                                }
416                            ]
417                        },
418                        {
419                            "FEAT_DESC": "PP|SM0|DOB.MMYY_HASH=1178",
420                            "LIB_FEAT_ID": 33,
421                            "FEAT_DESC_VALUES": [
422                                {
423                                    "FEAT_DESC": "PP|SM0|DOB.MMYY_HASH=1178",
424                                    "LIB_FEAT_ID": 33,
425                                    "USED_FOR_CAND": "Y",
426                                    "USED_FOR_SCORING": "N",
427                                    "ENTITY_COUNT": 1,
428                                    "CANDIDATE_CAP_REACHED": "N",
429                                    "SCORING_CAP_REACHED": "N",
430                                    "SUPPRESSED": "N"
431                                }
432                            ]
433                        },
434                        {
435                            "FEAT_DESC": "PP|SM0|DOB.MMYY_HASH=1278",
436                            "LIB_FEAT_ID": 42,
437                            "FEAT_DESC_VALUES": [
438                                {
439                                    "FEAT_DESC": "PP|SM0|DOB.MMYY_HASH=1278",
440                                    "LIB_FEAT_ID": 42,
441                                    "USED_FOR_CAND": "Y",
442                                    "USED_FOR_SCORING": "N",
443                                    "ENTITY_COUNT": 1,
444                                    "CANDIDATE_CAP_REACHED": "N",
445                                    "SCORING_CAP_REACHED": "N",
446                                    "SUPPRESSED": "N"
447                                }
448                            ]
449                        },
450                        {
451                            "FEAT_DESC": "PP|SM0|DOB=71211",
452                            "LIB_FEAT_ID": 31,
453                            "FEAT_DESC_VALUES": [
454                                {
455                                    "FEAT_DESC": "PP|SM0|DOB=71211",
456                                    "LIB_FEAT_ID": 31,
457                                    "USED_FOR_CAND": "Y",
458                                    "USED_FOR_SCORING": "N",
459                                    "ENTITY_COUNT": 1,
460                                    "CANDIDATE_CAP_REACHED": "N",
461                                    "SCORING_CAP_REACHED": "N",
462                                    "SUPPRESSED": "N"
463                                }
464                            ]
465                        },
466                        {
467                            "FEAT_DESC": "RPRT|SM0|DOB.MMDD_HASH=1211",
468                            "LIB_FEAT_ID": 14,
469                            "FEAT_DESC_VALUES": [
470                                {
471                                    "FEAT_DESC": "RPRT|SM0|DOB.MMDD_HASH=1211",
472                                    "LIB_FEAT_ID": 14,
473                                    "USED_FOR_CAND": "Y",
474                                    "USED_FOR_SCORING": "N",
475                                    "ENTITY_COUNT": 1,
476                                    "CANDIDATE_CAP_REACHED": "N",
477                                    "SCORING_CAP_REACHED": "N",
478                                    "SUPPRESSED": "N"
479                                }
480                            ]
481                        },
482                        {
483                            "FEAT_DESC": "RPRT|SM0|DOB.MMYY_HASH=1178",
484                            "LIB_FEAT_ID": 30,
485                            "FEAT_DESC_VALUES": [
486                                {
487                                    "FEAT_DESC": "RPRT|SM0|DOB.MMYY_HASH=1178",
488                                    "LIB_FEAT_ID": 30,
489                                    "USED_FOR_CAND": "Y",
490                                    "USED_FOR_SCORING": "N",
491                                    "ENTITY_COUNT": 1,
492                                    "CANDIDATE_CAP_REACHED": "N",
493                                    "SCORING_CAP_REACHED": "N",
494                                    "SUPPRESSED": "N"
495                                }
496                            ]
497                        },
498                        {
499                            "FEAT_DESC": "RPRT|SM0|DOB.MMYY_HASH=1278",
500                            "LIB_FEAT_ID": 16,
501                            "FEAT_DESC_VALUES": [
502                                {
503                                    "FEAT_DESC": "RPRT|SM0|DOB.MMYY_HASH=1278",
504                                    "LIB_FEAT_ID": 16,
505                                    "USED_FOR_CAND": "Y",
506                                    "USED_FOR_SCORING": "N",
507                                    "ENTITY_COUNT": 1,
508                                    "CANDIDATE_CAP_REACHED": "N",
509                                    "SCORING_CAP_REACHED": "N",
510                                    "SUPPRESSED": "N"
511                                }
512                            ]
513                        },
514                        {
515                            "FEAT_DESC": "RPRT|SM0|DOB=71211",
516                            "LIB_FEAT_ID": 15,
517                            "FEAT_DESC_VALUES": [
518                                {
519                                    "FEAT_DESC": "RPRT|SM0|DOB=71211",
520                                    "LIB_FEAT_ID": 15,
521                                    "USED_FOR_CAND": "Y",
522                                    "USED_FOR_SCORING": "N",
523                                    "ENTITY_COUNT": 1,
524                                    "CANDIDATE_CAP_REACHED": "N",
525                                    "SCORING_CAP_REACHED": "N",
526                                    "SUPPRESSED": "N"
527                                }
528                            ]
529                        }
530                    ],
531                    "NAMEPHONE_KEY": [
532                        {
533                            "FEAT_DESC": "PP|SM0|PHONE.PHONE_LAST_5=91300",
534                            "LIB_FEAT_ID": 37,
535                            "FEAT_DESC_VALUES": [
536                                {
537                                    "FEAT_DESC": "PP|SM0|PHONE.PHONE_LAST_5=91300",
538                                    "LIB_FEAT_ID": 37,
539                                    "USED_FOR_CAND": "Y",
540                                    "USED_FOR_SCORING": "N",
541                                    "ENTITY_COUNT": 1,
542                                    "CANDIDATE_CAP_REACHED": "N",
543                                    "SCORING_CAP_REACHED": "N",
544                                    "SUPPRESSED": "N"
545                                }
546                            ]
547                        },
548                        {
549                            "FEAT_DESC": "RPRT|SM0|PHONE.PHONE_LAST_5=91300",
550                            "LIB_FEAT_ID": 19,
551                            "FEAT_DESC_VALUES": [
552                                {
553                                    "FEAT_DESC": "RPRT|SM0|PHONE.PHONE_LAST_5=91300",
554                                    "LIB_FEAT_ID": 19,
555                                    "USED_FOR_CAND": "Y",
556                                    "USED_FOR_SCORING": "N",
557                                    "ENTITY_COUNT": 1,
558                                    "CANDIDATE_CAP_REACHED": "N",
559                                    "SCORING_CAP_REACHED": "N",
560                                    "SUPPRESSED": "N"
561                                }
562                            ]
563                        }
564                    ],
565                    "NAMEREGION_KEY": [
566                        {
567                            "FEAT_DESC": "PP|SM0|ADDRESS.CITY_STD=LS FKS",
568                            "LIB_FEAT_ID": 36,
569                            "FEAT_DESC_VALUES": [
570                                {
571                                    "FEAT_DESC": "PP|SM0|ADDRESS.CITY_STD=LS FKS",
572                                    "LIB_FEAT_ID": 36,
573                                    "USED_FOR_CAND": "Y",
574                                    "USED_FOR_SCORING": "N",
575                                    "ENTITY_COUNT": 1,
576                                    "CANDIDATE_CAP_REACHED": "N",
577                                    "SCORING_CAP_REACHED": "N",
578                                    "SUPPRESSED": "N"
579                                }
580                            ]
581                        },
582                        {
583                            "FEAT_DESC": "PP|SM0|POST=89111",
584                            "LIB_FEAT_ID": 35,
585                            "FEAT_DESC_VALUES": [
586                                {
587                                    "FEAT_DESC": "PP|SM0|POST=89111",
588                                    "LIB_FEAT_ID": 35,
589                                    "USED_FOR_CAND": "Y",
590                                    "USED_FOR_SCORING": "N",
591                                    "ENTITY_COUNT": 1,
592                                    "CANDIDATE_CAP_REACHED": "N",
593                                    "SCORING_CAP_REACHED": "N",
594                                    "SUPPRESSED": "N"
595                                }
596                            ]
597                        },
598                        {
599                            "FEAT_DESC": "RPRT|SM0|ADDRESS.CITY_STD=LS FKS",
600                            "LIB_FEAT_ID": 18,
601                            "FEAT_DESC_VALUES": [
602                                {
603                                    "FEAT_DESC": "RPRT|SM0|ADDRESS.CITY_STD=LS FKS",
604                                    "LIB_FEAT_ID": 18,
605                                    "USED_FOR_CAND": "Y",
606                                    "USED_FOR_SCORING": "N",
607                                    "ENTITY_COUNT": 1,
608                                    "CANDIDATE_CAP_REACHED": "N",
609                                    "SCORING_CAP_REACHED": "N",
610                                    "SUPPRESSED": "N"
611                                }
612                            ]
613                        },
614                        {
615                            "FEAT_DESC": "RPRT|SM0|POST=89111",
616                            "LIB_FEAT_ID": 34,
617                            "FEAT_DESC_VALUES": [
618                                {
619                                    "FEAT_DESC": "RPRT|SM0|POST=89111",
620                                    "LIB_FEAT_ID": 34,
621                                    "USED_FOR_CAND": "Y",
622                                    "USED_FOR_SCORING": "N",
623                                    "ENTITY_COUNT": 1,
624                                    "CANDIDATE_CAP_REACHED": "N",
625                                    "SCORING_CAP_REACHED": "N",
626                                    "SUPPRESSED": "N"
627                                }
628                            ]
629                        },
630                        {
631                            "FEAT_DESC": "RPRT|SM0|POST=89132",
632                            "LIB_FEAT_ID": 17,
633                            "FEAT_DESC_VALUES": [
634                                {
635                                    "FEAT_DESC": "RPRT|SM0|POST=89132",
636                                    "LIB_FEAT_ID": 17,
637                                    "USED_FOR_CAND": "Y",
638                                    "USED_FOR_SCORING": "N",
639                                    "ENTITY_COUNT": 1,
640                                    "CANDIDATE_CAP_REACHED": "N",
641                                    "SCORING_CAP_REACHED": "N",
642                                    "SUPPRESSED": "N"
643                                }
644                            ]
645                        }
646                    ],
647                    "NAME_KEY": [
648                        {
649                            "FEAT_DESC": "J|PP|SM0",
650                            "LIB_FEAT_ID": 39,
651                            "FEAT_DESC_VALUES": [
652                                {
653                                    "FEAT_DESC": "J|PP|SM0",
654                                    "LIB_FEAT_ID": 39,
655                                    "USED_FOR_CAND": "Y",
656                                    "USED_FOR_SCORING": "N",
657                                    "ENTITY_COUNT": 1,
658                                    "CANDIDATE_CAP_REACHED": "N",
659                                    "SCORING_CAP_REACHED": "N",
660                                    "SUPPRESSED": "N"
661                                }
662                            ]
663                        },
664                        {
665                            "FEAT_DESC": "PP|SM0",
666                            "LIB_FEAT_ID": 23,
667                            "FEAT_DESC_VALUES": [
668                                {
669                                    "FEAT_DESC": "PP|SM0",
670                                    "LIB_FEAT_ID": 23,
671                                    "USED_FOR_CAND": "Y",
672                                    "USED_FOR_SCORING": "N",
673                                    "ENTITY_COUNT": 1,
674                                    "CANDIDATE_CAP_REACHED": "N",
675                                    "SCORING_CAP_REACHED": "N",
676                                    "SUPPRESSED": "N"
677                                }
678                            ]
679                        },
680                        {
681                            "FEAT_DESC": "RPRT|SM0",
682                            "LIB_FEAT_ID": 6,
683                            "FEAT_DESC_VALUES": [
684                                {
685                                    "FEAT_DESC": "RPRT|SM0",
686                                    "LIB_FEAT_ID": 6,
687                                    "USED_FOR_CAND": "Y",
688                                    "USED_FOR_SCORING": "N",
689                                    "ENTITY_COUNT": 1,
690                                    "CANDIDATE_CAP_REACHED": "N",
691                                    "SCORING_CAP_REACHED": "N",
692                                    "SUPPRESSED": "N"
693                                }
694                            ]
695                        }
696                    ],
697                    "PHONE": [
698                        {
699                            "FEAT_DESC": "702-919-1300",
700                            "LIB_FEAT_ID": 4,
701                            "USAGE_TYPE": "HOME",
702                            "FEAT_DESC_VALUES": [
703                                {
704                                    "FEAT_DESC": "702-919-1300",
705                                    "LIB_FEAT_ID": 4,
706                                    "USED_FOR_CAND": "N",
707                                    "USED_FOR_SCORING": "Y",
708                                    "ENTITY_COUNT": 1,
709                                    "CANDIDATE_CAP_REACHED": "N",
710                                    "SCORING_CAP_REACHED": "N",
711                                    "SUPPRESSED": "N"
712                                }
713                            ]
714                        },
715                        {
716                            "FEAT_DESC": "702-919-1300",
717                            "LIB_FEAT_ID": 4,
718                            "USAGE_TYPE": "MOBILE",
719                            "FEAT_DESC_VALUES": [
720                                {
721                                    "FEAT_DESC": "702-919-1300",
722                                    "LIB_FEAT_ID": 4,
723                                    "USED_FOR_CAND": "N",
724                                    "USED_FOR_SCORING": "Y",
725                                    "ENTITY_COUNT": 1,
726                                    "CANDIDATE_CAP_REACHED": "N",
727                                    "SCORING_CAP_REACHED": "N",
728                                    "SUPPRESSED": "N"
729                                }
730                            ]
731                        }
732                    ],
733                    "PHONE_KEY": [
734                        {
735                            "FEAT_DESC": "7029191300",
736                            "LIB_FEAT_ID": 9,
737                            "FEAT_DESC_VALUES": [
738                                {
739                                    "FEAT_DESC": "7029191300",
740                                    "LIB_FEAT_ID": 9,
741                                    "USED_FOR_CAND": "Y",
742                                    "USED_FOR_SCORING": "N",
743                                    "ENTITY_COUNT": 1,
744                                    "CANDIDATE_CAP_REACHED": "N",
745                                    "SCORING_CAP_REACHED": "N",
746                                    "SUPPRESSED": "N"
747                                }
748                            ]
749                        }
750                    ],
751                    "RECORD_TYPE": [
752                        {
753                            "FEAT_DESC": "PERSON",
754                            "LIB_FEAT_ID": 10,
755                            "FEAT_DESC_VALUES": [
756                                {
757                                    "FEAT_DESC": "PERSON",
758                                    "LIB_FEAT_ID": 10,
759                                    "USED_FOR_CAND": "N",
760                                    "USED_FOR_SCORING": "Y",
761                                    "ENTITY_COUNT": 100,
762                                    "CANDIDATE_CAP_REACHED": "N",
763                                    "SCORING_CAP_REACHED": "N",
764                                    "SUPPRESSED": "N"
765                                }
766                            ]
767                        }
768                    ]
769                },
770                "RECORD_SUMMARY": [
771                    {
772                        "DATA_SOURCE": "CUSTOMERS",
773                        "RECORD_COUNT": 3
774                    }
775                ],
776                "RECORDS": [
777                    {
778                        "DATA_SOURCE": "CUSTOMERS",
779                        "RECORD_ID": "1001",
780                        "INTERNAL_ID": 35,
781                        "MATCH_KEY": "",
782                        "MATCH_LEVEL_CODE": "",
783                        "ERRULE_CODE": "",
784                        "FIRST_SEEN_DT": "2024-10-25T17:39:00Z",
785                        "LAST_SEEN_DT": "2024-10-25T17:39:00Z"
786                    },
787                    {
788                        "DATA_SOURCE": "CUSTOMERS",
789                        "RECORD_ID": "1002",
790                        "INTERNAL_ID": 36,
791                        "MATCH_KEY": "+NAME+DOB+PHONE",
792                        "MATCH_LEVEL_CODE": "RESOLVED",
793                        "ERRULE_CODE": "CNAME_CFF_CEXCL",
794                        "FIRST_SEEN_DT": "2024-10-25T17:39:00Z",
795                        "LAST_SEEN_DT": "2024-10-25T17:39:00Z"
796                    },
797                    {
798                        "DATA_SOURCE": "CUSTOMERS",
799                        "RECORD_ID": "1003",
800                        "INTERNAL_ID": 37,
801                        "MATCH_KEY": "+NAME+DOB+EMAIL",
802                        "MATCH_LEVEL_CODE": "RESOLVED",
803                        "ERRULE_CODE": "SF1_PNAME_CSTAB",
804                        "FIRST_SEEN_DT": "2024-10-25T17:39:00Z",
805                        "LAST_SEEN_DT": "2024-10-25T17:39:00Z"
806                    }
807                ]
808            },
809            "RELATED_ENTITIES": []
810        }
811    ]
812}
why_record_in_entity(data_source_code: str, record_id: str, flags: int = <SzEngineFlags.SZ_WHY_ENTITIES_DEFAULT_FLAGS: 96009152>) str[source]

The why_record_in_entity method determines why a record is included in an entity.

Parameters:
  • data_source_code (str) – Identifies the provenance of the data.

  • record_id (str) – The unique identifier within the records of the same data source.

  • flags (int, optional) – Flags used to control information returned. Defaults to SzEngineFlags.SZ_WHY_ENTITY_DEFAULT_FLAGS.

Returns:

A JSON document.

Return type:

str

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5data_source_code = "CUSTOMERS"
 6flags = SzEngineFlags.SZ_WHY_RECORDS_DEFAULT_FLAGS
 7instance_name = "Example"
 8record_id = "1001"
 9settings = {
10    "PIPELINE": {
11        "CONFIGPATH": "/etc/opt/senzing",
12        "RESOURCEPATH": "/opt/senzing/er/resources",
13        "SUPPORTPATH": "/opt/senzing/data",
14    },
15    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
16}
17
18try:
19    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
20    sz_engine = sz_abstract_factory.create_engine()
21    result = sz_engine.why_record_in_entity(
22        data_source_code,
23        record_id,
24        flags,
25    )
26    print(f"\n{result}\n")
27except SzError as err:
28    print(f"\nERROR: {err}\n")

Output:

  1// Output has been formatted for easier reading.
  2{
  3    "WHY_RESULTS": [
  4        {
  5            "INTERNAL_ID": 35,
  6            "ENTITY_ID": 35,
  7            "FOCUS_RECORDS": [
  8                {
  9                    "DATA_SOURCE": "CUSTOMERS",
 10                    "RECORD_ID": "1001"
 11                }
 12            ],
 13            "MATCH_INFO": {
 14                "WHY_KEY": "+NAME+DOB+PHONE+EMAIL",
 15                "WHY_ERRULE_CODE": "SF1_SNAME_CFF_CSTAB",
 16                "MATCH_LEVEL_CODE": "RESOLVED",
 17                "CANDIDATE_KEYS": {
 18                    "DOB": [
 19                        {
 20                            "FEAT_ID": 2,
 21                            "FEAT_DESC": "12/11/1978"
 22                        }
 23                    ],
 24                    "EMAIL_KEY": [
 25                        {
 26                            "FEAT_ID": 11,
 27                            "FEAT_DESC": "bsmith@WORK.COM"
 28                        }
 29                    ],
 30                    "NAMEDATE_KEY": [
 31                        {
 32                            "FEAT_ID": 14,
 33                            "FEAT_DESC": "RPRT|SM0|DOB.MMDD_HASH=1211"
 34                        },
 35                        {
 36                            "FEAT_ID": 15,
 37                            "FEAT_DESC": "RPRT|SM0|DOB=71211"
 38                        },
 39                        {
 40                            "FEAT_ID": 16,
 41                            "FEAT_DESC": "RPRT|SM0|DOB.MMYY_HASH=1278"
 42                        }
 43                    ],
 44                    "NAMEPHONE_KEY": [
 45                        {
 46                            "FEAT_ID": 19,
 47                            "FEAT_DESC": "RPRT|SM0|PHONE.PHONE_LAST_5=91300"
 48                        }
 49                    ],
 50                    "NAMEREGION_KEY": [
 51                        {
 52                            "FEAT_ID": 18,
 53                            "FEAT_DESC": "RPRT|SM0|ADDRESS.CITY_STD=LS FKS"
 54                        }
 55                    ],
 56                    "NAME_KEY": [
 57                        {
 58                            "FEAT_ID": 6,
 59                            "FEAT_DESC": "RPRT|SM0"
 60                        }
 61                    ],
 62                    "PHONE_KEY": [
 63                        {
 64                            "FEAT_ID": 9,
 65                            "FEAT_DESC": "7029191300"
 66                        }
 67                    ]
 68                },
 69                "FEATURE_SCORES": {
 70                    "ADDRESS": [
 71                        {
 72                            "INBOUND_FEAT_ID": 3,
 73                            "INBOUND_FEAT_DESC": "123 Main Street, Las Vegas NV 89132",
 74                            "INBOUND_FEAT_USAGE_TYPE": "MAILING",
 75                            "CANDIDATE_FEAT_ID": 22,
 76                            "CANDIDATE_FEAT_DESC": "1515 Adela Lane Las Vegas NV 89111",
 77                            "CANDIDATE_FEAT_USAGE_TYPE": "HOME",
 78                            "SCORE": 42,
 79                            "ADDITIONAL_SCORES": {
 80                                "FULL_SCORE": 42
 81                            },
 82                            "SCORE_BUCKET": "NO_CHANCE",
 83                            "SCORE_BEHAVIOR": "FF"
 84                        }
 85                    ],
 86                    "DOB": [
 87                        {
 88                            "INBOUND_FEAT_ID": 2,
 89                            "INBOUND_FEAT_DESC": "12/11/1978",
 90                            "INBOUND_FEAT_USAGE_TYPE": "",
 91                            "CANDIDATE_FEAT_ID": 2,
 92                            "CANDIDATE_FEAT_DESC": "12/11/1978",
 93                            "CANDIDATE_FEAT_USAGE_TYPE": "",
 94                            "SCORE": 100,
 95                            "ADDITIONAL_SCORES": {
 96                                "FULL_SCORE": 100
 97                            },
 98                            "SCORE_BUCKET": "SAME",
 99                            "SCORE_BEHAVIOR": "FMES"
100                        }
101                    ],
102                    "EMAIL": [
103                        {
104                            "INBOUND_FEAT_ID": 5,
105                            "INBOUND_FEAT_DESC": "bsmith@work.com",
106                            "INBOUND_FEAT_USAGE_TYPE": "",
107                            "CANDIDATE_FEAT_ID": 5,
108                            "CANDIDATE_FEAT_DESC": "bsmith@work.com",
109                            "CANDIDATE_FEAT_USAGE_TYPE": "",
110                            "SCORE": 100,
111                            "ADDITIONAL_SCORES": {
112                                "FULL_SCORE": 100
113                            },
114                            "SCORE_BUCKET": "SAME",
115                            "SCORE_BEHAVIOR": "F1"
116                        }
117                    ],
118                    "NAME": [
119                        {
120                            "INBOUND_FEAT_ID": 1,
121                            "INBOUND_FEAT_DESC": "Robert Smith",
122                            "INBOUND_FEAT_USAGE_TYPE": "PRIMARY",
123                            "CANDIDATE_FEAT_ID": 38,
124                            "CANDIDATE_FEAT_DESC": "Bob J Smith",
125                            "CANDIDATE_FEAT_USAGE_TYPE": "PRIMARY",
126                            "SCORE": 90,
127                            "ADDITIONAL_SCORES": {
128                                "GENERATION_MATCH": -1,
129                                "GNR_FN": 90,
130                                "GNR_GN": 88,
131                                "GNR_ON": -1,
132                                "GNR_SN": 100
133                            },
134                            "SCORE_BUCKET": "CLOSE",
135                            "SCORE_BEHAVIOR": "NAME"
136                        },
137                        {
138                            "INBOUND_FEAT_ID": 1,
139                            "INBOUND_FEAT_DESC": "Robert Smith",
140                            "INBOUND_FEAT_USAGE_TYPE": "PRIMARY",
141                            "CANDIDATE_FEAT_ID": 20,
142                            "CANDIDATE_FEAT_DESC": "Bob Smith",
143                            "CANDIDATE_FEAT_USAGE_TYPE": "PRIMARY",
144                            "SCORE": 97,
145                            "ADDITIONAL_SCORES": {
146                                "GENERATION_MATCH": -1,
147                                "GNR_FN": 97,
148                                "GNR_GN": 95,
149                                "GNR_ON": -1,
150                                "GNR_SN": 100
151                            },
152                            "SCORE_BUCKET": "CLOSE",
153                            "SCORE_BEHAVIOR": "NAME"
154                        }
155                    ],
156                    "PHONE": [
157                        {
158                            "INBOUND_FEAT_ID": 4,
159                            "INBOUND_FEAT_DESC": "702-919-1300",
160                            "INBOUND_FEAT_USAGE_TYPE": "HOME",
161                            "CANDIDATE_FEAT_ID": 4,
162                            "CANDIDATE_FEAT_DESC": "702-919-1300",
163                            "CANDIDATE_FEAT_USAGE_TYPE": "MOBILE",
164                            "SCORE": 100,
165                            "ADDITIONAL_SCORES": {
166                                "FULL_SCORE": 100
167                            },
168                            "SCORE_BUCKET": "SAME",
169                            "SCORE_BEHAVIOR": "FF"
170                        }
171                    ],
172                    "RECORD_TYPE": [
173                        {
174                            "INBOUND_FEAT_ID": 10,
175                            "INBOUND_FEAT_DESC": "PERSON",
176                            "INBOUND_FEAT_USAGE_TYPE": "",
177                            "CANDIDATE_FEAT_ID": 10,
178                            "CANDIDATE_FEAT_DESC": "PERSON",
179                            "CANDIDATE_FEAT_USAGE_TYPE": "",
180                            "SCORE": 100,
181                            "ADDITIONAL_SCORES": {
182                                "FULL_SCORE": 100
183                            },
184                            "SCORE_BUCKET": "SAME",
185                            "SCORE_BEHAVIOR": "FVME"
186                        }
187                    ]
188                }
189            }
190        }
191    ],
192    "ENTITIES": [
193        {
194            "RESOLVED_ENTITY": {
195                "ENTITY_ID": 35,
196                "ENTITY_NAME": "Robert Smith",
197                "FEATURES": {
198                    "ADDRESS": [
199                        {
200                            "FEAT_DESC": "1515 Adela Lane Las Vegas NV 89111",
201                            "LIB_FEAT_ID": 22,
202                            "USAGE_TYPE": "HOME",
203                            "FEAT_DESC_VALUES": [
204                                {
205                                    "FEAT_DESC": "1515 Adela Lane Las Vegas NV 89111",
206                                    "LIB_FEAT_ID": 22,
207                                    "USED_FOR_CAND": "N",
208                                    "USED_FOR_SCORING": "Y",
209                                    "ENTITY_COUNT": 1,
210                                    "CANDIDATE_CAP_REACHED": "N",
211                                    "SCORING_CAP_REACHED": "N",
212                                    "SUPPRESSED": "N"
213                                }
214                            ]
215                        },
216                        {
217                            "FEAT_DESC": "123 Main Street, Las Vegas NV 89132",
218                            "LIB_FEAT_ID": 3,
219                            "USAGE_TYPE": "MAILING",
220                            "FEAT_DESC_VALUES": [
221                                {
222                                    "FEAT_DESC": "123 Main Street, Las Vegas NV 89132",
223                                    "LIB_FEAT_ID": 3,
224                                    "USED_FOR_CAND": "N",
225                                    "USED_FOR_SCORING": "Y",
226                                    "ENTITY_COUNT": 1,
227                                    "CANDIDATE_CAP_REACHED": "N",
228                                    "SCORING_CAP_REACHED": "N",
229                                    "SUPPRESSED": "N"
230                                }
231                            ]
232                        }
233                    ],
234                    "ADDR_KEY": [
235                        {
236                            "FEAT_DESC": "123|MN||89132",
237                            "LIB_FEAT_ID": 8,
238                            "FEAT_DESC_VALUES": [
239                                {
240                                    "FEAT_DESC": "123|MN||89132",
241                                    "LIB_FEAT_ID": 8,
242                                    "USED_FOR_CAND": "Y",
243                                    "USED_FOR_SCORING": "N",
244                                    "ENTITY_COUNT": 1,
245                                    "CANDIDATE_CAP_REACHED": "N",
246                                    "SCORING_CAP_REACHED": "N",
247                                    "SUPPRESSED": "N"
248                                }
249                            ]
250                        },
251                        {
252                            "FEAT_DESC": "123|MN||LS FKS",
253                            "LIB_FEAT_ID": 7,
254                            "FEAT_DESC_VALUES": [
255                                {
256                                    "FEAT_DESC": "123|MN||LS FKS",
257                                    "LIB_FEAT_ID": 7,
258                                    "USED_FOR_CAND": "Y",
259                                    "USED_FOR_SCORING": "N",
260                                    "ENTITY_COUNT": 1,
261                                    "CANDIDATE_CAP_REACHED": "N",
262                                    "SCORING_CAP_REACHED": "N",
263                                    "SUPPRESSED": "N"
264                                }
265                            ]
266                        },
267                        {
268                            "FEAT_DESC": "1515|ATL||89111",
269                            "LIB_FEAT_ID": 24,
270                            "FEAT_DESC_VALUES": [
271                                {
272                                    "FEAT_DESC": "1515|ATL||89111",
273                                    "LIB_FEAT_ID": 24,
274                                    "USED_FOR_CAND": "Y",
275                                    "USED_FOR_SCORING": "N",
276                                    "ENTITY_COUNT": 1,
277                                    "CANDIDATE_CAP_REACHED": "N",
278                                    "SCORING_CAP_REACHED": "N",
279                                    "SUPPRESSED": "N"
280                                }
281                            ]
282                        },
283                        {
284                            "FEAT_DESC": "1515|ATL||LS FKS",
285                            "LIB_FEAT_ID": 25,
286                            "FEAT_DESC_VALUES": [
287                                {
288                                    "FEAT_DESC": "1515|ATL||LS FKS",
289                                    "LIB_FEAT_ID": 25,
290                                    "USED_FOR_CAND": "Y",
291                                    "USED_FOR_SCORING": "N",
292                                    "ENTITY_COUNT": 1,
293                                    "CANDIDATE_CAP_REACHED": "N",
294                                    "SCORING_CAP_REACHED": "N",
295                                    "SUPPRESSED": "N"
296                                }
297                            ]
298                        }
299                    ],
300                    "DOB": [
301                        {
302                            "FEAT_DESC": "12/11/1978",
303                            "LIB_FEAT_ID": 2,
304                            "FEAT_DESC_VALUES": [
305                                {
306                                    "FEAT_DESC": "12/11/1978",
307                                    "LIB_FEAT_ID": 2,
308                                    "USED_FOR_CAND": "Y",
309                                    "USED_FOR_SCORING": "Y",
310                                    "ENTITY_COUNT": 1,
311                                    "CANDIDATE_CAP_REACHED": "N",
312                                    "SCORING_CAP_REACHED": "N",
313                                    "SUPPRESSED": "N"
314                                },
315                                {
316                                    "FEAT_DESC": "11/12/1978",
317                                    "LIB_FEAT_ID": 21,
318                                    "USED_FOR_CAND": "Y",
319                                    "USED_FOR_SCORING": "Y",
320                                    "ENTITY_COUNT": 1,
321                                    "CANDIDATE_CAP_REACHED": "N",
322                                    "SCORING_CAP_REACHED": "N",
323                                    "SUPPRESSED": "N"
324                                }
325                            ]
326                        }
327                    ],
328                    "EMAIL": [
329                        {
330                            "FEAT_DESC": "bsmith@work.com",
331                            "LIB_FEAT_ID": 5,
332                            "FEAT_DESC_VALUES": [
333                                {
334                                    "FEAT_DESC": "bsmith@work.com",
335                                    "LIB_FEAT_ID": 5,
336                                    "USED_FOR_CAND": "N",
337                                    "USED_FOR_SCORING": "Y",
338                                    "ENTITY_COUNT": 1,
339                                    "CANDIDATE_CAP_REACHED": "N",
340                                    "SCORING_CAP_REACHED": "N",
341                                    "SUPPRESSED": "N"
342                                }
343                            ]
344                        }
345                    ],
346                    "EMAIL_KEY": [
347                        {
348                            "FEAT_DESC": "bsmith@WORK.COM",
349                            "LIB_FEAT_ID": 11,
350                            "FEAT_DESC_VALUES": [
351                                {
352                                    "FEAT_DESC": "bsmith@WORK.COM",
353                                    "LIB_FEAT_ID": 11,
354                                    "USED_FOR_CAND": "Y",
355                                    "USED_FOR_SCORING": "N",
356                                    "ENTITY_COUNT": 1,
357                                    "CANDIDATE_CAP_REACHED": "N",
358                                    "SCORING_CAP_REACHED": "N",
359                                    "SUPPRESSED": "N"
360                                }
361                            ]
362                        }
363                    ],
364                    "NAME": [
365                        {
366                            "FEAT_DESC": "Robert Smith",
367                            "LIB_FEAT_ID": 1,
368                            "USAGE_TYPE": "PRIMARY",
369                            "FEAT_DESC_VALUES": [
370                                {
371                                    "FEAT_DESC": "Robert Smith",
372                                    "LIB_FEAT_ID": 1,
373                                    "USED_FOR_CAND": "N",
374                                    "USED_FOR_SCORING": "Y",
375                                    "ENTITY_COUNT": 1,
376                                    "CANDIDATE_CAP_REACHED": "N",
377                                    "SCORING_CAP_REACHED": "N",
378                                    "SUPPRESSED": "N"
379                                },
380                                {
381                                    "FEAT_DESC": "Bob J Smith",
382                                    "LIB_FEAT_ID": 38,
383                                    "USED_FOR_CAND": "N",
384                                    "USED_FOR_SCORING": "Y",
385                                    "ENTITY_COUNT": 1,
386                                    "CANDIDATE_CAP_REACHED": "N",
387                                    "SCORING_CAP_REACHED": "N",
388                                    "SUPPRESSED": "N"
389                                },
390                                {
391                                    "FEAT_DESC": "Bob Smith",
392                                    "LIB_FEAT_ID": 20,
393                                    "USED_FOR_CAND": "N",
394                                    "USED_FOR_SCORING": "Y",
395                                    "ENTITY_COUNT": 1,
396                                    "CANDIDATE_CAP_REACHED": "N",
397                                    "SCORING_CAP_REACHED": "N",
398                                    "SUPPRESSED": "Y"
399                                }
400                            ]
401                        }
402                    ],
403                    "NAMEADDR_KEY": [
404                        {
405                            "FEAT_DESC": "PP|SM0|ADDR_KEY.EXPRESSION=1515|ATL||89111",
406                            "LIB_FEAT_ID": 27,
407                            "FEAT_DESC_VALUES": [
408                                {
409                                    "FEAT_DESC": "PP|SM0|ADDR_KEY.EXPRESSION=1515|ATL||89111",
410                                    "LIB_FEAT_ID": 27,
411                                    "USED_FOR_CAND": "Y",
412                                    "USED_FOR_SCORING": "N",
413                                    "ENTITY_COUNT": 1,
414                                    "CANDIDATE_CAP_REACHED": "N",
415                                    "SCORING_CAP_REACHED": "N",
416                                    "SUPPRESSED": "N"
417                                }
418                            ]
419                        },
420                        {
421                            "FEAT_DESC": "PP|SM0|ADDR_KEY.EXPRESSION=1515|ATL||LS FKS",
422                            "LIB_FEAT_ID": 28,
423                            "FEAT_DESC_VALUES": [
424                                {
425                                    "FEAT_DESC": "PP|SM0|ADDR_KEY.EXPRESSION=1515|ATL||LS FKS",
426                                    "LIB_FEAT_ID": 28,
427                                    "USED_FOR_CAND": "Y",
428                                    "USED_FOR_SCORING": "N",
429                                    "ENTITY_COUNT": 1,
430                                    "CANDIDATE_CAP_REACHED": "N",
431                                    "SCORING_CAP_REACHED": "N",
432                                    "SUPPRESSED": "N"
433                                }
434                            ]
435                        },
436                        {
437                            "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=123|MN||89132",
438                            "LIB_FEAT_ID": 12,
439                            "FEAT_DESC_VALUES": [
440                                {
441                                    "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=123|MN||89132",
442                                    "LIB_FEAT_ID": 12,
443                                    "USED_FOR_CAND": "Y",
444                                    "USED_FOR_SCORING": "N",
445                                    "ENTITY_COUNT": 1,
446                                    "CANDIDATE_CAP_REACHED": "N",
447                                    "SCORING_CAP_REACHED": "N",
448                                    "SUPPRESSED": "N"
449                                }
450                            ]
451                        },
452                        {
453                            "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=123|MN||LS FKS",
454                            "LIB_FEAT_ID": 13,
455                            "FEAT_DESC_VALUES": [
456                                {
457                                    "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=123|MN||LS FKS",
458                                    "LIB_FEAT_ID": 13,
459                                    "USED_FOR_CAND": "Y",
460                                    "USED_FOR_SCORING": "N",
461                                    "ENTITY_COUNT": 1,
462                                    "CANDIDATE_CAP_REACHED": "N",
463                                    "SCORING_CAP_REACHED": "N",
464                                    "SUPPRESSED": "N"
465                                }
466                            ]
467                        },
468                        {
469                            "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=1515|ATL||89111",
470                            "LIB_FEAT_ID": 29,
471                            "FEAT_DESC_VALUES": [
472                                {
473                                    "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=1515|ATL||89111",
474                                    "LIB_FEAT_ID": 29,
475                                    "USED_FOR_CAND": "Y",
476                                    "USED_FOR_SCORING": "N",
477                                    "ENTITY_COUNT": 1,
478                                    "CANDIDATE_CAP_REACHED": "N",
479                                    "SCORING_CAP_REACHED": "N",
480                                    "SUPPRESSED": "N"
481                                }
482                            ]
483                        },
484                        {
485                            "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=1515|ATL||LS FKS",
486                            "LIB_FEAT_ID": 26,
487                            "FEAT_DESC_VALUES": [
488                                {
489                                    "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=1515|ATL||LS FKS",
490                                    "LIB_FEAT_ID": 26,
491                                    "USED_FOR_CAND": "Y",
492                                    "USED_FOR_SCORING": "N",
493                                    "ENTITY_COUNT": 1,
494                                    "CANDIDATE_CAP_REACHED": "N",
495                                    "SCORING_CAP_REACHED": "N",
496                                    "SUPPRESSED": "N"
497                                }
498                            ]
499                        }
500                    ],
501                    "NAMEDATE_KEY": [
502                        {
503                            "FEAT_DESC": "J|PP|SM0|DOB.MMDD_HASH=1211",
504                            "LIB_FEAT_ID": 43,
505                            "FEAT_DESC_VALUES": [
506                                {
507                                    "FEAT_DESC": "J|PP|SM0|DOB.MMDD_HASH=1211",
508                                    "LIB_FEAT_ID": 43,
509                                    "USED_FOR_CAND": "Y",
510                                    "USED_FOR_SCORING": "N",
511                                    "ENTITY_COUNT": 1,
512                                    "CANDIDATE_CAP_REACHED": "N",
513                                    "SCORING_CAP_REACHED": "N",
514                                    "SUPPRESSED": "N"
515                                }
516                            ]
517                        },
518                        {
519                            "FEAT_DESC": "J|PP|SM0|DOB.MMYY_HASH=1278",
520                            "LIB_FEAT_ID": 41,
521                            "FEAT_DESC_VALUES": [
522                                {
523                                    "FEAT_DESC": "J|PP|SM0|DOB.MMYY_HASH=1278",
524                                    "LIB_FEAT_ID": 41,
525                                    "USED_FOR_CAND": "Y",
526                                    "USED_FOR_SCORING": "N",
527                                    "ENTITY_COUNT": 1,
528                                    "CANDIDATE_CAP_REACHED": "N",
529                                    "SCORING_CAP_REACHED": "N",
530                                    "SUPPRESSED": "N"
531                                }
532                            ]
533                        },
534                        {
535                            "FEAT_DESC": "J|PP|SM0|DOB=71211",
536                            "LIB_FEAT_ID": 40,
537                            "FEAT_DESC_VALUES": [
538                                {
539                                    "FEAT_DESC": "J|PP|SM0|DOB=71211",
540                                    "LIB_FEAT_ID": 40,
541                                    "USED_FOR_CAND": "Y",
542                                    "USED_FOR_SCORING": "N",
543                                    "ENTITY_COUNT": 1,
544                                    "CANDIDATE_CAP_REACHED": "N",
545                                    "SCORING_CAP_REACHED": "N",
546                                    "SUPPRESSED": "N"
547                                }
548                            ]
549                        },
550                        {
551                            "FEAT_DESC": "PP|SM0|DOB.MMDD_HASH=1211",
552                            "LIB_FEAT_ID": 32,
553                            "FEAT_DESC_VALUES": [
554                                {
555                                    "FEAT_DESC": "PP|SM0|DOB.MMDD_HASH=1211",
556                                    "LIB_FEAT_ID": 32,
557                                    "USED_FOR_CAND": "Y",
558                                    "USED_FOR_SCORING": "N",
559                                    "ENTITY_COUNT": 1,
560                                    "CANDIDATE_CAP_REACHED": "N",
561                                    "SCORING_CAP_REACHED": "N",
562                                    "SUPPRESSED": "N"
563                                }
564                            ]
565                        },
566                        {
567                            "FEAT_DESC": "PP|SM0|DOB.MMYY_HASH=1178",
568                            "LIB_FEAT_ID": 33,
569                            "FEAT_DESC_VALUES": [
570                                {
571                                    "FEAT_DESC": "PP|SM0|DOB.MMYY_HASH=1178",
572                                    "LIB_FEAT_ID": 33,
573                                    "USED_FOR_CAND": "Y",
574                                    "USED_FOR_SCORING": "N",
575                                    "ENTITY_COUNT": 1,
576                                    "CANDIDATE_CAP_REACHED": "N",
577                                    "SCORING_CAP_REACHED": "N",
578                                    "SUPPRESSED": "N"
579                                }
580                            ]
581                        },
582                        {
583                            "FEAT_DESC": "PP|SM0|DOB.MMYY_HASH=1278",
584                            "LIB_FEAT_ID": 42,
585                            "FEAT_DESC_VALUES": [
586                                {
587                                    "FEAT_DESC": "PP|SM0|DOB.MMYY_HASH=1278",
588                                    "LIB_FEAT_ID": 42,
589                                    "USED_FOR_CAND": "Y",
590                                    "USED_FOR_SCORING": "N",
591                                    "ENTITY_COUNT": 1,
592                                    "CANDIDATE_CAP_REACHED": "N",
593                                    "SCORING_CAP_REACHED": "N",
594                                    "SUPPRESSED": "N"
595                                }
596                            ]
597                        },
598                        {
599                            "FEAT_DESC": "PP|SM0|DOB=71211",
600                            "LIB_FEAT_ID": 31,
601                            "FEAT_DESC_VALUES": [
602                                {
603                                    "FEAT_DESC": "PP|SM0|DOB=71211",
604                                    "LIB_FEAT_ID": 31,
605                                    "USED_FOR_CAND": "Y",
606                                    "USED_FOR_SCORING": "N",
607                                    "ENTITY_COUNT": 1,
608                                    "CANDIDATE_CAP_REACHED": "N",
609                                    "SCORING_CAP_REACHED": "N",
610                                    "SUPPRESSED": "N"
611                                }
612                            ]
613                        },
614                        {
615                            "FEAT_DESC": "RPRT|SM0|DOB.MMDD_HASH=1211",
616                            "LIB_FEAT_ID": 14,
617                            "FEAT_DESC_VALUES": [
618                                {
619                                    "FEAT_DESC": "RPRT|SM0|DOB.MMDD_HASH=1211",
620                                    "LIB_FEAT_ID": 14,
621                                    "USED_FOR_CAND": "Y",
622                                    "USED_FOR_SCORING": "N",
623                                    "ENTITY_COUNT": 1,
624                                    "CANDIDATE_CAP_REACHED": "N",
625                                    "SCORING_CAP_REACHED": "N",
626                                    "SUPPRESSED": "N"
627                                }
628                            ]
629                        },
630                        {
631                            "FEAT_DESC": "RPRT|SM0|DOB.MMYY_HASH=1178",
632                            "LIB_FEAT_ID": 30,
633                            "FEAT_DESC_VALUES": [
634                                {
635                                    "FEAT_DESC": "RPRT|SM0|DOB.MMYY_HASH=1178",
636                                    "LIB_FEAT_ID": 30,
637                                    "USED_FOR_CAND": "Y",
638                                    "USED_FOR_SCORING": "N",
639                                    "ENTITY_COUNT": 1,
640                                    "CANDIDATE_CAP_REACHED": "N",
641                                    "SCORING_CAP_REACHED": "N",
642                                    "SUPPRESSED": "N"
643                                }
644                            ]
645                        },
646                        {
647                            "FEAT_DESC": "RPRT|SM0|DOB.MMYY_HASH=1278",
648                            "LIB_FEAT_ID": 16,
649                            "FEAT_DESC_VALUES": [
650                                {
651                                    "FEAT_DESC": "RPRT|SM0|DOB.MMYY_HASH=1278",
652                                    "LIB_FEAT_ID": 16,
653                                    "USED_FOR_CAND": "Y",
654                                    "USED_FOR_SCORING": "N",
655                                    "ENTITY_COUNT": 1,
656                                    "CANDIDATE_CAP_REACHED": "N",
657                                    "SCORING_CAP_REACHED": "N",
658                                    "SUPPRESSED": "N"
659                                }
660                            ]
661                        },
662                        {
663                            "FEAT_DESC": "RPRT|SM0|DOB=71211",
664                            "LIB_FEAT_ID": 15,
665                            "FEAT_DESC_VALUES": [
666                                {
667                                    "FEAT_DESC": "RPRT|SM0|DOB=71211",
668                                    "LIB_FEAT_ID": 15,
669                                    "USED_FOR_CAND": "Y",
670                                    "USED_FOR_SCORING": "N",
671                                    "ENTITY_COUNT": 1,
672                                    "CANDIDATE_CAP_REACHED": "N",
673                                    "SCORING_CAP_REACHED": "N",
674                                    "SUPPRESSED": "N"
675                                }
676                            ]
677                        }
678                    ],
679                    "NAMEPHONE_KEY": [
680                        {
681                            "FEAT_DESC": "PP|SM0|PHONE.PHONE_LAST_5=91300",
682                            "LIB_FEAT_ID": 37,
683                            "FEAT_DESC_VALUES": [
684                                {
685                                    "FEAT_DESC": "PP|SM0|PHONE.PHONE_LAST_5=91300",
686                                    "LIB_FEAT_ID": 37,
687                                    "USED_FOR_CAND": "Y",
688                                    "USED_FOR_SCORING": "N",
689                                    "ENTITY_COUNT": 1,
690                                    "CANDIDATE_CAP_REACHED": "N",
691                                    "SCORING_CAP_REACHED": "N",
692                                    "SUPPRESSED": "N"
693                                }
694                            ]
695                        },
696                        {
697                            "FEAT_DESC": "RPRT|SM0|PHONE.PHONE_LAST_5=91300",
698                            "LIB_FEAT_ID": 19,
699                            "FEAT_DESC_VALUES": [
700                                {
701                                    "FEAT_DESC": "RPRT|SM0|PHONE.PHONE_LAST_5=91300",
702                                    "LIB_FEAT_ID": 19,
703                                    "USED_FOR_CAND": "Y",
704                                    "USED_FOR_SCORING": "N",
705                                    "ENTITY_COUNT": 1,
706                                    "CANDIDATE_CAP_REACHED": "N",
707                                    "SCORING_CAP_REACHED": "N",
708                                    "SUPPRESSED": "N"
709                                }
710                            ]
711                        }
712                    ],
713                    "NAMEREGION_KEY": [
714                        {
715                            "FEAT_DESC": "PP|SM0|ADDRESS.CITY_STD=LS FKS",
716                            "LIB_FEAT_ID": 36,
717                            "FEAT_DESC_VALUES": [
718                                {
719                                    "FEAT_DESC": "PP|SM0|ADDRESS.CITY_STD=LS FKS",
720                                    "LIB_FEAT_ID": 36,
721                                    "USED_FOR_CAND": "Y",
722                                    "USED_FOR_SCORING": "N",
723                                    "ENTITY_COUNT": 1,
724                                    "CANDIDATE_CAP_REACHED": "N",
725                                    "SCORING_CAP_REACHED": "N",
726                                    "SUPPRESSED": "N"
727                                }
728                            ]
729                        },
730                        {
731                            "FEAT_DESC": "PP|SM0|POST=89111",
732                            "LIB_FEAT_ID": 35,
733                            "FEAT_DESC_VALUES": [
734                                {
735                                    "FEAT_DESC": "PP|SM0|POST=89111",
736                                    "LIB_FEAT_ID": 35,
737                                    "USED_FOR_CAND": "Y",
738                                    "USED_FOR_SCORING": "N",
739                                    "ENTITY_COUNT": 1,
740                                    "CANDIDATE_CAP_REACHED": "N",
741                                    "SCORING_CAP_REACHED": "N",
742                                    "SUPPRESSED": "N"
743                                }
744                            ]
745                        },
746                        {
747                            "FEAT_DESC": "RPRT|SM0|ADDRESS.CITY_STD=LS FKS",
748                            "LIB_FEAT_ID": 18,
749                            "FEAT_DESC_VALUES": [
750                                {
751                                    "FEAT_DESC": "RPRT|SM0|ADDRESS.CITY_STD=LS FKS",
752                                    "LIB_FEAT_ID": 18,
753                                    "USED_FOR_CAND": "Y",
754                                    "USED_FOR_SCORING": "N",
755                                    "ENTITY_COUNT": 1,
756                                    "CANDIDATE_CAP_REACHED": "N",
757                                    "SCORING_CAP_REACHED": "N",
758                                    "SUPPRESSED": "N"
759                                }
760                            ]
761                        },
762                        {
763                            "FEAT_DESC": "RPRT|SM0|POST=89111",
764                            "LIB_FEAT_ID": 34,
765                            "FEAT_DESC_VALUES": [
766                                {
767                                    "FEAT_DESC": "RPRT|SM0|POST=89111",
768                                    "LIB_FEAT_ID": 34,
769                                    "USED_FOR_CAND": "Y",
770                                    "USED_FOR_SCORING": "N",
771                                    "ENTITY_COUNT": 1,
772                                    "CANDIDATE_CAP_REACHED": "N",
773                                    "SCORING_CAP_REACHED": "N",
774                                    "SUPPRESSED": "N"
775                                }
776                            ]
777                        },
778                        {
779                            "FEAT_DESC": "RPRT|SM0|POST=89132",
780                            "LIB_FEAT_ID": 17,
781                            "FEAT_DESC_VALUES": [
782                                {
783                                    "FEAT_DESC": "RPRT|SM0|POST=89132",
784                                    "LIB_FEAT_ID": 17,
785                                    "USED_FOR_CAND": "Y",
786                                    "USED_FOR_SCORING": "N",
787                                    "ENTITY_COUNT": 1,
788                                    "CANDIDATE_CAP_REACHED": "N",
789                                    "SCORING_CAP_REACHED": "N",
790                                    "SUPPRESSED": "N"
791                                }
792                            ]
793                        }
794                    ],
795                    "NAME_KEY": [
796                        {
797                            "FEAT_DESC": "J|PP|SM0",
798                            "LIB_FEAT_ID": 39,
799                            "FEAT_DESC_VALUES": [
800                                {
801                                    "FEAT_DESC": "J|PP|SM0",
802                                    "LIB_FEAT_ID": 39,
803                                    "USED_FOR_CAND": "Y",
804                                    "USED_FOR_SCORING": "N",
805                                    "ENTITY_COUNT": 1,
806                                    "CANDIDATE_CAP_REACHED": "N",
807                                    "SCORING_CAP_REACHED": "N",
808                                    "SUPPRESSED": "N"
809                                }
810                            ]
811                        },
812                        {
813                            "FEAT_DESC": "PP|SM0",
814                            "LIB_FEAT_ID": 23,
815                            "FEAT_DESC_VALUES": [
816                                {
817                                    "FEAT_DESC": "PP|SM0",
818                                    "LIB_FEAT_ID": 23,
819                                    "USED_FOR_CAND": "Y",
820                                    "USED_FOR_SCORING": "N",
821                                    "ENTITY_COUNT": 1,
822                                    "CANDIDATE_CAP_REACHED": "N",
823                                    "SCORING_CAP_REACHED": "N",
824                                    "SUPPRESSED": "N"
825                                }
826                            ]
827                        },
828                        {
829                            "FEAT_DESC": "RPRT|SM0",
830                            "LIB_FEAT_ID": 6,
831                            "FEAT_DESC_VALUES": [
832                                {
833                                    "FEAT_DESC": "RPRT|SM0",
834                                    "LIB_FEAT_ID": 6,
835                                    "USED_FOR_CAND": "Y",
836                                    "USED_FOR_SCORING": "N",
837                                    "ENTITY_COUNT": 1,
838                                    "CANDIDATE_CAP_REACHED": "N",
839                                    "SCORING_CAP_REACHED": "N",
840                                    "SUPPRESSED": "N"
841                                }
842                            ]
843                        }
844                    ],
845                    "PHONE": [
846                        {
847                            "FEAT_DESC": "702-919-1300",
848                            "LIB_FEAT_ID": 4,
849                            "USAGE_TYPE": "HOME",
850                            "FEAT_DESC_VALUES": [
851                                {
852                                    "FEAT_DESC": "702-919-1300",
853                                    "LIB_FEAT_ID": 4,
854                                    "USED_FOR_CAND": "N",
855                                    "USED_FOR_SCORING": "Y",
856                                    "ENTITY_COUNT": 1,
857                                    "CANDIDATE_CAP_REACHED": "N",
858                                    "SCORING_CAP_REACHED": "N",
859                                    "SUPPRESSED": "N"
860                                }
861                            ]
862                        },
863                        {
864                            "FEAT_DESC": "702-919-1300",
865                            "LIB_FEAT_ID": 4,
866                            "USAGE_TYPE": "MOBILE",
867                            "FEAT_DESC_VALUES": [
868                                {
869                                    "FEAT_DESC": "702-919-1300",
870                                    "LIB_FEAT_ID": 4,
871                                    "USED_FOR_CAND": "N",
872                                    "USED_FOR_SCORING": "Y",
873                                    "ENTITY_COUNT": 1,
874                                    "CANDIDATE_CAP_REACHED": "N",
875                                    "SCORING_CAP_REACHED": "N",
876                                    "SUPPRESSED": "N"
877                                }
878                            ]
879                        }
880                    ],
881                    "PHONE_KEY": [
882                        {
883                            "FEAT_DESC": "7029191300",
884                            "LIB_FEAT_ID": 9,
885                            "FEAT_DESC_VALUES": [
886                                {
887                                    "FEAT_DESC": "7029191300",
888                                    "LIB_FEAT_ID": 9,
889                                    "USED_FOR_CAND": "Y",
890                                    "USED_FOR_SCORING": "N",
891                                    "ENTITY_COUNT": 1,
892                                    "CANDIDATE_CAP_REACHED": "N",
893                                    "SCORING_CAP_REACHED": "N",
894                                    "SUPPRESSED": "N"
895                                }
896                            ]
897                        }
898                    ],
899                    "RECORD_TYPE": [
900                        {
901                            "FEAT_DESC": "PERSON",
902                            "LIB_FEAT_ID": 10,
903                            "FEAT_DESC_VALUES": [
904                                {
905                                    "FEAT_DESC": "PERSON",
906                                    "LIB_FEAT_ID": 10,
907                                    "USED_FOR_CAND": "N",
908                                    "USED_FOR_SCORING": "Y",
909                                    "ENTITY_COUNT": 100,
910                                    "CANDIDATE_CAP_REACHED": "N",
911                                    "SCORING_CAP_REACHED": "N",
912                                    "SUPPRESSED": "N"
913                                }
914                            ]
915                        }
916                    ]
917                },
918                "RECORD_SUMMARY": [
919                    {
920                        "DATA_SOURCE": "CUSTOMERS",
921                        "RECORD_COUNT": 3
922                    }
923                ],
924                "RECORDS": [
925                    {
926                        "DATA_SOURCE": "CUSTOMERS",
927                        "RECORD_ID": "1001",
928                        "INTERNAL_ID": 35,
929                        "MATCH_KEY": "",
930                        "MATCH_LEVEL_CODE": "",
931                        "ERRULE_CODE": "",
932                        "FIRST_SEEN_DT": "2024-10-25T17:39:00Z",
933                        "LAST_SEEN_DT": "2024-10-25T17:39:00Z"
934                    },
935                    {
936                        "DATA_SOURCE": "CUSTOMERS",
937                        "RECORD_ID": "1002",
938                        "INTERNAL_ID": 36,
939                        "MATCH_KEY": "+NAME+DOB+PHONE",
940                        "MATCH_LEVEL_CODE": "RESOLVED",
941                        "ERRULE_CODE": "CNAME_CFF_CEXCL",
942                        "FIRST_SEEN_DT": "2024-10-25T17:39:00Z",
943                        "LAST_SEEN_DT": "2024-10-25T17:39:00Z"
944                    },
945                    {
946                        "DATA_SOURCE": "CUSTOMERS",
947                        "RECORD_ID": "1003",
948                        "INTERNAL_ID": 37,
949                        "MATCH_KEY": "+NAME+DOB+EMAIL",
950                        "MATCH_LEVEL_CODE": "RESOLVED",
951                        "ERRULE_CODE": "SF1_PNAME_CSTAB",
952                        "FIRST_SEEN_DT": "2024-10-25T17:39:00Z",
953                        "LAST_SEEN_DT": "2024-10-25T17:39:00Z"
954                    }
955                ]
956            },
957            "RELATED_ENTITIES": []
958        }
959    ]
960}
why_records(data_source_code_1: str, record_id_1: str, data_source_code_2: str, record_id_2: str, flags: int = <SzEngineFlags.SZ_WHY_ENTITIES_DEFAULT_FLAGS: 96009152>) str[source]

The why_records determines if any two records can or cannot resolve together, or if they relate.

Parameters:
  • data_source_code_1 (str) – Identifies the provenance of the data.

  • record_id_1 (str) – The unique identifier within the records of the same data source.

  • data_source_code_2 (str) – Identifies the provenance of the data.

  • record_id_2 (str) – The unique identifier within the records of the same data source.

  • flags (int, optional) – Flags used to control information returned. Defaults to SzEngineFlags.SZ_WHY_ENTITY_DEFAULT_FLAGS.

Returns:

A JSON document.

Return type:

str

Raises:

Example:
 1from senzing import SzEngineFlags, SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5data_source_code_1 = "CUSTOMERS"
 6data_source_code_2 = "CUSTOMERS"
 7flags = SzEngineFlags.SZ_WHY_ENTITIES_DEFAULT_FLAGS
 8instance_name = "Example"
 9record_id_1 = "1001"
10record_id_2 = "1002"
11settings = {
12    "PIPELINE": {
13        "CONFIGPATH": "/etc/opt/senzing",
14        "RESOURCEPATH": "/opt/senzing/er/resources",
15        "SUPPORTPATH": "/opt/senzing/data",
16    },
17    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
18}
19
20try:
21    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
22    sz_engine = sz_abstract_factory.create_engine()
23    result = sz_engine.why_records(
24        data_source_code_1,
25        record_id_1,
26        data_source_code_2,
27        record_id_2,
28        flags,
29    )
30    print(f"\n{result}\n")
31except SzError as err:
32    print(f"\nERROR: {err}\n")

Output:

  1// Output has been formatted and pruned for easier reading.
  2
  3{
  4    "WHY_RESULTS": [
  5        {
  6            "INTERNAL_ID": 35,
  7            "ENTITY_ID": 35,
  8            "FOCUS_RECORDS": [
  9                {
 10                    "DATA_SOURCE": "CUSTOMERS",
 11                    "RECORD_ID": "1001"
 12                }
 13            ],
 14            "INTERNAL_ID_2": 36,
 15            "ENTITY_ID_2": 35,
 16            "FOCUS_RECORDS_2": [
 17                {
 18                    "DATA_SOURCE": "CUSTOMERS",
 19                    "RECORD_ID": "1002"
 20                }
 21            ],
 22            "MATCH_INFO": {
 23                "WHY_KEY": "+NAME+DOB+PHONE",
 24                "WHY_ERRULE_CODE": "CNAME_CFF_CEXCL",
 25                "MATCH_LEVEL_CODE": "RESOLVED",
 26                "CANDIDATE_KEYS": {
 27                    "NAMEDATE_KEY": [
 28                        {
 29                            "FEAT_ID": 14,
 30                            "FEAT_DESC": "RPRT|SM0|DOB.MMDD_HASH=1211"
 31                        },
 32                        {
 33                            "FEAT_ID": 15,
 34                            "FEAT_DESC": "RPRT|SM0|DOB=71211"
 35                        }
 36                    ],
 37                    "NAMEPHONE_KEY": [
 38                        {
 39                            "FEAT_ID": 19,
 40                            "FEAT_DESC": "RPRT|SM0|PHONE.PHONE_LAST_5=91300"
 41                        }
 42                    ],
 43                    "NAMEREGION_KEY": [
 44                        {
 45                            "FEAT_ID": 18,
 46                            "FEAT_DESC": "RPRT|SM0|ADDRESS.CITY_STD=LS FKS"
 47                        }
 48                    ],
 49                    "NAME_KEY": [
 50                        {
 51                            "FEAT_ID": 6,
 52                            "FEAT_DESC": "RPRT|SM0"
 53                        }
 54                    ],
 55                    "PHONE_KEY": [
 56                        {
 57                            "FEAT_ID": 9,
 58                            "FEAT_DESC": "7029191300"
 59                        }
 60                    ]
 61                },
 62                "DISCLOSED_RELATIONS": {},
 63                "FEATURE_SCORES": {
 64                    "ADDRESS": [
 65                        {
 66                            "INBOUND_FEAT_ID": 3,
 67                            "INBOUND_FEAT_DESC": "123 Main Street, Las Vegas NV 89132",
 68                            "INBOUND_FEAT_USAGE_TYPE": "MAILING",
 69                            "CANDIDATE_FEAT_ID": 22,
 70                            "CANDIDATE_FEAT_DESC": "1515 Adela Lane Las Vegas NV 89111",
 71                            "CANDIDATE_FEAT_USAGE_TYPE": "HOME",
 72                            "SCORE": 42,
 73                            "ADDITIONAL_SCORES": {
 74                                "FULL_SCORE": 42
 75                            },
 76                            "SCORE_BUCKET": "NO_CHANCE",
 77                            "SCORE_BEHAVIOR": "FF"
 78                        }
 79                    ],
 80                    "DOB": [
 81                        {
 82                            "INBOUND_FEAT_ID": 2,
 83                            "INBOUND_FEAT_DESC": "12/11/1978",
 84                            "INBOUND_FEAT_USAGE_TYPE": "",
 85                            "CANDIDATE_FEAT_ID": 21,
 86                            "CANDIDATE_FEAT_DESC": "11/12/1978",
 87                            "CANDIDATE_FEAT_USAGE_TYPE": "",
 88                            "SCORE": 95,
 89                            "ADDITIONAL_SCORES": {
 90                                "FULL_SCORE": 95
 91                            },
 92                            "SCORE_BUCKET": "CLOSE",
 93                            "SCORE_BEHAVIOR": "FMES"
 94                        }
 95                    ],
 96                    "NAME": [
 97                        {
 98                            "INBOUND_FEAT_ID": 1,
 99                            "INBOUND_FEAT_DESC": "Robert Smith",
100                            "INBOUND_FEAT_USAGE_TYPE": "PRIMARY",
101                            "CANDIDATE_FEAT_ID": 20,
102                            "CANDIDATE_FEAT_DESC": "Bob Smith",
103                            "CANDIDATE_FEAT_USAGE_TYPE": "PRIMARY",
104                            "SCORE": 97,
105                            "ADDITIONAL_SCORES": {
106                                "GENERATION_MATCH": -1,
107                                "GNR_FN": 97,
108                                "GNR_GN": 95,
109                                "GNR_ON": -1,
110                                "GNR_SN": 100
111                            },
112                            "SCORE_BUCKET": "CLOSE",
113                            "SCORE_BEHAVIOR": "NAME"
114                        }
115                    ],
116                    "PHONE": [
117                        {
118                            "INBOUND_FEAT_ID": 4,
119                            "INBOUND_FEAT_DESC": "702-919-1300",
120                            "INBOUND_FEAT_USAGE_TYPE": "HOME",
121                            "CANDIDATE_FEAT_ID": 4,
122                            "CANDIDATE_FEAT_DESC": "702-919-1300",
123                            "CANDIDATE_FEAT_USAGE_TYPE": "MOBILE",
124                            "SCORE": 100,
125                            "ADDITIONAL_SCORES": {
126                                "FULL_SCORE": 100
127                            },
128                            "SCORE_BUCKET": "SAME",
129                            "SCORE_BEHAVIOR": "FF"
130                        }
131                    ],
132                    "RECORD_TYPE": [
133                        {
134                            "INBOUND_FEAT_ID": 10,
135                            "INBOUND_FEAT_DESC": "PERSON",
136                            "INBOUND_FEAT_USAGE_TYPE": "",
137                            "CANDIDATE_FEAT_ID": 10,
138                            "CANDIDATE_FEAT_DESC": "PERSON",
139                            "CANDIDATE_FEAT_USAGE_TYPE": "",
140                            "SCORE": 100,
141                            "ADDITIONAL_SCORES": {
142                                "FULL_SCORE": 100
143                            },
144                            "SCORE_BUCKET": "SAME",
145                            "SCORE_BEHAVIOR": "FVME"
146                        }
147                    ]
148                }
149            }
150        }
151    ],
152    "ENTITIES": [
153        {
154            "RESOLVED_ENTITY": {
155                "ENTITY_ID": 35,
156                "ENTITY_NAME": "Robert Smith",
157                "FEATURES": {
158                    "ADDRESS": [
159                        {
160                            "FEAT_DESC": "1515 Adela Lane Las Vegas NV 89111",
161                            "LIB_FEAT_ID": 22,
162                            "USAGE_TYPE": "HOME",
163                            "FEAT_DESC_VALUES": [
164                                {
165                                    "FEAT_DESC": "1515 Adela Lane Las Vegas NV 89111",
166                                    "LIB_FEAT_ID": 22,
167                                    "USED_FOR_CAND": "N",
168                                    "USED_FOR_SCORING": "Y",
169                                    "ENTITY_COUNT": 1,
170                                    "CANDIDATE_CAP_REACHED": "N",
171                                    "SCORING_CAP_REACHED": "N",
172                                    "SUPPRESSED": "N"
173                                }
174                            ]
175                        },
176                        {
177                            "FEAT_DESC": "123 Main Street, Las Vegas NV 89132",
178                            "LIB_FEAT_ID": 3,
179                            "USAGE_TYPE": "MAILING",
180                            "FEAT_DESC_VALUES": [
181                                {
182                                    "FEAT_DESC": "123 Main Street, Las Vegas NV 89132",
183                                    "LIB_FEAT_ID": 3,
184                                    "USED_FOR_CAND": "N",
185                                    "USED_FOR_SCORING": "Y",
186                                    "ENTITY_COUNT": 1,
187                                    "CANDIDATE_CAP_REACHED": "N",
188                                    "SCORING_CAP_REACHED": "N",
189                                    "SUPPRESSED": "N"
190                                }
191                            ]
192                        }
193                    ],
194                    "ADDR_KEY": [
195                        {
196                            "FEAT_DESC": "123|MN||89132",
197                            "LIB_FEAT_ID": 8,
198                            "FEAT_DESC_VALUES": [
199                                {
200                                    "FEAT_DESC": "123|MN||89132",
201                                    "LIB_FEAT_ID": 8,
202                                    "USED_FOR_CAND": "Y",
203                                    "USED_FOR_SCORING": "N",
204                                    "ENTITY_COUNT": 1,
205                                    "CANDIDATE_CAP_REACHED": "N",
206                                    "SCORING_CAP_REACHED": "N",
207                                    "SUPPRESSED": "N"
208                                }
209                            ]
210                        },
211                        {
212                            "FEAT_DESC": "123|MN||LS FKS",
213                            "LIB_FEAT_ID": 7,
214                            "FEAT_DESC_VALUES": [
215                                {
216                                    "FEAT_DESC": "123|MN||LS FKS",
217                                    "LIB_FEAT_ID": 7,
218                                    "USED_FOR_CAND": "Y",
219                                    "USED_FOR_SCORING": "N",
220                                    "ENTITY_COUNT": 1,
221                                    "CANDIDATE_CAP_REACHED": "N",
222                                    "SCORING_CAP_REACHED": "N",
223                                    "SUPPRESSED": "N"
224                                }
225                            ]
226                        },
227                        {
228                            "FEAT_DESC": "1515|ATL||89111",
229                            "LIB_FEAT_ID": 24,
230                            "FEAT_DESC_VALUES": [
231                                {
232                                    "FEAT_DESC": "1515|ATL||89111",
233                                    "LIB_FEAT_ID": 24,
234                                    "USED_FOR_CAND": "Y",
235                                    "USED_FOR_SCORING": "N",
236                                    "ENTITY_COUNT": 1,
237                                    "CANDIDATE_CAP_REACHED": "N",
238                                    "SCORING_CAP_REACHED": "N",
239                                    "SUPPRESSED": "N"
240                                }
241                            ]
242                        },
243                        {
244                            "FEAT_DESC": "1515|ATL||LS FKS",
245                            "LIB_FEAT_ID": 25,
246                            "FEAT_DESC_VALUES": [
247                                {
248                                    "FEAT_DESC": "1515|ATL||LS FKS",
249                                    "LIB_FEAT_ID": 25,
250                                    "USED_FOR_CAND": "Y",
251                                    "USED_FOR_SCORING": "N",
252                                    "ENTITY_COUNT": 1,
253                                    "CANDIDATE_CAP_REACHED": "N",
254                                    "SCORING_CAP_REACHED": "N",
255                                    "SUPPRESSED": "N"
256                                }
257                            ]
258                        }
259                    ],
260                    "DOB": [
261                        {
262                            "FEAT_DESC": "12/11/1978",
263                            "LIB_FEAT_ID": 2,
264                            "FEAT_DESC_VALUES": [
265                                {
266                                    "FEAT_DESC": "12/11/1978",
267                                    "LIB_FEAT_ID": 2,
268                                    "USED_FOR_CAND": "Y",
269                                    "USED_FOR_SCORING": "Y",
270                                    "ENTITY_COUNT": 1,
271                                    "CANDIDATE_CAP_REACHED": "N",
272                                    "SCORING_CAP_REACHED": "N",
273                                    "SUPPRESSED": "N"
274                                },
275                                {
276                                    "FEAT_DESC": "11/12/1978",
277                                    "LIB_FEAT_ID": 21,
278                                    "USED_FOR_CAND": "Y",
279                                    "USED_FOR_SCORING": "Y",
280                                    "ENTITY_COUNT": 1,
281                                    "CANDIDATE_CAP_REACHED": "N",
282                                    "SCORING_CAP_REACHED": "N",
283                                    "SUPPRESSED": "N"
284                                }
285                            ]
286                        }
287                    ],
288                    "EMAIL": [
289                        {
290                            "FEAT_DESC": "bsmith@work.com",
291                            "LIB_FEAT_ID": 5,
292                            "FEAT_DESC_VALUES": [
293                                {
294                                    "FEAT_DESC": "bsmith@work.com",
295                                    "LIB_FEAT_ID": 5,
296                                    "USED_FOR_CAND": "N",
297                                    "USED_FOR_SCORING": "Y",
298                                    "ENTITY_COUNT": 1,
299                                    "CANDIDATE_CAP_REACHED": "N",
300                                    "SCORING_CAP_REACHED": "N",
301                                    "SUPPRESSED": "N"
302                                }
303                            ]
304                        }
305                    ],
306                    "EMAIL_KEY": [
307                        {
308                            "FEAT_DESC": "bsmith@WORK.COM",
309                            "LIB_FEAT_ID": 11,
310                            "FEAT_DESC_VALUES": [
311                                {
312                                    "FEAT_DESC": "bsmith@WORK.COM",
313                                    "LIB_FEAT_ID": 11,
314                                    "USED_FOR_CAND": "Y",
315                                    "USED_FOR_SCORING": "N",
316                                    "ENTITY_COUNT": 1,
317                                    "CANDIDATE_CAP_REACHED": "N",
318                                    "SCORING_CAP_REACHED": "N",
319                                    "SUPPRESSED": "N"
320                                }
321                            ]
322                        }
323                    ],
324                    "NAME": [
325                        {
326                            "FEAT_DESC": "Robert Smith",
327                            "LIB_FEAT_ID": 1,
328                            "USAGE_TYPE": "PRIMARY",
329                            "FEAT_DESC_VALUES": [
330                                {
331                                    "FEAT_DESC": "Robert Smith",
332                                    "LIB_FEAT_ID": 1,
333                                    "USED_FOR_CAND": "N",
334                                    "USED_FOR_SCORING": "Y",
335                                    "ENTITY_COUNT": 1,
336                                    "CANDIDATE_CAP_REACHED": "N",
337                                    "SCORING_CAP_REACHED": "N",
338                                    "SUPPRESSED": "N"
339                                },
340                                {
341                                    "FEAT_DESC": "Bob J Smith",
342                                    "LIB_FEAT_ID": 38,
343                                    "USED_FOR_CAND": "N",
344                                    "USED_FOR_SCORING": "Y",
345                                    "ENTITY_COUNT": 1,
346                                    "CANDIDATE_CAP_REACHED": "N",
347                                    "SCORING_CAP_REACHED": "N",
348                                    "SUPPRESSED": "N"
349                                },
350                                {
351                                    "FEAT_DESC": "Bob Smith",
352                                    "LIB_FEAT_ID": 20,
353                                    "USED_FOR_CAND": "N",
354                                    "USED_FOR_SCORING": "Y",
355                                    "ENTITY_COUNT": 1,
356                                    "CANDIDATE_CAP_REACHED": "N",
357                                    "SCORING_CAP_REACHED": "N",
358                                    "SUPPRESSED": "Y"
359                                }
360                            ]
361                        }
362                    ],
363                    "NAMEADDR_KEY": [
364                        {
365                            "FEAT_DESC": "PP|SM0|ADDR_KEY.EXPRESSION=1515|ATL||89111",
366                            "LIB_FEAT_ID": 27,
367                            "FEAT_DESC_VALUES": [
368                                {
369                                    "FEAT_DESC": "PP|SM0|ADDR_KEY.EXPRESSION=1515|ATL||89111",
370                                    "LIB_FEAT_ID": 27,
371                                    "USED_FOR_CAND": "Y",
372                                    "USED_FOR_SCORING": "N",
373                                    "ENTITY_COUNT": 1,
374                                    "CANDIDATE_CAP_REACHED": "N",
375                                    "SCORING_CAP_REACHED": "N",
376                                    "SUPPRESSED": "N"
377                                }
378                            ]
379                        },
380                        {
381                            "FEAT_DESC": "PP|SM0|ADDR_KEY.EXPRESSION=1515|ATL||LS FKS",
382                            "LIB_FEAT_ID": 28,
383                            "FEAT_DESC_VALUES": [
384                                {
385                                    "FEAT_DESC": "PP|SM0|ADDR_KEY.EXPRESSION=1515|ATL||LS FKS",
386                                    "LIB_FEAT_ID": 28,
387                                    "USED_FOR_CAND": "Y",
388                                    "USED_FOR_SCORING": "N",
389                                    "ENTITY_COUNT": 1,
390                                    "CANDIDATE_CAP_REACHED": "N",
391                                    "SCORING_CAP_REACHED": "N",
392                                    "SUPPRESSED": "N"
393                                }
394                            ]
395                        },
396                        {
397                            "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=123|MN||89132",
398                            "LIB_FEAT_ID": 12,
399                            "FEAT_DESC_VALUES": [
400                                {
401                                    "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=123|MN||89132",
402                                    "LIB_FEAT_ID": 12,
403                                    "USED_FOR_CAND": "Y",
404                                    "USED_FOR_SCORING": "N",
405                                    "ENTITY_COUNT": 1,
406                                    "CANDIDATE_CAP_REACHED": "N",
407                                    "SCORING_CAP_REACHED": "N",
408                                    "SUPPRESSED": "N"
409                                }
410                            ]
411                        },
412                        {
413                            "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=123|MN||LS FKS",
414                            "LIB_FEAT_ID": 13,
415                            "FEAT_DESC_VALUES": [
416                                {
417                                    "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=123|MN||LS FKS",
418                                    "LIB_FEAT_ID": 13,
419                                    "USED_FOR_CAND": "Y",
420                                    "USED_FOR_SCORING": "N",
421                                    "ENTITY_COUNT": 1,
422                                    "CANDIDATE_CAP_REACHED": "N",
423                                    "SCORING_CAP_REACHED": "N",
424                                    "SUPPRESSED": "N"
425                                }
426                            ]
427                        },
428                        {
429                            "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=1515|ATL||89111",
430                            "LIB_FEAT_ID": 29,
431                            "FEAT_DESC_VALUES": [
432                                {
433                                    "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=1515|ATL||89111",
434                                    "LIB_FEAT_ID": 29,
435                                    "USED_FOR_CAND": "Y",
436                                    "USED_FOR_SCORING": "N",
437                                    "ENTITY_COUNT": 1,
438                                    "CANDIDATE_CAP_REACHED": "N",
439                                    "SCORING_CAP_REACHED": "N",
440                                    "SUPPRESSED": "N"
441                                }
442                            ]
443                        },
444                        {
445                            "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=1515|ATL||LS FKS",
446                            "LIB_FEAT_ID": 26,
447                            "FEAT_DESC_VALUES": [
448                                {
449                                    "FEAT_DESC": "RPRT|SM0|ADDR_KEY.EXPRESSION=1515|ATL||LS FKS",
450                                    "LIB_FEAT_ID": 26,
451                                    "USED_FOR_CAND": "Y",
452                                    "USED_FOR_SCORING": "N",
453                                    "ENTITY_COUNT": 1,
454                                    "CANDIDATE_CAP_REACHED": "N",
455                                    "SCORING_CAP_REACHED": "N",
456                                    "SUPPRESSED": "N"
457                                }
458                            ]
459                        }
460                    ],
461                    "NAMEDATE_KEY": [
462                        {
463                            "FEAT_DESC": "J|PP|SM0|DOB.MMDD_HASH=1211",
464                            "LIB_FEAT_ID": 43,
465                            "FEAT_DESC_VALUES": [
466                                {
467                                    "FEAT_DESC": "J|PP|SM0|DOB.MMDD_HASH=1211",
468                                    "LIB_FEAT_ID": 43,
469                                    "USED_FOR_CAND": "Y",
470                                    "USED_FOR_SCORING": "N",
471                                    "ENTITY_COUNT": 1,
472                                    "CANDIDATE_CAP_REACHED": "N",
473                                    "SCORING_CAP_REACHED": "N",
474                                    "SUPPRESSED": "N"
475                                }
476                            ]
477                        },
478                        {
479                            "FEAT_DESC": "J|PP|SM0|DOB.MMYY_HASH=1278",
480                            "LIB_FEAT_ID": 41,
481                            "FEAT_DESC_VALUES": [
482                                {
483                                    "FEAT_DESC": "J|PP|SM0|DOB.MMYY_HASH=1278",
484                                    "LIB_FEAT_ID": 41,
485                                    "USED_FOR_CAND": "Y",
486                                    "USED_FOR_SCORING": "N",
487                                    "ENTITY_COUNT": 1,
488                                    "CANDIDATE_CAP_REACHED": "N",
489                                    "SCORING_CAP_REACHED": "N",
490                                    "SUPPRESSED": "N"
491                                }
492                            ]
493                        },
494                        {
495                            "FEAT_DESC": "J|PP|SM0|DOB=71211",
496                            "LIB_FEAT_ID": 40,
497                            "FEAT_DESC_VALUES": [
498                                {
499                                    "FEAT_DESC": "J|PP|SM0|DOB=71211",
500                                    "LIB_FEAT_ID": 40,
501                                    "USED_FOR_CAND": "Y",
502                                    "USED_FOR_SCORING": "N",
503                                    "ENTITY_COUNT": 1,
504                                    "CANDIDATE_CAP_REACHED": "N",
505                                    "SCORING_CAP_REACHED": "N",
506                                    "SUPPRESSED": "N"
507                                }
508                            ]
509                        },
510                        {
511                            "FEAT_DESC": "PP|SM0|DOB.MMDD_HASH=1211",
512                            "LIB_FEAT_ID": 32,
513                            "FEAT_DESC_VALUES": [
514                                {
515                                    "FEAT_DESC": "PP|SM0|DOB.MMDD_HASH=1211",
516                                    "LIB_FEAT_ID": 32,
517                                    "USED_FOR_CAND": "Y",
518                                    "USED_FOR_SCORING": "N",
519                                    "ENTITY_COUNT": 1,
520                                    "CANDIDATE_CAP_REACHED": "N",
521                                    "SCORING_CAP_REACHED": "N",
522                                    "SUPPRESSED": "N"
523                                }
524                            ]
525                        },
526                        {
527                            "FEAT_DESC": "PP|SM0|DOB.MMYY_HASH=1178",
528                            "LIB_FEAT_ID": 33,
529                            "FEAT_DESC_VALUES": [
530                                {
531                                    "FEAT_DESC": "PP|SM0|DOB.MMYY_HASH=1178",
532                                    "LIB_FEAT_ID": 33,
533                                    "USED_FOR_CAND": "Y",
534                                    "USED_FOR_SCORING": "N",
535                                    "ENTITY_COUNT": 1,
536                                    "CANDIDATE_CAP_REACHED": "N",
537                                    "SCORING_CAP_REACHED": "N",
538                                    "SUPPRESSED": "N"
539                                }
540                            ]
541                        },
542                        {
543                            "FEAT_DESC": "PP|SM0|DOB.MMYY_HASH=1278",
544                            "LIB_FEAT_ID": 42,
545                            "FEAT_DESC_VALUES": [
546                                {
547                                    "FEAT_DESC": "PP|SM0|DOB.MMYY_HASH=1278",
548                                    "LIB_FEAT_ID": 42,
549                                    "USED_FOR_CAND": "Y",
550                                    "USED_FOR_SCORING": "N",
551                                    "ENTITY_COUNT": 1,
552                                    "CANDIDATE_CAP_REACHED": "N",
553                                    "SCORING_CAP_REACHED": "N",
554                                    "SUPPRESSED": "N"
555                                }
556                            ]
557                        },
558                        {
559                            "FEAT_DESC": "PP|SM0|DOB=71211",
560                            "LIB_FEAT_ID": 31,
561                            "FEAT_DESC_VALUES": [
562                                {
563                                    "FEAT_DESC": "PP|SM0|DOB=71211",
564                                    "LIB_FEAT_ID": 31,
565                                    "USED_FOR_CAND": "Y",
566                                    "USED_FOR_SCORING": "N",
567                                    "ENTITY_COUNT": 1,
568                                    "CANDIDATE_CAP_REACHED": "N",
569                                    "SCORING_CAP_REACHED": "N",
570                                    "SUPPRESSED": "N"
571                                }
572                            ]
573                        },
574                        {
575                            "FEAT_DESC": "RPRT|SM0|DOB.MMDD_HASH=1211",
576                            "LIB_FEAT_ID": 14,
577                            "FEAT_DESC_VALUES": [
578                                {
579                                    "FEAT_DESC": "RPRT|SM0|DOB.MMDD_HASH=1211",
580                                    "LIB_FEAT_ID": 14,
581                                    "USED_FOR_CAND": "Y",
582                                    "USED_FOR_SCORING": "N",
583                                    "ENTITY_COUNT": 1,
584                                    "CANDIDATE_CAP_REACHED": "N",
585                                    "SCORING_CAP_REACHED": "N",
586                                    "SUPPRESSED": "N"
587                                }
588                            ]
589                        },
590                        {
591                            "FEAT_DESC": "RPRT|SM0|DOB.MMYY_HASH=1178",
592                            "LIB_FEAT_ID": 30,
593                            "FEAT_DESC_VALUES": [
594                                {
595                                    "FEAT_DESC": "RPRT|SM0|DOB.MMYY_HASH=1178",
596                                    "LIB_FEAT_ID": 30,
597                                    "USED_FOR_CAND": "Y",
598                                    "USED_FOR_SCORING": "N",
599                                    "ENTITY_COUNT": 1,
600                                    "CANDIDATE_CAP_REACHED": "N",
601                                    "SCORING_CAP_REACHED": "N",
602                                    "SUPPRESSED": "N"
603                                }
604                            ]
605                        },
606                        {
607                            "FEAT_DESC": "RPRT|SM0|DOB.MMYY_HASH=1278",
608                            "LIB_FEAT_ID": 16,
609                            "FEAT_DESC_VALUES": [
610                                {
611                                    "FEAT_DESC": "RPRT|SM0|DOB.MMYY_HASH=1278",
612                                    "LIB_FEAT_ID": 16,
613                                    "USED_FOR_CAND": "Y",
614                                    "USED_FOR_SCORING": "N",
615                                    "ENTITY_COUNT": 1,
616                                    "CANDIDATE_CAP_REACHED": "N",
617                                    "SCORING_CAP_REACHED": "N",
618                                    "SUPPRESSED": "N"
619                                }
620                            ]
621                        },
622                        {
623                            "FEAT_DESC": "RPRT|SM0|DOB=71211",
624                            "LIB_FEAT_ID": 15,
625                            "FEAT_DESC_VALUES": [
626                                {
627                                    "FEAT_DESC": "RPRT|SM0|DOB=71211",
628                                    "LIB_FEAT_ID": 15,
629                                    "USED_FOR_CAND": "Y",
630                                    "USED_FOR_SCORING": "N",
631                                    "ENTITY_COUNT": 1,
632                                    "CANDIDATE_CAP_REACHED": "N",
633                                    "SCORING_CAP_REACHED": "N",
634                                    "SUPPRESSED": "N"
635                                }
636                            ]
637                        }
638                    ],
639                    "NAMEPHONE_KEY": [
640                        {
641                            "FEAT_DESC": "PP|SM0|PHONE.PHONE_LAST_5=91300",
642                            "LIB_FEAT_ID": 37,
643                            "FEAT_DESC_VALUES": [
644                                {
645                                    "FEAT_DESC": "PP|SM0|PHONE.PHONE_LAST_5=91300",
646                                    "LIB_FEAT_ID": 37,
647                                    "USED_FOR_CAND": "Y",
648                                    "USED_FOR_SCORING": "N",
649                                    "ENTITY_COUNT": 1,
650                                    "CANDIDATE_CAP_REACHED": "N",
651                                    "SCORING_CAP_REACHED": "N",
652                                    "SUPPRESSED": "N"
653                                }
654                            ]
655                        },
656                        {
657                            "FEAT_DESC": "RPRT|SM0|PHONE.PHONE_LAST_5=91300",
658                            "LIB_FEAT_ID": 19,
659                            "FEAT_DESC_VALUES": [
660                                {
661                                    "FEAT_DESC": "RPRT|SM0|PHONE.PHONE_LAST_5=91300",
662                                    "LIB_FEAT_ID": 19,
663                                    "USED_FOR_CAND": "Y",
664                                    "USED_FOR_SCORING": "N",
665                                    "ENTITY_COUNT": 1,
666                                    "CANDIDATE_CAP_REACHED": "N",
667                                    "SCORING_CAP_REACHED": "N",
668                                    "SUPPRESSED": "N"
669                                }
670                            ]
671                        }
672                    ],
673                    "NAMEREGION_KEY": [
674                        {
675                            "FEAT_DESC": "PP|SM0|ADDRESS.CITY_STD=LS FKS",
676                            "LIB_FEAT_ID": 36,
677                            "FEAT_DESC_VALUES": [
678                                {
679                                    "FEAT_DESC": "PP|SM0|ADDRESS.CITY_STD=LS FKS",
680                                    "LIB_FEAT_ID": 36,
681                                    "USED_FOR_CAND": "Y",
682                                    "USED_FOR_SCORING": "N",
683                                    "ENTITY_COUNT": 1,
684                                    "CANDIDATE_CAP_REACHED": "N",
685                                    "SCORING_CAP_REACHED": "N",
686                                    "SUPPRESSED": "N"
687                                }
688                            ]
689                        },
690                        {
691                            "FEAT_DESC": "PP|SM0|POST=89111",
692                            "LIB_FEAT_ID": 35,
693                            "FEAT_DESC_VALUES": [
694                                {
695                                    "FEAT_DESC": "PP|SM0|POST=89111",
696                                    "LIB_FEAT_ID": 35,
697                                    "USED_FOR_CAND": "Y",
698                                    "USED_FOR_SCORING": "N",
699                                    "ENTITY_COUNT": 1,
700                                    "CANDIDATE_CAP_REACHED": "N",
701                                    "SCORING_CAP_REACHED": "N",
702                                    "SUPPRESSED": "N"
703                                }
704                            ]
705                        },
706                        {
707                            "FEAT_DESC": "RPRT|SM0|ADDRESS.CITY_STD=LS FKS",
708                            "LIB_FEAT_ID": 18,
709                            "FEAT_DESC_VALUES": [
710                                {
711                                    "FEAT_DESC": "RPRT|SM0|ADDRESS.CITY_STD=LS FKS",
712                                    "LIB_FEAT_ID": 18,
713                                    "USED_FOR_CAND": "Y",
714                                    "USED_FOR_SCORING": "N",
715                                    "ENTITY_COUNT": 1,
716                                    "CANDIDATE_CAP_REACHED": "N",
717                                    "SCORING_CAP_REACHED": "N",
718                                    "SUPPRESSED": "N"
719                                }
720                            ]
721                        },
722                        {
723                            "FEAT_DESC": "RPRT|SM0|POST=89111",
724                            "LIB_FEAT_ID": 34,
725                            "FEAT_DESC_VALUES": [
726                                {
727                                    "FEAT_DESC": "RPRT|SM0|POST=89111",
728                                    "LIB_FEAT_ID": 34,
729                                    "USED_FOR_CAND": "Y",
730                                    "USED_FOR_SCORING": "N",
731                                    "ENTITY_COUNT": 1,
732                                    "CANDIDATE_CAP_REACHED": "N",
733                                    "SCORING_CAP_REACHED": "N",
734                                    "SUPPRESSED": "N"
735                                }
736                            ]
737                        },
738                        {
739                            "FEAT_DESC": "RPRT|SM0|POST=89132",
740                            "LIB_FEAT_ID": 17,
741                            "FEAT_DESC_VALUES": [
742                                {
743                                    "FEAT_DESC": "RPRT|SM0|POST=89132",
744                                    "LIB_FEAT_ID": 17,
745                                    "USED_FOR_CAND": "Y",
746                                    "USED_FOR_SCORING": "N",
747                                    "ENTITY_COUNT": 1,
748                                    "CANDIDATE_CAP_REACHED": "N",
749                                    "SCORING_CAP_REACHED": "N",
750                                    "SUPPRESSED": "N"
751                                }
752                            ]
753                        }
754                    ],
755                    "NAME_KEY": [
756                        {
757                            "FEAT_DESC": "J|PP|SM0",
758                            "LIB_FEAT_ID": 39,
759                            "FEAT_DESC_VALUES": [
760                                {
761                                    "FEAT_DESC": "J|PP|SM0",
762                                    "LIB_FEAT_ID": 39,
763                                    "USED_FOR_CAND": "Y",
764                                    "USED_FOR_SCORING": "N",
765                                    "ENTITY_COUNT": 1,
766                                    "CANDIDATE_CAP_REACHED": "N",
767                                    "SCORING_CAP_REACHED": "N",
768                                    "SUPPRESSED": "N"
769                                }
770                            ]
771                        },
772                        {
773                            "FEAT_DESC": "PP|SM0",
774                            "LIB_FEAT_ID": 23,
775                            "FEAT_DESC_VALUES": [
776                                {
777                                    "FEAT_DESC": "PP|SM0",
778                                    "LIB_FEAT_ID": 23,
779                                    "USED_FOR_CAND": "Y",
780                                    "USED_FOR_SCORING": "N",
781                                    "ENTITY_COUNT": 1,
782                                    "CANDIDATE_CAP_REACHED": "N",
783                                    "SCORING_CAP_REACHED": "N",
784                                    "SUPPRESSED": "N"
785                                }
786                            ]
787                        },
788                        {
789                            "FEAT_DESC": "RPRT|SM0",
790                            "LIB_FEAT_ID": 6,
791                            "FEAT_DESC_VALUES": [
792                                {
793                                    "FEAT_DESC": "RPRT|SM0",
794                                    "LIB_FEAT_ID": 6,
795                                    "USED_FOR_CAND": "Y",
796                                    "USED_FOR_SCORING": "N",
797                                    "ENTITY_COUNT": 1,
798                                    "CANDIDATE_CAP_REACHED": "N",
799                                    "SCORING_CAP_REACHED": "N",
800                                    "SUPPRESSED": "N"
801                                }
802                            ]
803                        }
804                    ],
805                    "PHONE": [
806                        {
807                            "FEAT_DESC": "702-919-1300",
808                            "LIB_FEAT_ID": 4,
809                            "USAGE_TYPE": "HOME",
810                            "FEAT_DESC_VALUES": [
811                                {
812                                    "FEAT_DESC": "702-919-1300",
813                                    "LIB_FEAT_ID": 4,
814                                    "USED_FOR_CAND": "N",
815                                    "USED_FOR_SCORING": "Y",
816                                    "ENTITY_COUNT": 1,
817                                    "CANDIDATE_CAP_REACHED": "N",
818                                    "SCORING_CAP_REACHED": "N",
819                                    "SUPPRESSED": "N"
820                                }
821                            ]
822                        },
823                        {
824                            "FEAT_DESC": "702-919-1300",
825                            "LIB_FEAT_ID": 4,
826                            "USAGE_TYPE": "MOBILE",
827                            "FEAT_DESC_VALUES": [
828                                {
829                                    "FEAT_DESC": "702-919-1300",
830                                    "LIB_FEAT_ID": 4,
831                                    "USED_FOR_CAND": "N",
832                                    "USED_FOR_SCORING": "Y",
833                                    "ENTITY_COUNT": 1,
834                                    "CANDIDATE_CAP_REACHED": "N",
835                                    "SCORING_CAP_REACHED": "N",
836                                    "SUPPRESSED": "N"
837                                }
838                            ]
839                        }
840                    ],
841                    "PHONE_KEY": [
842                        {
843                            "FEAT_DESC": "7029191300",
844                            "LIB_FEAT_ID": 9,
845                            "FEAT_DESC_VALUES": [
846                                {
847                                    "FEAT_DESC": "7029191300",
848                                    "LIB_FEAT_ID": 9,
849                                    "USED_FOR_CAND": "Y",
850                                    "USED_FOR_SCORING": "N",
851                                    "ENTITY_COUNT": 1,
852                                    "CANDIDATE_CAP_REACHED": "N",
853                                    "SCORING_CAP_REACHED": "N",
854                                    "SUPPRESSED": "N"
855                                }
856                            ]
857                        }
858                    ],
859                    "RECORD_TYPE": [
860                        {
861                            "FEAT_DESC": "PERSON",
862                            "LIB_FEAT_ID": 10,
863                            "FEAT_DESC_VALUES": [
864                                {
865                                    "FEAT_DESC": "PERSON",
866                                    "LIB_FEAT_ID": 10,
867                                    "USED_FOR_CAND": "N",
868                                    "USED_FOR_SCORING": "Y",
869                                    "ENTITY_COUNT": 100,
870                                    "CANDIDATE_CAP_REACHED": "N",
871                                    "SCORING_CAP_REACHED": "N",
872                                    "SUPPRESSED": "N"
873                                }
874                            ]
875                        }
876                    ]
877                },
878                "RECORD_SUMMARY": [
879                    {
880                        "DATA_SOURCE": "CUSTOMERS",
881                        "RECORD_COUNT": 3
882                    }
883                ],
884                "RECORDS": [
885                    {
886                        "DATA_SOURCE": "CUSTOMERS",
887                        "RECORD_ID": "1001",
888                        "INTERNAL_ID": 35,
889                        "MATCH_KEY": "",
890                        "MATCH_LEVEL_CODE": "",
891                        "ERRULE_CODE": "",
892                        "FIRST_SEEN_DT": "2024-10-25T17:39:00Z",
893                        "LAST_SEEN_DT": "2024-10-25T17:39:00Z"
894                    },
895                    {
896                        "DATA_SOURCE": "CUSTOMERS",
897                        "RECORD_ID": "1002",
898                        "INTERNAL_ID": 36,
899                        "MATCH_KEY": "+NAME+DOB+PHONE",
900                        "MATCH_LEVEL_CODE": "RESOLVED",
901                        "ERRULE_CODE": "CNAME_CFF_CEXCL",
902                        "FIRST_SEEN_DT": "2024-10-25T17:39:00Z",
903                        "LAST_SEEN_DT": "2024-10-25T17:39:00Z"
904                    },
905                    {
906                        "DATA_SOURCE": "CUSTOMERS",
907                        "RECORD_ID": "1003",
908                        "INTERNAL_ID": 37,
909                        "MATCH_KEY": "+NAME+DOB+EMAIL",
910                        "MATCH_LEVEL_CODE": "RESOLVED",
911                        "ERRULE_CODE": "SF1_PNAME_CSTAB",
912                        "FIRST_SEEN_DT": "2024-10-25T17:39:00Z",
913                        "LAST_SEEN_DT": "2024-10-25T17:39:00Z"
914                    }
915                ]
916            },
917            "RELATED_ENTITIES": []
918        }
919    ]
920}

The why_search method retrieves entity data based on a specific entity Id and a user-specified set of entity attributes.

Parameters:
  • attributes (str) – A JSON document with the attribute data to search for.

  • entity_id (int) – The identifier of the entity to retrieve.

  • flags (int, optional) – _description_. Defaults to SzEngineFlags.SZ_WHY_SEARCH_DEFAULT_FLAGS.

  • search_profile (str) – The name of a configured search profile. Defaults to SEARCH.

Returns:

A JSON document.

Return type:

str

Raises:

Example:
 1import json
 2
 3from senzing import SzEngineFlags, SzError
 4
 5from senzing_core import SzAbstractFactoryCore
 6
 7attributes = json.dumps({"NAME_FULL": "BOB SMITH", "EMAIL_ADDRESS": "bsmith@work.com"})
 8entity_id = 1
 9flags = SzEngineFlags.SZ_WHY_SEARCH_DEFAULT_FLAGS
10instance_name = "Example"
11settings = {
12    "PIPELINE": {
13        "CONFIGPATH": "/etc/opt/senzing",
14        "RESOURCEPATH": "/opt/senzing/er/resources",
15        "SUPPORTPATH": "/opt/senzing/data",
16    },
17    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
18}
19
20try:
21    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
22    sz_engine = sz_abstract_factory.create_engine()
23    result = sz_engine.why_search(attributes, entity_id, flags)
24    print(f"\n{result}\n")
25except SzError as err:
26    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2{
 3    "WHY_RESULTS": [
 4        {
 5            "ENTITY_ID": 1,
 6            "MATCH_INFO": {
 7                "WHY_KEY": "+PNAME+EMAIL",
 8                "WHY_ERRULE_CODE": "SF1",
 9                "MATCH_LEVEL_CODE": "POSSIBLY_RELATED"
10            }
11        }
12    ],
13    "ENTITIES": [
14        {
15            "RESOLVED_ENTITY": {
16                "ENTITY_ID": 1
17            }
18        }
19    ]
20}

szproduct

senzing_core.szproduct.SzProductCore is an implementation of the senzing.szproduct.SzProduct interface that communicates with the Senzing binaries.

To use szproduct, the LD_LIBRARY_PATH environment variable must include a path to Senzing’s libraries.

Example:

export LD_LIBRARY_PATH=/opt/senzing/er/lib
class senzing_core.szproduct.SzProductCore(**kwargs: Any)[source]

Bases: SzProduct

Use SzAbstractFactoryCore.create_product() to create an SzProduct object. The SzProduct object uses the parameters provided to the SzAbstractFactoryCore().

Example:

from senzing_core import SzAbstractFactoryCore

sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
sz_product = sz_abstract_factory.create_product()

Parameters:

Raises:

get_license() str[source]

The get_license method retrieves information about the currently used license.

Returns:

A JSON document containing Senzing license metadata.

Return type:

str

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_product = sz_abstract_factory.create_product()
18    result = sz_product.get_license()
19    print(f"\n{result}\n")
20except SzError as err:
21    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4    "customer": "Senzing Public Test License",
 5    "contract": "EVALUATION - support@senzing.com",
 6    "issueDate": "2024-10-15",
 7    "licenseType": "EVAL (Solely for non-productive use)",
 8    "licenseLevel": "STANDARD",
 9    "billing": "MONTHLY",
10    "expireDate": "2025-10-16",
11    "recordLimit": 500
12}
get_version() str[source]

The get_version method returns the version of Senzing.

Returns:

A JSON document containing metadata about the Senzing Engine version being used.

Return type:

str

Example:
 1from senzing import SzError
 2
 3from senzing_core import SzAbstractFactoryCore
 4
 5instance_name = "Example"
 6settings = {
 7    "PIPELINE": {
 8        "CONFIGPATH": "/etc/opt/senzing",
 9        "RESOURCEPATH": "/opt/senzing/er/resources",
10        "SUPPORTPATH": "/opt/senzing/data",
11    },
12    "SQL": {"CONNECTION": "sqlite3://na:na@/tmp/sqlite/G2C.db"},
13}
14
15try:
16    sz_abstract_factory = SzAbstractFactoryCore(instance_name, settings)
17    sz_product = sz_abstract_factory.create_product()
18    result = sz_product.get_version()
19    print(f"\n{result}\n")
20except SzError as err:
21    print(f"\nERROR: {err}\n")

Output:

 1// Output has been formatted for easier reading.
 2
 3{
 4    "PRODUCT_NAME": "Senzing SDK",
 5    "VERSION": "4.0.0",
 6    "BUILD_VERSION": "4.0.0.24289",
 7    "BUILD_DATE": "2024-10-15",
 8    "BUILD_NUMBER": "2024_10_15__14_21",
 9    "COMPATIBILITY_VERSION": {
10        "CONFIG_VERSION": "11"
11    },
12    "SCHEMA_VERSION": {
13        "ENGINE_SCHEMA_VERSION": "4.0",
14        "MINIMUM_REQUIRED_SCHEMA_VERSION": "4.0",
15        "MAXIMUM_REQUIRED_SCHEMA_VERSION": "4.99"
16    }
17}
help(method_name: str = '') str

Return the help for a particular message.

Parameters:

method_name (str) – The name of the method. (e.g. “init”). If empty, a list of methods and descriptions is returned.

Returns:

The Help information about the requested method

Return type:

str

initialize(instance_name: str, settings: str | Dict[Any, Any], verbose_logging: int = 0) None[source]

Initialize the C-based Senzing SzProduct.

Parameters:
  • instance_name (str) – A name to distinguish this instance of the SzProduct.

  • settings (Union[str, Dict[Any, Any]]) – A JSON document defining runtime configuration.

  • verbose_logging (int, optional) – Send debug statements to STDOUT. Defaults to 0.