This is a demonstration of using Senzing within the R programming language.
Senzing does not provide a dedicated SDK (Software Development Kit) for the R programming language. However by using the technique of having R call Python, the Senzing Python SDK can do the "heavy lifting" of calling Senzing. The following demonstrates how to do that.
For convenience, use the senzing/serve-grpc Docker container.
docker run -it --rm -p 8261:8261 --rm senzing/serve-grpcInstall the Python senzing-grpc package into a virtual environment.
Note: The example R scripts use the virtual environment located in the ~/.venv directory.
python3 -m venv ~/.venv
source ~/.venv/bin/activate
python3 -m pip install --upgrade senzing-grpcBring up the Python interpreter.
python3Run the following in the Python interpreter to verify that Senzing is reachable.
import grpc
from senzing_grpc import SzAbstractFactoryGrpc
sz_abstract_factory = SzAbstractFactoryGrpc(grpc_channel=grpc.insecure_channel("localhost:8261"))
sz_product = sz_abstract_factory.create_product()
print(sz_product.get_version())
quit()sudo Rscript -e 'install.packages("bit64", repos="https://cloud.r-project.org")'
sudo Rscript -e 'install.packages("dplyr", repos="https://cloud.r-project.org")'
sudo Rscript -e 'install.packages("httr", repos="https://cloud.r-project.org")'
sudo Rscript -e 'install.packages("reticulate", repos="https://cloud.r-project.org")'- senzing-hello-world.R - Prints the Senzing version
- senzing-load-truthsets.R - Downloads Senzing TruthSets, registers data sources, and load records.
Additional examples can be found in the testcases.