Skip to content

Commit

Permalink
#85 Savepoint
Browse files Browse the repository at this point in the history
  • Loading branch information
docktermj committed Sep 27, 2024
1 parent 761fbad commit 9b031cf
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 18 deletions.
Binary file added rootfs/notebooks/img/upload-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 2 additions & 4 deletions src/senzing_quickstart/hello_world.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# coding: utf-8

# # Senzing Hello World
#
#
# The following is a quick test of connectivity to Senzing using Python over gRPC.
#
#

# Import python packages.

Expand All @@ -16,7 +16,6 @@
import grpc
from senzing_grpc import SzAbstractFactory


# Create an abstract factory for accessing Senzing via gRPC.

# In[ ]:
Expand All @@ -41,4 +40,3 @@


print(json.dumps(json.loads(sz_product.get_version()), indent=2))

19 changes: 7 additions & 12 deletions src/senzing_quickstart/load_truthsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# coding: utf-8

# # Load Senzing truth-sets
#
#
# These instructions load the [Senzing truth-sets] into the Senzing engine.
#
#
# [Senzing truth-sets]: https://github.com/Senzing/truth-sets

# ## Prepare Python enviroment
Expand All @@ -21,7 +21,6 @@
import requests
from senzing_grpc import SzAbstractFactory, SzEngineFlags, SzError


# Set environment specific variables.

# In[ ]:
Expand Down Expand Up @@ -69,7 +68,6 @@
datasources.append(datasource)

print(f"Found the following DATA_SOURCE values in the data: {datasources}")



# ## Update Senzing configuration
Expand Down Expand Up @@ -105,7 +103,7 @@

old_config_id = sz_configmanager.get_default_config_id()
old_json_config = sz_configmanager.get_config(old_config_id)
config_handle = sz_config.import_config(old_json_config)
config_handle = sz_config.import_config(old_json_config)


# Add DataSources to Senzing configuration.
Expand All @@ -126,10 +124,8 @@


new_json_config = sz_config.export_config(config_handle)
new_config_id = sz_configmanager.add_config(
new_json_config, "Add TruthSet datasources"
)
sz_configmanager.replace_default_config_id(old_config_id, new_config_id)
new_config_id = sz_configmanager.add_config(new_json_config, "Add TruthSet datasources")
sz_configmanager.replace_default_config_id(old_config_id, new_config_id)


# With the change in Senzing configuration, Senzing objects need to be updated.
Expand All @@ -152,7 +148,7 @@
filepath = home_path + filename
with open(filepath, "r") as file:
for line in file:
try:
try:
line_as_dict = json.loads(line)
info = sz_engine.add_record(
line_as_dict.get("DATA_SOURCE"),
Expand All @@ -162,7 +158,7 @@
)
print(info)
except SzError as err:
print(err)
print(err)


# ## View results
Expand All @@ -187,4 +183,3 @@
}
search_result = sz_engine.search_by_attributes(json.dumps(search_query))
print(json.dumps(json.loads(search_result), indent=2))

2 changes: 0 additions & 2 deletions src/senzing_quickstart/method_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
import grpc
from senzing_grpc import SzAbstractFactory


# Create an abstract factory for accessing Senzing via gRPC.

# In[ ]:
Expand Down Expand Up @@ -44,4 +43,3 @@


print(sz_engine.help("get_entity_by_record_id"))

8 changes: 8 additions & 0 deletions testdata/example-data-for-senzing.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{"DATA_SOURCE": "MY_DATASOURCE", "RECORD_ID": "157616467", "DRIVERS_LICENSE_NUMBER": "00", "DATE_OF_BIRTH": "20/12/1965", "ADDR_POSTAL_CODE": "47201", "ADDR_CITY": "Columbus", "SSN_NUMBER": "883-24-5259", "NAME_FIRST": "CYNTHIA", "NAME_LAST": "SHORTS", "GENDER": "F", "DSRC_ACTION": "A", "ADDR_LINE1": "696 15th ST"}
{"DATA_SOURCE": "MY_DATASOURCE", "RECORD_ID": "115212881", "SOCIAL_HANDLE": "thyroidss", "DATE_OF_BIRTH": "20/11/1960", "ADDR_STATE": "AR", "SSN_NUMBER": "434-59-7109", "NAME_FIRST": "KEVIN", "PASSPORT_NUMBER": "154CE0YTD", "GENDER": "M", "DSRC_ACTION": "A", "ADDR_CITY": "Lewisville", "DRIVERS_LICENSE_STATE": "DE", "PHONE_NUMBER": "501-357-3875", "NAME_LAST": "HZIRT", "ADDR_LINE1": "330 5th ST"}
{"DATA_SOURCE": "MY_DATASOURCE", "RECORD_ID": "645217904", "ADDR_STATE": "Minnesota", "ADDR_POSTAL_CODE": "55804", "SSN_NUMBER": "113-56-6093", "NAME_FIRST": "LINDA", "GENDER": "F", "CC_ACCOUNT_NUMBER": "6442498315525524", "DSRC_ACTION": "A", "ADDR_CITY": "Duluth", "DRIVERS_LICENSE_NUMBER": "S90976292", "DRIVERS_LICENSE_STATE": "HI", "PHONE_NUMBER": "952-757-7688", "NAME_LAST": "BUCHANAN", "ADDR_LINE1": "486 41st AVE"}
{"DATA_SOURCE": "MY_DATASOURCE", "RECORD_ID": "212359276", "DATE_OF_BIRTH": "23/2/1968", "ADDR_STATE": "ID", "ADDR_POSTAL_CODE": "83709", "SSN_NUMBER": "441-76-2625", "NAME_FIRST": "ROLANDA", "PASSPORT_NUMBER": "CFP1XM4Q", "GENDER": "N/A", "CC_ACCOUNT_NUMBER": "50186266717162531", "DSRC_ACTION": "A", "DRIVERS_LICENSE_NUMBER": "X8865625161887", "DRIVERS_LICENSE_STATE": "IW", "ADDR_CITY": "Boise", "NAME_LAST": "JOHNSON", "ADDR_LINE1": "142 AuYto DR"}
{"DATA_SOURCE": "MY_DATASOURCE", "RECORD_ID": "526429955", "SSN_NUMBER": "388-69-4882", "NAME_FIRST": "JOHNNIE", "PASSPORT_NUMBER": "CN5QGN8HY8", "GENDER": "M", "CC_ACCOUNT_NUMBER": "541119397002419249", "DSRC_ACTION": "A", "DRIVERS_LICENSE_NUMBER": "943105509", "DRIVERS_LICENSE_STATE": "IV", "PHONE_NUMBER": "355-9553", "NAME_LAST": "H", "ADDR_LINE1": "69 Cayuga CT"}
{"DATA_SOURCE": "MY_DATASOURCE", "RECORD_ID": "604947448", "ADDR_CITY": "Port Jefferson Station", "DRIVERS_LICENSE_NUMBER": "50951659", "ADDR_STATE": "NY", "ADDR_POSTAL_CODE": "11776", "PHONE_NUMBER": "268-8561", "NAME_FIRST": "ALBERT", "NAME_LAST": "GALLAHER", "GENDER": "M", "DSRC_ACTION": "A", "ADDR_LINE1": "22 BroadShurst ST"}
{"DATA_SOURCE": "MY_DATASOURCE", "RECORD_ID": "513789670", "SOCIAL_HANDLE": "tainsz", "ADDR_STATE": "OK", "ADDR_POSTAL_CODE": "34133", "SSN_NUMBER": "758-42-2397", "NAME_FIRST": "JAFMES", "GENDER": "M", "DSRC_ACTION": "A", "ADDR_CITY": "TAlsa", "DRIVERS_LICENSE_STATE": "NY", "PHONE_NUMBER": "580-558-8123", "NAME_LAST": "HENDERSON", "ADDR_LINE1": "6738 112thEast AVE"}
{"DATA_SOURCE": "MY_DATASOURCE", "RECORD_ID": "212442489", "SOCIAL_HANDLE": "debrides7", "ADDR_STATE": "CO", "ADDR_POSTAL_CODE": "80501", "NAME_FIRST": "S", "GENDER": "M", "CC_ACCOUNT_NUMBER": "676396021499009121", "DSRC_ACTION": "A", "DRIVERS_LICENSE_STATE": "NE", "ADDR_CITY": "Longmont", "NAME_LAST": "JONES", "ADDR_LINE1": "948 10th AVE"}

0 comments on commit 9b031cf

Please sign in to comment.