Senzing API Quickstart Guide

This article outlines connecting to the Senzing software repository for your Linux distribution, installing the Senzing API package and performing your first ingestion of data with supplied demo data.

Tip

The intended and supported platforms are RedHat / CentOS and Debian based systems on  x86_64 architectures. For full and up to date information see System Requirements.

Installing Senzing - Debian Based Distributions

Add repository

Add and enable the Senzing repository to the currently configured list managed by apt. This only need to be completed once.

sudo apt install apt-transport-https
$ sudo apt install apt-transport-https
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  apt-transport-https
0 upgraded, 1 newly installed, 0 to remove and 65 not upgraded.
Need to get 1704 B of archives.
After this operation, 162 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 apt-transport-https all 2.0.9 [1704 B]
Fetched 1704 B in 0s (4932 B/s)
Selecting previously unselected package apt-transport-https.
(Reading database ... 42248 files and directories currently installed.)
Preparing to unpack .../apt-transport-https_2.0.9_all.deb ...
Unpacking apt-transport-https (2.0.9) ...
Setting up apt-transport-https (2.0.9) ...
wget https://senzing-production-apt.s3.amazonaws.com/senzingrepo_1.0.0-1_amd64.deb
$ wget https://senzing-production-apt.s3.amazonaws.com/senzingrepo_1.0.0-1_amd64.deb
--2022-12-12 16:39:56--  https://senzing-production-apt.s3.amazonaws.com/senzingrepo_1.0.0-1_amd64.deb
Resolving senzing-production-apt.s3.amazonaws.com (senzing-production-apt.s3.amazonaws.com)... 52.217.89.12, 52.216.220.209, 52.217.87.124, ...
Connecting to senzing-production-apt.s3.amazonaws.com (senzing-production-apt.s3.amazonaws.com)|52.217.89.12|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1336 (1.3K) [binary/octet-stream]
Saving to: ‘senzingrepo_1.0.0-1_amd64.deb’

senzingrepo_1.0.0-1_amd64.deb 100%[=================================================>]   1.30K  --.-KB/s    in 0s

2022-12-12 16:39:56 (138 MB/s) - ‘senzingrepo_1.0.0-1_amd64.deb’ saved [1336/1336]
sudo apt install ./senzingrepo_1.0.0-1_amd64.deb
$ sudo apt install ./senzingrepo_1.0.0-1_amd64.deb
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'senzingrepo' instead of './senzingrepo_1.0.0-1_amd64.deb'
senzingrepo is already the newest version (1.0.0-1).
0 upgraded, 0 newly installed, 0 to remove and 65 not upgraded.
sudo apt update

Install package

Warning

The latest version of Senzing can now be installed. As part of the installation you will be asked to accept the End User License Agreement (EULA).

sudo apt install senzingapi
$ sudo apt install senzingapi
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  senzingdata-v3
The following NEW packages will be installed:
  senzingapi senzingdata-v3
0 upgraded, 2 newly installed, 0 to remove and 65 not upgraded.
Need to get 995 MB of archives.
After this operation, 2323 MB of additional disk space will be used.
Do you want to continue? [Y/n]
Get:1 https://senzing-production-apt.s3.amazonaws.com stable/main amd64 senzingdata-v3 amd64 3.3.2-22299 [724 MB]
Fetched 995 MB in 6min 19s (2623 kB/s)
Selecting previously unselected package senzingdata-v3.
(Reading database ... 41551 files and directories currently installed.)
Preparing to unpack .../senzingdata-v3_3.0.0-22119_amd64.deb ...
The Senzing data end user license agreement can be found at https://senzing.com/end-user-license-agreement/

Do you accept the license terms and conditions? [y/n]
y
License accepted. Installing Senzing data...
Unpacking senzingdata-v3 (3.0.0-22119) ...
Selecting previously unselected package senzingapi.
Preparing to unpack .../senzingapi_3.3.2-22299_amd64.deb ...
The Senzing end user license agreement can be found at https://senzing.com/end-user-license-agreement/

Do you accept the license terms and conditions? [y/n]
y
License accepted. Installing Senzing...
Unpacking senzingapi (3.3.2-22299) ...
Setting up senzingdata-v3 (3.0.0-22119) ...
update-alternatives: using /opt/senzing/data/3.0.0/ to provide /opt/senzing/data/current (senzingdata) in auto mode
Setting up senzingapi (3.3.2-22299) ...

Installing Senzing - Red Hat Based Distributions

Add repository

Add and enable the Senzing repository to the currently configured list managed by yum. This step only needs to be completed once.

sudo yum install https://senzing-production-yum.s3.amazonaws.com/senzingrepo-1.0.0-1.x86_64.rpm

sudo yum install https://senzing-production-yum.s3.amazonaws.com/senzingrepo-1.0.0-1.x86_64.rpm

Install package

The latest version of Senzing can now be installed. As part of the installation you will be asked to accept the End User License Agreement (EULA), this can be viewed at https://senzing.com/end-user-license-agreement/

sudo yum install senzingapi

sudo yum install senzingapi

Tip

During the first installation of Senzing to a system you will also be prompted to accept the Senzing public key. Accepting the prompt imports the public key to verify future installations come from Senzing.

Retrieving key from https://senzing-production-yum.s3.amazonaws.com/senzing-production.key
Importing GPG key 0xD99E309D:
 Userid : "Senzing, Inc. <buildmgr@senzing.com>"
 Fingerprint: e38c a28c f7ab 06d5 120b bda7 4f67 bf4d d99e 309d
 From : https://senzing-production-yum.s3.amazonaws.com/senzing-production.key
Is this ok [y/N]: y

Creating a Senzing Project

To begin using Senzing, first create a project. This deploys an instance of Senzing into a specified path. The project folder must not already exist and will be created by the G2CreateProject.py utility.

Creating and using projects provides independent and isolated instances of Senzing. Projects can be upgraded from prior Senzing versions.

This command creates the Senzing project in your current users home path in a new directory named senzing.

python3 /opt/senzing/g2/python/G2CreateProject.py ~/senzing

$ python3 /opt/senzing/g2/python/G2CreateProject.py ~/senzing

Creating Senzing instance at: /home/ryan/senzing
Senzing version: 3.3.2 - (3.3.2.22299)

Successfully created.

Configuring Environment

Now setup your environment variables for the project. The setupEnv script is project dependent and needs to be run whenever you are working with a Senzing project; for example between logging in and out of shell sessions.

cd <project_path>
source setupEnv
Info

\<project_path\> refers to the path specified on the G2CreateProject.py command when creating a project. In the example above this is ~/senzing, or the senzing subdirectory under your users home directory.

Updating Database with Senzing Configuration

The Senzing engine is configured with a JSON document, on a fresh install this document needs to be registered in the Senzing database. This only needs to happen once with a new project.

python3 python/G2SetupConfig.py

Loading the Sample Demo Data

You can now load some sample demo data.

python3 python/G2Loader.py -P

G2Loader with only the -P argument will perform a purge of any existing data in the Senzing repository database (an embedded SQLite database on a default deployment) and load the sample data identified within the python/demo/sample/project.csv file.

G2Loader.py

Using a Different Database

Senzing embeds SQLite to expedite getting started without having to deploy and configure a relational database for the Senzing repository. This article uses this embedded SQLite database, if you would like to use a different supported database please see the Technical Database section.

Tip

Now loading of the sample data has completed, how about exploring and reviewing the outcomes with some of the supplied python utilities? Follow these links for suggested next steps: