Skip to content

Instantly share code, notes, and snippets.

@hanifa2102
Last active September 16, 2019 01:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hanifa2102/72758d88121f06a63c54983d34e64773 to your computer and use it in GitHub Desktop.
Save hanifa2102/72758d88121f06a63c54983d34e64773 to your computer and use it in GitHub Desktop.
G2 Commands
1.Download the Senzing API to the /opt/senzing/g2 OR
1.Get the docker file(Preferred for further setup of senzing projects)
--------------------------------------------------------------------------------------
https://github.com/Senzing/knowledge-base/blob/master/HOWTO/create-senzing-dir.md#using-docker
export SENZING_DIR=/opt/senzing
export SENZING_SUBCOMMAND=install
export SENZING_DOCKER_TAG=1.9.19155
sudo mkdir -p ${SENZING_DIR}
docker pull store/senzing/senzing-package:1.9.19155
sudo docker run \
--env SENZING_SUBCOMMAND="${SENZING_SUBCOMMAND}" \
--rm \
--volume ${SENZING_DIR}:/opt/senzing \
store/senzing/senzing-package:${SENZING_DOCKER_TAG}
---------------------------------------------------------------------------------------
2.Add user who can ownership to /opt/senzing directory
1. Load Libraries
- source /opt/senzing/g2/setupEnv
2. Load License
- rename to g2.loc and move to /opt/senzing/g2/data/g2.lic
3. Using G2
a.python3 G2Loader.py -P (used the files in the demo directory)
python3 G2Loader.py -P -c /opt/senzing/g2/mydata/1/G2Project.ini
python3 G2Loader.py -P -p /opt/senzing/g2/mydata/2/G2MarketingProject.csv
b.python3 G2Export.py (creates g2export.csv)
python3 G2Export.py -c /opt/senzing/g2/mydata/1/G2Project.ini -o /opt/senzing/g2/mydata/1/export.csv
for i in {0..5};do eval "python3 G2Export.py -o /opt/senzing/g2-1.9.19155.1568339198/mydata/2/export"$i".csv -f" $i;done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment