diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 0000000..ec4cbc4 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,2 @@ +[run] +relative_files = true diff --git a/.github/workflows/bandit.yaml b/.github/workflows/bandit.yaml new file mode 100644 index 0000000..524ffb2 --- /dev/null +++ b/.github/workflows/bandit.yaml @@ -0,0 +1,29 @@ +name: bandit + +on: + pull_request: + branches: [main] + paths-ignore: + - ".github/**" + +permissions: + contents: read + pull-requests: write + +jobs: + bandit: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.11"] + + steps: + - uses: actions/checkout@v4 + - name: Run Bandit Scan + uses: lukehinds/bandit-action@new-action + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + path: "examples src" + recursive: "true" diff --git a/.github/workflows/black.yaml b/.github/workflows/black.yaml new file mode 100644 index 0000000..d635a24 --- /dev/null +++ b/.github/workflows/black.yaml @@ -0,0 +1,33 @@ +name: black + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + black: + name: black Python ${{ matrix.python-version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: update pip + run: python3 -m pip install --upgrade pip + + - name: pip install python packages for testing + run: pip install black + + - name: black testing + run: | + # shellcheck disable=SC2046 + black --diff --check $(git ls-files '*.py' ':!:docs/source/*') diff --git a/.github/workflows/create-sphinx-documentation.yaml b/.github/workflows/create-sphinx-documentation.yaml index 0a2ad28..93c668e 100644 --- a/.github/workflows/create-sphinx-documentation.yaml +++ b/.github/workflows/create-sphinx-documentation.yaml @@ -1,6 +1,12 @@ name: create sphinx documentation -on: [push, pull_request, workflow_dispatch] +on: + push: + branches: [main] + paths: + - 'src' + - 'examples' + workflow_dispatch: permissions: contents: write @@ -18,7 +24,7 @@ jobs: run: | pip install sphinx sphinx_rtd_theme myst_parser autodocsumm sphinx-toolbox - - name: sphinx build + - name: Sphinx build run: | sphinx-build docs/source _build diff --git a/.github/workflows/dependabot-approve-and-merge.yaml b/.github/workflows/dependabot-approve-and-merge.yaml index 15a5bf9..f86f170 100644 --- a/.github/workflows/dependabot-approve-and-merge.yaml +++ b/.github/workflows/dependabot-approve-and-merge.yaml @@ -4,11 +4,12 @@ on: pull_request: branches: [main] +permissions: + contents: write + pull-requests: write + jobs: dependabot-approve-and-merge: - permissions: - contents: write - pull-requests: write secrets: SENZING_GITHUB_CODEOWNER_PR_RW_TOKEN: ${{ secrets.SENZING_GITHUB_CODEOWNER_PR_RW_TOKEN }} uses: senzing-factory/build-resources/.github/workflows/dependabot-approve-and-merge.yaml@v1 diff --git a/.github/workflows/dependency-scan.yaml b/.github/workflows/dependency-scan.yaml new file mode 100644 index 0000000..d2257c9 --- /dev/null +++ b/.github/workflows/dependency-scan.yaml @@ -0,0 +1,52 @@ +name: dependency scan + +on: + pull_request: + branches: [main] + paths-ignore: + - '.github/**' + +env: + DEP_PATH: requirements.txt + +permissions: + contents: read + +jobs: + safety: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.11"] + + steps: + - name: checkout repository + uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: Security vulnerabilities scan + uses: aufdenpunkt/python-safety-check@v1.0.5 + with: + safety_args: '-i 62044' + + pip-audit: + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.11"] + + steps: + - name: checkout repository + uses: actions/checkout@v4 + + - name: pip install + run: python -m pip install . + + - uses: pypa/gh-action-pip-audit@v1.0.8 + with: + inputs: requirements.txt diff --git a/.github/workflows/flake8.yaml b/.github/workflows/flake8.yaml index 6b87b29..52423e7 100644 --- a/.github/workflows/flake8.yaml +++ b/.github/workflows/flake8.yaml @@ -1,19 +1,23 @@ name: flake8 -on: [push] +on: [push, pull_request] + +permissions: + contents: read jobs: flake8: - name: "flake8 Python ${{ matrix.python-version }}" + name: flake8 Python ${{ matrix.python-version }} runs-on: ubuntu-latest strategy: + fail-fast: false matrix: python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v4 - - name: Set up Python ${{ matrix.python-version }} + - name: set up Python ${{ matrix.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -23,6 +27,6 @@ jobs: - name: flake8 Lint uses: py-actions/flake8@v2 with: - max-line-length: "88" - path: "src/senzing_abstract" - plugins: "flake8-black" + max-line-length: 88 + path: src/senzing_abstract + plugins: flake8-black diff --git a/.github/workflows/isort.yaml b/.github/workflows/isort.yaml index 38a954e..de9a576 100644 --- a/.github/workflows/isort.yaml +++ b/.github/workflows/isort.yaml @@ -1,6 +1,9 @@ name: isort -on: [push] +on: [push, pull_request] + +permissions: + contents: read jobs: isort: @@ -11,5 +14,6 @@ jobs: - uses: isort/isort-action@v1 with: - requirements-files: "requirements.txt" + configuration: + requirements-files: requirements.txt sort-paths: "src/senzing_abstract examples tests" diff --git a/.github/workflows/mypy.yaml b/.github/workflows/mypy.yaml new file mode 100644 index 0000000..363eda3 --- /dev/null +++ b/.github/workflows/mypy.yaml @@ -0,0 +1,33 @@ +name: mypy + +on: [push, pull_request] + +permissions: + contents: read + +jobs: + mypy: + name: mypy Python ${{ matrix.python-version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + python-version: ["3.8", "3.9", "3.10", "3.11"] + + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + + - name: update pip + run: python3 -m pip install --upgrade pip + + - name: pip install mypy + run: pip install mypy pytest orjson + + - name: mypy testing + run: | + # shellcheck disable=SC2046 + mypy --strict $(git ls-files '*.py' ':!:docs/source/*') diff --git a/.github/workflows/pylint.yaml b/.github/workflows/pylint.yaml index 5f96c66..96fb93d 100644 --- a/.github/workflows/pylint.yaml +++ b/.github/workflows/pylint.yaml @@ -1,13 +1,17 @@ name: pylint -on: [push] +on: [push, pull_request] + +permissions: + contents: read jobs: pylint: runs-on: ubuntu-latest strategy: + fail-fast: false matrix: - python-version: ['3.8', '3.9', '3.10'] + python-version: ["3.8", "3.9", "3.10", "3.11"] steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/pytest-darwin.yaml.disabled b/.github/workflows/pytest-darwin.yaml.disabled index 7e8d613..d6752c7 100644 --- a/.github/workflows/pytest-darwin.yaml.disabled +++ b/.github/workflows/pytest-darwin.yaml.disabled @@ -1,16 +1,22 @@ name: pytest darwin -on: [push] +# TODO: Once arm64 senzing binaries are available, rename file to "pytest-darwin.yaml" + +on: [pull_request, workflow_dispatch] env: - PYTHONPATH: /Users/runner/work/g2-sdk-python-abstract/g2-sdk-python-abstract/src + PYTHONPATH: /Users/runner/work/sz-sdk-python-abstract/sz-sdk-python-abstract/src SENZING_TOOLS_ENABLE_ALL: true +permissions: + contents: read + jobs: pytest-darwin: name: "pytest OS: ${{ matrix.os }}; Python ${{ matrix.python-version }}" runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [macos-latest] # python-version: ["3.8", "3.9", "3.10", "3.11"] @@ -21,7 +27,7 @@ jobs: uses: actions/checkout@v4 - name: set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} @@ -33,3 +39,28 @@ jobs: - name: run pytest on tests run: pytest tests/ --verbose --capture=no --cov=src/senzing_abstract + + # - name: Run pytest on examples + # run: | + # export DYLD_LIBRARY_PATH=/opt/senzing/g2/lib:/opt/senzing/g2/lib/macos + # pytest examples/ --verbose --capture=no + + - name: rename coverage file + env: + COVERAGE_FILE: ".coverage.${{ matrix.python-version }}" + run: | + mv .coverage "$COVERAGE_FILE" + + - name: Store coverage file + uses: actions/upload-artifact@v4 + with: + name: coverage-${{ matrix.python-version }} + path: .coverage.${{ matrix.python-version }} + + coverage: + name: coverage + needs: pytest-darwin + permissions: + pull-requests: write + contents: write + uses: senzing-factory/build-resources/.github/workflows/python-coverage-comment.yaml@v1 diff --git a/.github/workflows/pytest-linux.yaml b/.github/workflows/pytest-linux.yaml index 069c4e3..b5a83fc 100644 --- a/.github/workflows/pytest-linux.yaml +++ b/.github/workflows/pytest-linux.yaml @@ -1,15 +1,19 @@ name: pytest linux -on: [push] +on: [push, pull_request] env: - PYTHONPATH: /home/runner/work/g2-sdk-python-abstract/g2-sdk-python-abstract/src + PYTHONPATH: /home/runner/work/sz-sdk-python-abstract/sz-sdk-python-abstract/src + +permissions: + contents: read jobs: pytest-linux: name: "pytest OS: ${{ matrix.os }}; Python ${{ matrix.python-version }}" runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: os: [ubuntu-latest] # python-version: ["3.8", "3.9", "3.10", "3.11"] @@ -31,4 +35,36 @@ jobs: python -m pip install psutil pytest pytest-cov pytest-schema - name: run pytest on tests - run: pytest tests/ --verbose --capture=no --cov=src/senzing_abstract + run: pytest tests/ --verbose --capture=no --cov=src/senzing_abstract --cov-append + + - name: run unittest on examples + run: | + python3 -m unittest \ + examples/szconfig/*.py \ + examples/szconfigmanager/*.py \ + examples/szdiagnostic/*.py \ + examples/szengine/*.py \ + examples/szproduct/*.py + + # - name: Run pytest on examples + # run: pytest examples/ --verbose --capture=no + + - name: rename coverage file + env: + COVERAGE_FILE: ".coverage.${{ matrix.python-version }}" + run: | + mv .coverage "$COVERAGE_FILE" + + - name: Store coverage file + uses: actions/upload-artifact@v4 + with: + name: coverage-${{ matrix.python-version }} + path: .coverage.${{ matrix.python-version }} + + coverage: + name: coverage + needs: pytest-linux + permissions: + pull-requests: write + contents: write + uses: senzing-factory/build-resources/.github/workflows/python-coverage-comment.yaml@v1 diff --git a/.github/workflows/pytest-windows.yaml b/.github/workflows/pytest-windows.yaml index c45c5e7..9a48de7 100644 --- a/.github/workflows/pytest-windows.yaml +++ b/.github/workflows/pytest-windows.yaml @@ -1,19 +1,23 @@ name: pytest windows -on: [push] +on: [pull_request, workflow_dispatch] env: - PYTHONPATH: /Users/runner/work/g2-sdk-python-abstract/g2-sdk-python-abstract/src + PYTHONPATH: 'D:\a\sz-sdk-python-abstract\sz-sdk-python-abstract\src' + +permissions: + contents: read jobs: pytest-windows: name: "pytest OS: ${{ matrix.os }}; Python ${{ matrix.python-version }}" runs-on: ${{ matrix.os }} strategy: + fail-fast: false matrix: + os: [windows-latest] # python-version: ["3.8", "3.9", "3.10", "3.11"] python-version: ["3.8", "3.11"] - os: [windows-latest] steps: - name: checkout repository @@ -24,5 +28,31 @@ jobs: with: python-version: ${{ matrix.python-version }} - # - name: run pytest on tests - # run: pytest tests/ --verbose --capture=no --cov=src/senzing_abstract + - name: install dependencies + run: | + python -m pip install --upgrade pip + python -m pip install --requirement requirements.txt + pip install psutil pytest pytest-cov pytest-schema + + - name: run pytest on tests + run: pytest tests/ --verbose --capture=no --cov=src/senzing_abstract + + - name: rename coverage file + env: + COVERAGE_FILE: ".coverage.${{ matrix.python-version }}" + run: | + Rename-Item -Path.coverage -NewName "$env:COVERAGE_FILE" + + - name: Store coverage file + uses: actions/upload-artifact@v4 + with: + name: coverage-${{ matrix.python-version }} + path: .coverage.${{ matrix.python-version }} + + coverage: + name: coverage + needs: pytest-windows + permissions: + pull-requests: write + contents: write + uses: senzing-factory/build-resources/.github/workflows/python-coverage-comment.yaml@v1 diff --git a/.github/workflows/python-code-quality.yaml b/.github/workflows/python-code-quality.yaml deleted file mode 100644 index 5b65a70..0000000 --- a/.github/workflows/python-code-quality.yaml +++ /dev/null @@ -1,44 +0,0 @@ -name: python code quality - -on: [push, pull_request] - -jobs: - python-code-quality: - name: 'code-quality Python ${{ matrix.python-version }}' - runs-on: ubuntu-latest - strategy: - matrix: - python-version: ['3.8', '3.11'] - - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install --requirement requirements.txt - python -m pip install black flake8 mypy psutil pylint pytest pytest_schema types-psutil types-protobuf - - - name: black testing - run: | - # shellcheck disable=SC2046 - black --diff --check $(git ls-files '*.py' ':!:docs/source/*') - - - name: pylint testing - run: | - # shellcheck disable=SC2046 - pylint $(git ls-files '*.py' ':!:docs/source/*') - - - name: flake8 testing - run: | - # shellcheck disable=SC2046 - flake8 $(git ls-files '*.py' ':!:docs/source/*') - - - name: mypy testing - run: | - # shellcheck disable=SC2046 - mypy --follow-imports skip --strict $(git ls-files '*.py' ':!:docs/source/*') diff --git a/.github/workflows/unittest-linux.yaml b/.github/workflows/unittest-linux.yaml deleted file mode 100644 index 3dbedbd..0000000 --- a/.github/workflows/unittest-linux.yaml +++ /dev/null @@ -1,34 +0,0 @@ -name: unittest linux - -on: [push] - -env: - PYTHONPATH: /home/runner/work/g2-sdk-python-abstract/g2-sdk-python-abstract/src - -jobs: - pytest-linux: - name: "pytest OS: ${{ matrix.os }}; Python ${{ matrix.python-version }}" - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest] - # python-version: ["3.8", "3.9", "3.10", "3.11"] - python-version: ["3.8", "3.11"] - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - - - name: install dependencies - run: | - python -m pip install --upgrade pip - python -m pip install --requirement requirements.txt - # python -m pip install psutil pytest pytest-cov pytest-schema - - - name: run pytest on tests - run: python3 -m unittest examples/g2config/*.py examples/g2configmgr/*.py examples/g2diagnostic/*.py examples/g2engine/*.py examples/g2product/*.py diff --git a/.project b/.project index 80104ad..1cbb68a 100644 --- a/.project +++ b/.project @@ -1,6 +1,6 @@ - g2-sdk-python-abstract + sz-sdk-python-abstract diff --git a/.pydevproject b/.pydevproject index 2b04565..ab5ee9e 100644 --- a/.pydevproject +++ b/.pydevproject @@ -1,5 +1,6 @@ - + + Default python interpreter - + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index f8a5d80..5c366cb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +## [0.1.0] - 2024-05-06 + +### Changed in 0.1.0 + +- Migrated from "g2" to "sz" + ## [0.0.4] - 2023-12-21 ### Changed in 0.0.4 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index f6f9f91..a8f1a17 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe ## Enforcement -Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at support@senzing.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. +Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at . The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately. Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 612cf2e..927c7c7 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -83,7 +83,7 @@ The variables are used throughout the installation procedure. ```console export GIT_ACCOUNT=senzing -export GIT_REPOSITORY=g2-sdk-python-abstract +export GIT_REPOSITORY=sz-sdk-python-abstract ``` Synthesize environment variables. diff --git a/Makefile b/Makefile index 52c9ef4..b386da4 100755 --- a/Makefile +++ b/Makefile @@ -58,8 +58,6 @@ hello-world: hello-world-osarch-specific .PHONY: dependencies dependencies: dependencies-osarch-specific - python3 -m pip install --upgrade pip - pip install build psutil pytest pytest-cov pytest-schema virtualenv # ----------------------------------------------------------------------------- # build @@ -83,32 +81,45 @@ publish-test: package .PHONY: test test: test-osarch-specific - @echo "--- Unit tests -------------------------------------------------------" - @pytest tests/ -vv --verbose --capture=no --cov=src/senzing_abstract --cov-report xml:coverage.xml -# @echo "--- Test examples ----------------------------------------------------" -# @pytest examples/ --verbose --capture=no --cov=src/senzing_abstract - @echo "--- Test examples using unittest -------------------------------------" - @python3 -m unittest \ - examples/g2config/*.py \ - examples/g2configmgr/*.py \ - examples/g2diagnostic/*.py \ - examples/g2engine/*.py \ - examples/g2product/*.py -.PHONY: pylint -pylint: - @pylint $(shell git ls-files '*.py' ':!:docs/source/*') +.PHONY: bandit +bandit: + @bandit $(shell git ls-files '*.py' ':!:docs/source/*' ':!:tests/*' ':!:tools/*') + + +.PHONY: coverage +coverage: coverage-osarch-specific + + +.PHONY: black +black: + @black $(shell git ls-files '*.py' ':!:docs/source/*' ':!:tests/*') + + +.PHONY: flake8 +flake8: + @flake8 $(shell git ls-files '*.py' ':!:docs/source/*') + + +.PHONY: isort +isort: + @isort $(shell git ls-files '*.py' ':!:docs/source/*') .PHONY: mypy mypy: - mypy --follow-imports skip --strict $(shell git ls-files '*.py') + @mypy --strict $(shell git ls-files '*.py' ':!:docs/source/*') + + +.PHONY: pylint +pylint: + @pylint $(shell git ls-files '*.py' ':!:docs/source/*') .PHONY: pytest pytest: - @pytest --cov=src/senzing_abstract --cov-report=xml tests + @pytest --cov=src/senzing_abstract --cov-report=xml $(shell git ls-files '*.py' ':!:docs/source/*') # ----------------------------------------------------------------------------- # Documentation diff --git a/README.md b/README.md index c653218..c8fda6c 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# g2-sdk-python-abstract +# sz-sdk-python-abstract -## :warning: WARNING: g2-sdk-python-abstract is still in development :warning: _ +## :warning: WARNING: sz-sdk-python-abstract is still in development :warning: _ At the moment, this is "work-in-progress" with Semantic Versions of `0.n.x`. Although it can be reviewed and commented on, @@ -8,7 +8,7 @@ the recommendation is not to use it yet. ## Synopsis -The Senzing `g2-sdk-python-abstract` package contains the abstract base class from which +The Senzing `sz-sdk-python-abstract` package contains the abstract base class from which implmentations of the Senzing Python SDK are derived. ## Overview @@ -20,4 +20,4 @@ implmentations of the Senzing Python SDK are derived. 1. [Development](docs/development.md) 1. [Errors](docs/errors.md) 1. [Examples](docs/examples.md) -1. [g2-sdk-python-abstract package reference](https://hub.senzing.com/g2-sdk-python-abstract/) +1. [sz-sdk-python-abstract package reference](https://hub.senzing.com/sz-sdk-python-abstract/) diff --git a/docs/README.md b/docs/README.md index 41c1d81..3ee2283 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,5 +1,5 @@ -# g2-sdk-python-abstract +# sz-sdk-python-abstract Placeholder for [GitHub pages](https://pages.github.com/). -See [https://hub.senzing.com/g2-sdk-python-abstract](https://hub.senzing.com/g2-sdk-python-abstract). +See [https://hub.senzing.com/sz-sdk-python-abstract](https://hub.senzing.com/sz-sdk-python-abstract). diff --git a/docs/development.md b/docs/development.md index 4d735d5..f0b2f13 100644 --- a/docs/development.md +++ b/docs/development.md @@ -1,6 +1,4 @@ -# g2-sdk-python-abstract development - -The following instructions are used when modifying and building the Docker image. +# sz-sdk-python-abstract development ## Prerequisites for development @@ -19,14 +17,114 @@ see [Environment Variables](https://github.com/senzing-garage/knowledge-base/blo 1. Set these environment variable values: ```console - export GIT_ACCOUNT=senzing - export GIT_REPOSITORY=g2-sdk-python-abstract + export GIT_ACCOUNT=senzing-garage + export GIT_REPOSITORY=sz-sdk-python-abstract export GIT_ACCOUNT_DIR=~/${GIT_ACCOUNT}.git export GIT_REPOSITORY_DIR="${GIT_ACCOUNT_DIR}/${GIT_REPOSITORY}" ``` 1. Using the environment variables values just set, follow steps in [clone-repository](https://github.com/senzing-garage/knowledge-base/blob/main/HOWTO/clone-repository.md) to install the Git repository. +## Install python test tools + +1. Individual tools + + ```console + python3 -m pip install \ + bandit \ + coverage \ + black \ + flake8 \ + mypy \ + pylint \ + pytest + ``` + +1. [Sphinx](https://github.com/senzing-garage/knowledge-base/blob/main/WHATIS/sphinx.md) tools + + ```console + python3 -m pip install \ + sphinx \ + sphinx-autodoc-typehints \ + sphinx-gallery \ + sphinx-jinja2-compat \ + sphinx-prompt \ + sphinx-rtd-theme \ + sphinx-tabs \ + sphinx-toolbox \ + sphinxcontrib-applehelp \ + sphinxcontrib-devhelp \ + sphinxcontrib-htmlhelp \ + sphinxcontrib-jquery \ + sphinxcontrib-jsmath \ + sphinxcontrib-qthelp \ + sphinxcontrib-serializinghtml + ``` + +## Running tests + +1. [Bandit] + + ```console + clear; make clean setup bandit + ``` + +1. [Black] + + ```console + clear; make clean setup black + ``` + +1. [Flake8] + + ```console + clear; make clean setup flake8 + ``` + +1. [Isort] + + ```console + clear; make clean setup isort + ``` + +1. [Mypy] + + ```console + clear; make clean setup mypy + ``` + +1. [Pylint] + + ```console + clear; make clean setup pylint + ``` + +1. [Pytest] and [Coverage] + + ```console + clear; make clean setup pytest coverage + ``` + +1. Test + + ```console + clear; make clean setup test + ``` + +1. (Optional) Run all + + ```console + clear + make clean setup bandit + make clean setup black + make clean setup flake8 + make clean setup isort + make clean setup mypy + make clean setup pylint + make clean setup pytest coverage + make clean setup test + ``` + ## Working with Python wheel file 1. Build the `wheel` file for distribution. @@ -41,7 +139,7 @@ see [Environment Variables](https://github.com/senzing-garage/knowledge-base/blo Example: ```console - python3 -m pip freeze | grep senzing-abstract + python3 -m pip freeze | grep -e senzing-abstract -e senzing_abstract ``` Nothing is returned. @@ -57,11 +155,11 @@ see [Environment Variables](https://github.com/senzing-garage/knowledge-base/blo Example: ```console - python3 -m pip freeze | grep senzing-abstract + python3 -m pip freeze | grep -e senzing-abstract -e senzing_abstract ``` Example return: - > senzing-abstract @ file:///home/senzing/senzing.git/g2-sdk-python-abstract/dist/senzing_abstract-0.0.1-py3-none-any.whl#sha256=2a4e5218d66d5be60ee31bfad5943e6611fc921f28a4326d9594ceceae7e0ac1 + > senzing-abstract @ file:///home/senzing/senzing-garage.git/sz-sdk-python-abstract/dist/senzing_abstract-0.0.1-py3-none-any.whl#sha256=2a4e5218d66d5be60ee31bfad5943e6611fc921f28a4326d9594ceceae7e0ac1 1. Uninstall the `senzing-abstract` python package. Example: @@ -69,3 +167,25 @@ see [Environment Variables](https://github.com/senzing-garage/knowledge-base/blo ```console python3 -m pip uninstall senzing-abstract ``` + +## References + +1. [Bandit] +1. [Black] +1. [Coverage] +1. [Flake8] +1. [Isort] +1. [Mypy] +1. [Pylint] +1. [Pytest] +1. [Sphinx] + +[Bandit]: https://github.com/senzing-garage/knowledge-base/blob/main/WHATIS/bandit.md +[Black]: https://github.com/senzing-garage/knowledge-base/blob/main/WHATIS/black.md +[Coverage]: https://github.com/senzing-garage/knowledge-base/blob/main/WHATIS/coverage.md +[Flake8]: https://github.com/senzing-garage/knowledge-base/blob/main/WHATIS/flake8.md +[Isort]: https://github.com/senzing-garage/knowledge-base/blob/main/WHATIS/isort.md +[Mypy]: https://github.com/senzing-garage/knowledge-base/blob/main/WHATIS/mypy.md +[Pylint]: https://github.com/senzing-garage/knowledge-base/blob/main/WHATIS/pylint.md +[Pytest]: https://github.com/senzing-garage/knowledge-base/blob/main/WHATIS/pytest.md +[Sphinx]: https://github.com/senzing-garage/knowledge-base/blob/main/WHATIS/sphinx.md diff --git a/docs/errors.md b/docs/errors.md index 0740ce3..0f7f2a2 100644 --- a/docs/errors.md +++ b/docs/errors.md @@ -1 +1 @@ -# g2-sdk-python-abstract errors +# sz-sdk-python-abstract errors diff --git a/docs/examples.md b/docs/examples.md index 1b68e6a..4519090 100644 --- a/docs/examples.md +++ b/docs/examples.md @@ -1 +1 @@ -# g2-sdk-python-abstract examples +# sz-sdk-python-abstract examples diff --git a/docs/source/conf.py b/docs/source/conf.py index 164eabb..b522e75 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -9,8 +9,8 @@ import os import sys -project = "g2-sdk-python-abstract" -copyright = "2023, senzing" +project = "sz-sdk-python-abstract" +copyright = "2024, Senzing" author = "senzing" # -- General configuration --------------------------------------------------- diff --git a/docs/source/index.rst b/docs/source/index.rst index aac9ce8..d596d80 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,15 +1,17 @@ -.. g2-sdk-python-abstract documentation master file, created by +.. sz-sdk-python-abstract documentation master file, created by sphinx-quickstart on Thu Dec 14 15:35:47 2023. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to g2-sdk-python-abstract's documentation! +Welcome to sz-sdk-python-abstract's documentation! ================================================== .. toctree:: :maxdepth: 2 :caption: Contents: + modules + Indices and tables diff --git a/docs/source/senzing_abstract.rst b/docs/source/senzing_abstract.rst index 791ac2c..eadb168 100644 --- a/docs/source/senzing_abstract.rst +++ b/docs/source/senzing_abstract.rst @@ -4,58 +4,58 @@ senzing\_abstract package Submodules ---------- -senzing\_abstract.g2config\_abstract module +senzing\_abstract.szconfig\_abstract module ------------------------------------------- -.. automodule:: senzing_abstract.g2config_abstract +.. automodule:: senzing_abstract.szconfig_abstract :members: :undoc-members: :show-inheritance: -senzing\_abstract.g2configmgr\_abstract module ----------------------------------------------- +senzing\_abstract.szconfigmanager\_abstract module +-------------------------------------------------- -.. automodule:: senzing_abstract.g2configmgr_abstract +.. automodule:: senzing_abstract.szconfigmanager_abstract :members: :undoc-members: :show-inheritance: -senzing\_abstract.g2diagnostic\_abstract module +senzing\_abstract.szdiagnostic\_abstract module ----------------------------------------------- -.. automodule:: senzing_abstract.g2diagnostic_abstract +.. automodule:: senzing_abstract.szdiagnostic_abstract :members: :undoc-members: :show-inheritance: -senzing\_abstract.g2engine\_abstract module +senzing\_abstract.szengine\_abstract module ------------------------------------------- -.. automodule:: senzing_abstract.g2engine_abstract +.. automodule:: senzing_abstract.szengine_abstract :members: :undoc-members: :show-inheritance: -senzing\_abstract.g2engineflags module +senzing\_abstract.szengineflags module -------------------------------------- -.. automodule:: senzing_abstract.g2engineflags +.. automodule:: senzing_abstract.szengineflags :members: :undoc-members: :show-inheritance: -senzing\_abstract.g2hasher\_abstract module +senzing\_abstract.szhasher\_abstract module ------------------------------------------- -.. automodule:: senzing_abstract.g2hasher_abstract +.. automodule:: senzing_abstract.szhasher_abstract :members: :undoc-members: :show-inheritance: -senzing\_abstract.g2product\_abstract module +senzing\_abstract.szproduct\_abstract module -------------------------------------------- -.. automodule:: senzing_abstract.g2product_abstract +.. automodule:: senzing_abstract.szproduct_abstract :members: :undoc-members: :show-inheritance: diff --git a/examples/g2configmgr/get_config.txt b/examples/g2configmgr/get_config.txt deleted file mode 100644 index a7185d2..0000000 --- a/examples/g2configmgr/get_config.txt +++ /dev/null @@ -1,46 +0,0 @@ -// Output has been formatted and pruned for easier reading. - -{ - "G2_CONFIG": { - "CFG_ATTR": [], - "CFG_CFBOM": [], - "CFG_CFCALL": [], - "CFG_CFRTN": [], - "CFG_CFUNC": [], - "CFG_DFBOM": [], - "CFG_DFCALL": [], - "CFG_DFUNC": [], - "CFG_DSRC": [], - "CFG_DSRC_INTEREST": [], - "CFG_ECLASS": [], - "CFG_EFBOM": [], - "CFG_EFCALL": [], - "CFG_EFUNC": [], - "CFG_ERFRAG": [], - "CFG_ERRULE": [], - "CFG_ETYPE": [], - "CFG_FBOM": [], - "CFG_FBOVR": [] - "CFG_FCLASS": [], - "CFG_FELEM": [], - "CFG_FTYPE": [], - "CFG_GENERIC_THRESHOLD": [], - "CFG_GPLAN": [], - "CFG_LENS": [], - "CFG_LENSRL": [], - "CFG_RCLASS": [], - "CFG_RTYPE": [], - "CFG_SFCALL": [], - "CFG_SFUNC": [], - "SYS_OOM": [], - "CONFIG_BASE_VERSION": { - "VERSION": "4.0.0", - "BUILD_VERSION": "4.0.0.00000", - "BUILD_DATE": "2024-01-01", - "BUILD_NUMBER": "00000", - "COMPATIBILITY_VERSION": { - "CONFIG_VERSION": "10" - } - } - } -} \ No newline at end of file diff --git a/examples/g2diagnostic/check_db_perf.txt b/examples/g2diagnostic/check_db_perf.txt deleted file mode 100644 index 2c5a295..0000000 --- a/examples/g2diagnostic/check_db_perf.txt +++ /dev/null @@ -1,6 +0,0 @@ -// Just example numbers. Your mileage may vary. - -{ - "numRecordsInserted": 200000, - "insertTime": 3000 -} \ No newline at end of file diff --git a/examples/g2diagnostic/get_db_info.txt b/examples/g2diagnostic/get_db_info.txt deleted file mode 100644 index a141edd..0000000 --- a/examples/g2diagnostic/get_db_info.txt +++ /dev/null @@ -1,9 +0,0 @@ -{ - "Hybrid Mode": false, - "Database Details": [ - { - "Name": "/tmp/sqlite/G2C.db", - "Type": "sqlite3" - } - ] -} \ No newline at end of file diff --git a/examples/g2engine/add_record_with_info.txt b/examples/g2engine/add_record_with_info.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/delete_record_with_info.txt b/examples/g2engine/delete_record_with_info.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/export_config.txt b/examples/g2engine/export_config.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/export_config_and_config_id.txt b/examples/g2engine/export_config_and_config_id.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/export_csv_fetch_close.txt b/examples/g2engine/export_csv_fetch_close.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/export_json_fetch_close.txt b/examples/g2engine/export_json_fetch_close.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/find_network_by_entity_id.txt b/examples/g2engine/find_network_by_entity_id.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/find_network_by_entity_id_v2.txt b/examples/g2engine/find_network_by_entity_id_v2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/find_network_by_record_id.txt b/examples/g2engine/find_network_by_record_id.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/find_network_by_record_id_v2.txt b/examples/g2engine/find_network_by_record_id_v2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/find_path_by_entity_id.txt b/examples/g2engine/find_path_by_entity_id.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/find_path_by_entity_id_v2.txt b/examples/g2engine/find_path_by_entity_id_v2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/find_path_by_record_id.txt b/examples/g2engine/find_path_by_record_id.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/find_path_by_record_id_v2.txt b/examples/g2engine/find_path_by_record_id_v2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/find_path_excluding_by_entity_id.txt b/examples/g2engine/find_path_excluding_by_entity_id.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/find_path_excluding_by_entity_id_v2.py b/examples/g2engine/find_path_excluding_by_entity_id_v2.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/find_path_excluding_by_entity_id_v2.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/find_path_excluding_by_entity_id_v2.txt b/examples/g2engine/find_path_excluding_by_entity_id_v2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/find_path_excluding_by_record_id.py b/examples/g2engine/find_path_excluding_by_record_id.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/find_path_excluding_by_record_id.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/find_path_excluding_by_record_id.txt b/examples/g2engine/find_path_excluding_by_record_id.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/find_path_excluding_by_record_id_v2.py b/examples/g2engine/find_path_excluding_by_record_id_v2.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/find_path_excluding_by_record_id_v2.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/find_path_excluding_by_record_id_v2.txt b/examples/g2engine/find_path_excluding_by_record_id_v2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/find_path_including_source_by_entity_id.py b/examples/g2engine/find_path_including_source_by_entity_id.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/find_path_including_source_by_entity_id.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/find_path_including_source_by_entity_id.txt b/examples/g2engine/find_path_including_source_by_entity_id.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/find_path_including_source_by_entity_id_v2.py b/examples/g2engine/find_path_including_source_by_entity_id_v2.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/find_path_including_source_by_entity_id_v2.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/find_path_including_source_by_entity_id_v2.txt b/examples/g2engine/find_path_including_source_by_entity_id_v2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/find_path_including_source_by_record_id.py b/examples/g2engine/find_path_including_source_by_record_id.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/find_path_including_source_by_record_id.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/find_path_including_source_by_record_id.txt b/examples/g2engine/find_path_including_source_by_record_id.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/find_path_including_source_by_record_id_v2.py b/examples/g2engine/find_path_including_source_by_record_id_v2.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/find_path_including_source_by_record_id_v2.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/find_path_including_source_by_record_id_v2.txt b/examples/g2engine/find_path_including_source_by_record_id_v2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/g2engine_constructor.py b/examples/g2engine/g2engine_constructor.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/g2engine_constructor.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/g2engine_init_and_destroy.py b/examples/g2engine/g2engine_init_and_destroy.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/g2engine_init_and_destroy.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/g2engine_init_with_config_id.py b/examples/g2engine/g2engine_init_with_config_id.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/g2engine_init_with_config_id.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/g2engine_reinit.py b/examples/g2engine/g2engine_reinit.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/g2engine_reinit.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/get_active_config_id.txt b/examples/g2engine/get_active_config_id.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/get_entity_by_entity_id.txt b/examples/g2engine/get_entity_by_entity_id.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/get_entity_by_entity_id_v2.py b/examples/g2engine/get_entity_by_entity_id_v2.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/get_entity_by_entity_id_v2.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/get_entity_by_entity_id_v2.txt b/examples/g2engine/get_entity_by_entity_id_v2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/get_entity_by_record_id.txt b/examples/g2engine/get_entity_by_record_id.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/get_entity_by_record_id_v2.py b/examples/g2engine/get_entity_by_record_id_v2.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/get_entity_by_record_id_v2.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/get_entity_by_record_id_v2.txt b/examples/g2engine/get_entity_by_record_id_v2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/get_record.txt b/examples/g2engine/get_record.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/get_record_v2.py b/examples/g2engine/get_record_v2.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/get_record_v2.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/get_record_v2.txt b/examples/g2engine/get_record_v2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/get_redo_record.txt b/examples/g2engine/get_redo_record.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/get_repository_last_modified_time.py b/examples/g2engine/get_repository_last_modified_time.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/get_repository_last_modified_time.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/get_repository_last_modified_time.txt b/examples/g2engine/get_repository_last_modified_time.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/get_virtual_entity_by_record_id.txt b/examples/g2engine/get_virtual_entity_by_record_id.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/get_virtual_entity_by_record_id_v2.py b/examples/g2engine/get_virtual_entity_by_record_id_v2.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/get_virtual_entity_by_record_id_v2.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/get_virtual_entity_by_record_id_v2.txt b/examples/g2engine/get_virtual_entity_by_record_id_v2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/how_entity_by_entity_id.txt b/examples/g2engine/how_entity_by_entity_id.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/how_entity_by_entity_id_v2.py b/examples/g2engine/how_entity_by_entity_id_v2.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/how_entity_by_entity_id_v2.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/how_entity_by_entity_id_v2.txt b/examples/g2engine/how_entity_by_entity_id_v2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/process_with_info.py b/examples/g2engine/process_with_info.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/process_with_info.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/process_with_info.txt b/examples/g2engine/process_with_info.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/reevaluate_entity_with_info.py b/examples/g2engine/reevaluate_entity_with_info.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/reevaluate_entity_with_info.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/reevaluate_entity_with_info.txt b/examples/g2engine/reevaluate_entity_with_info.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/reevaluate_record_with_info.py b/examples/g2engine/reevaluate_record_with_info.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/reevaluate_record_with_info.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/reevaluate_record_with_info.txt b/examples/g2engine/reevaluate_record_with_info.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/replace_record.py b/examples/g2engine/replace_record.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/replace_record.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/replace_record_with_info.py b/examples/g2engine/replace_record_with_info.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/replace_record_with_info.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/replace_record_with_info.txt b/examples/g2engine/replace_record_with_info.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/search_by_attributes.txt b/examples/g2engine/search_by_attributes.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/search_by_attributes_v2.py b/examples/g2engine/search_by_attributes_v2.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/search_by_attributes_v2.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/search_by_attributes_v2.txt b/examples/g2engine/search_by_attributes_v2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/search_by_attributes_v3.py b/examples/g2engine/search_by_attributes_v3.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/search_by_attributes_v3.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/search_by_attributes_v3.txt b/examples/g2engine/search_by_attributes_v3.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/stats.py b/examples/g2engine/stats.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/stats.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/stats.txt b/examples/g2engine/stats.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/why_entities.txt b/examples/g2engine/why_entities.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/why_entities_v2.py b/examples/g2engine/why_entities_v2.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/why_entities_v2.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/why_entities_v2.txt b/examples/g2engine/why_entities_v2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/why_entity_by_entity_id.py b/examples/g2engine/why_entity_by_entity_id.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/why_entity_by_entity_id.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/why_entity_by_entity_id.txt b/examples/g2engine/why_entity_by_entity_id.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/why_entity_by_entity_id_v2.py b/examples/g2engine/why_entity_by_entity_id_v2.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/why_entity_by_entity_id_v2.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/why_entity_by_entity_id_v2.txt b/examples/g2engine/why_entity_by_entity_id_v2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/why_entity_by_record_id.py b/examples/g2engine/why_entity_by_record_id.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/why_entity_by_record_id.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/why_entity_by_record_id.txt b/examples/g2engine/why_entity_by_record_id.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/why_entity_by_record_id_v2.py b/examples/g2engine/why_entity_by_record_id_v2.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2engine/why_entity_by_record_id_v2.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2engine/why_entity_by_record_id_v2.txt b/examples/g2engine/why_entity_by_record_id_v2.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2engine/why_records.txt b/examples/g2engine/why_records.txt deleted file mode 100644 index e69de29..0000000 diff --git a/examples/g2product/g2product_constructor.py b/examples/g2product/g2product_constructor.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2product/g2product_constructor.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2product/g2product_init_and_destroy.py b/examples/g2product/g2product_init_and_destroy.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2product/g2product_init_and_destroy.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2product/license.py b/examples/g2product/license.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2product/license.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2product/version.py b/examples/g2product/version.py deleted file mode 100755 index 21ab5da..0000000 --- a/examples/g2product/version.py +++ /dev/null @@ -1 +0,0 @@ -#! /usr/bin/env python3 diff --git a/examples/g2product/version.txt b/examples/g2product/version.txt deleted file mode 100644 index bd9e475..0000000 --- a/examples/g2product/version.txt +++ /dev/null @@ -1,17 +0,0 @@ -// Output has been formatted for easier reading. - -{ - "PRODUCT_NAME": "Senzing API", - "VERSION": "3.8.0", - "BUILD_VERSION": "3.8.0.23303", - "BUILD_DATE": "2023-10-30", - "BUILD_NUMBER": "2023_10_30__10_45", - "COMPATIBILITY_VERSION": { - "CONFIG_VERSION": "10" - }, - "SCHEMA_VERSION": { - "ENGINE_SCHEMA_VERSION": "3.8", - "MINIMUM_REQUIRED_SCHEMA_VERSION": "3.0", - "MAXIMUM_REQUIRED_SCHEMA_VERSION": "3.99" - } -} \ No newline at end of file diff --git a/examples/g2config/add_data_source.py b/examples/szconfig/add_data_source.py similarity index 100% rename from examples/g2config/add_data_source.py rename to examples/szconfig/add_data_source.py diff --git a/examples/g2config/add_data_source.txt b/examples/szconfig/add_data_source.txt similarity index 100% rename from examples/g2config/add_data_source.txt rename to examples/szconfig/add_data_source.txt diff --git a/examples/g2config/create_and_close.py b/examples/szconfig/create_and_close.py similarity index 100% rename from examples/g2config/create_and_close.py rename to examples/szconfig/create_and_close.py diff --git a/examples/g2config/create_save_load_close.py b/examples/szconfig/create_export_import_close.py similarity index 100% rename from examples/g2config/create_save_load_close.py rename to examples/szconfig/create_export_import_close.py diff --git a/examples/g2config/delete_data_source.py b/examples/szconfig/delete_data_source.py similarity index 100% rename from examples/g2config/delete_data_source.py rename to examples/szconfig/delete_data_source.py diff --git a/examples/g2engine/export_config.py b/examples/szconfig/export_config.py similarity index 100% rename from examples/g2engine/export_config.py rename to examples/szconfig/export_config.py diff --git a/examples/g2config/save.txt b/examples/szconfig/export_config.txt similarity index 100% rename from examples/g2config/save.txt rename to examples/szconfig/export_config.txt diff --git a/examples/g2config/g2config_constructor.py b/examples/szconfig/get_data_sources.py similarity index 100% rename from examples/g2config/g2config_constructor.py rename to examples/szconfig/get_data_sources.py diff --git a/examples/g2config/list_data_sources.txt b/examples/szconfig/get_data_sources.txt similarity index 100% rename from examples/g2config/list_data_sources.txt rename to examples/szconfig/get_data_sources.txt diff --git a/examples/g2config/g2config_init_and_destroy.py b/examples/szconfig/import_config.py similarity index 100% rename from examples/g2config/g2config_init_and_destroy.py rename to examples/szconfig/import_config.py diff --git a/examples/g2config/list_data_sources.py b/examples/szconfig/szconfig_constructor.py similarity index 100% rename from examples/g2config/list_data_sources.py rename to examples/szconfig/szconfig_constructor.py diff --git a/examples/g2config/load.py b/examples/szconfig/szconfig_initialize_and_destroy.py similarity index 100% rename from examples/g2config/load.py rename to examples/szconfig/szconfig_initialize_and_destroy.py diff --git a/examples/g2configmgr/add_config.py b/examples/szconfigmanager/add_config.py similarity index 100% rename from examples/g2configmgr/add_config.py rename to examples/szconfigmanager/add_config.py diff --git a/examples/g2configmgr/get_config.py b/examples/szconfigmanager/get_config.py similarity index 100% rename from examples/g2configmgr/get_config.py rename to examples/szconfigmanager/get_config.py diff --git a/examples/szconfigmanager/get_config.txt b/examples/szconfigmanager/get_config.txt new file mode 100644 index 0000000..07d25c6 --- /dev/null +++ b/examples/szconfigmanager/get_config.txt @@ -0,0 +1,268 @@ +// Output has been formatted and pruned for easier reading. + +{ + "G2_CONFIG": { + "CFG_ATTR": [ + { + "ATTR_ID": 1001, + "ATTR_CODE": "DATA_SOURCE", + "ATTR_CLASS": "OBSERVATION", + "FTYPE_CODE": null, + "FELEM_CODE": null, + "FELEM_REQ": "Yes", + "DEFAULT_VALUE": null, + "INTERNAL": "No" + } + ], + "CFG_CFBOM": [ + { + "CFCALL_ID": 1, + "FTYPE_ID": 1, + "FELEM_ID": 2, + "EXEC_ORDER": 1 + } + ], + "CFG_CFCALL": [ + { + "CFCALL_ID": 1, + "FTYPE_ID": 1, + "CFUNC_ID": 2 + } + ], + "CFG_CFRTN": [ + { + "CFRTN_ID": 1, + "CFUNC_ID": 1, + "FTYPE_ID": 0, + "CFUNC_RTNVAL": "FULL_SCORE", + "EXEC_ORDER": 1, + "SAME_SCORE": 100, + "CLOSE_SCORE": 90, + "LIKELY_SCORE": 80, + "PLAUSIBLE_SCORE": 70, + "UN_LIKELY_SCORE": 60 + } + ], + "CFG_CFUNC": [ + { + "CFUNC_ID": 1, + "CFUNC_CODE": "STR_COMP", + "CFUNC_DESC": "String comparison", + "CONNECT_STR": "g2StringComp", + "ANON_SUPPORT": "Yes", + "LANGUAGE": null, + "JAVA_CLASS_NAME": null + } + ], + "CFG_DFBOM": [ + { + "DFCALL_ID": 1, + "FTYPE_ID": 1, + "FELEM_ID": 2, + "EXEC_ORDER": 1 + } + ], + "CFG_DFCALL": [ + { + "DFCALL_ID": 1, + "FTYPE_ID": 1, + "DFUNC_ID": 5 + } + ], + "CFG_DFUNC": [ + { + "DFUNC_ID": 1, + "DFUNC_CODE": "FELEM_STRICT_SUBSET", + "DFUNC_DESC": "Strict subset of felems", + "CONNECT_STR": "g2StrictSubsetFelems", + "ANON_SUPPORT": "Yes", + "LANGUAGE": null, + "JAVA_CLASS_NAME": null + } + ], + "CFG_DSRC": [ + { + "DSRC_ID": 1, + "DSRC_CODE": "TEST", + "DSRC_DESC": "Test", + "RETENTION_LEVEL": "Remember" + } + ], + "CFG_DSRC_INTEREST": [], + "CFG_EFBOM": [ + { + "EFCALL_ID": 1, + "FTYPE_ID": 6, + "FELEM_ID": 60, + "EXEC_ORDER": 1, + "FELEM_REQ": "Yes" + } + ], + "CFG_EFCALL": [ + { + "EFCALL_ID": 1, + "FTYPE_ID": 6, + "FELEM_ID": -1, + "EFUNC_ID": 4, + "EXEC_ORDER": 1, + "EFEAT_FTYPE_ID": -1, + "IS_VIRTUAL": "No" + } + ], + "CFG_EFUNC": [ + { + "EFUNC_ID": 1, + "EFUNC_CODE": "EXPRESS_BOM", + "EFUNC_DESC": "General BOM Hasher", + "CONNECT_STR": "g2GenericHasher", + "LANGUAGE": null, + "JAVA_CLASS_NAME": null + } + ], + "CFG_ERFRAG": [ + { + "ERFRAG_ID": 10, + "ERFRAG_CODE": "TRUSTED_ID", + "ERFRAG_DESC": "TRUSTED_ID", + "ERFRAG_SOURCE": "./SCORES/TRUSTED_ID[./FULL_SCORE=100]", + "ERFRAG_DEPENDS": null + } + ], + "CFG_ERRULE": [ + { + "ERRULE_ID": 100, + "ERRULE_CODE": "SAME_A1", + "RESOLVE": "Yes", + "RELATE": "No", + "RTYPE_ID": 1, + "QUAL_ERFRAG_CODE": "SAME_A1", + "DISQ_ERFRAG_CODE": null, + "ERRULE_TIER": 10 + } + ], + "CFG_FBOM": [ + { + "FTYPE_ID": 1, + "FELEM_ID": 2, + "EXEC_ORDER": 1, + "DISPLAY_LEVEL": 1, + "DISPLAY_DELIM": null, + "DERIVED": "No" + } + ], + "CFG_FBOVR": [ + { + "FTYPE_ID": 5, + "UTYPE_CODE": "BUSINESS", + "FTYPE_FREQ": "FF", + "FTYPE_EXCL": "Yes", + "FTYPE_STAB": "No" + } + ], + "CFG_FCLASS": [ + { + "FCLASS_ID": 1, + "FCLASS_CODE": "NAME", + "FCLASS_DESC": "Name" + } + ], + "CFG_FELEM": [ + { + "FELEM_ID": 2, + "FELEM_CODE": "FULL_NAME", + "FELEM_DESC": "Full name", + "DATA_TYPE": "string" + } + ], + "CFG_FTYPE": [ + { + "FTYPE_ID": 1, + "FTYPE_CODE": "NAME", + "FTYPE_DESC": "Name", + "FCLASS_ID": 1, + "FTYPE_FREQ": "NAME", + "FTYPE_EXCL": "No", + "FTYPE_STAB": "No", + "PERSIST_HISTORY": "Yes", + "USED_FOR_CAND": "No", + "DERIVED": "No", + "RTYPE_ID": 0, + "ANONYMIZE": "No", + "VERSION": 2, + "SHOW_IN_MATCH_KEY": "Yes" + } + ], + "CFG_GENERIC_THRESHOLD": [ + { + "GPLAN_ID": 1, + "BEHAVIOR": "NAME", + "FTYPE_ID": 0, + "CANDIDATE_CAP": 10, + "SCORING_CAP": -1, + "SEND_TO_REDO": "Yes" + } + ], + "CFG_GPLAN": [ + { + "GPLAN_ID": 1, + "GPLAN_CODE": "INGEST", + "GPLAN_DESC": "Standard Ingestion" + } + ], + "CFG_RCLASS": [ + { + "RCLASS_ID": 1, + "RCLASS_CODE": "DERIVED", + "RCLASS_DESC": "Derived", + "IS_DISCLOSED": "No" + } + ], + "CFG_RTYPE": [ + { + "RTYPE_ID": 1, + "RTYPE_CODE": "RESOLVED", + "RTYPE_DESC": "Resolved", + "RCLASS_ID": 1, + "BREAK_RES": "No" + } + ], + "CFG_SFCALL": [ + { + "SFCALL_ID": 1, + "FTYPE_ID": 1, + "FELEM_ID": -1, + "SFUNC_ID": 1, + "EXEC_ORDER": 1 + } + ], + "CFG_SFUNC": [ + { + "SFUNC_ID": 1, + "SFUNC_CODE": "PARSE_NAME", + "SFUNC_DESC": "Parse name", + "CONNECT_STR": "g2ParseName", + "LANGUAGE": null, + "JAVA_CLASS_NAME": null + } + ], + "SYS_OOM": [ + { + "OOM_TYPE": "RF", + "OOM_LEVEL": "SYSDEFAULT", + "FTYPE_ID": 0, + "THRESH1_CNT": 100, + "THRESH1_OOM": 10, + "NEXT_THRESH": 1000 + } + ], + "CONFIG_BASE_VERSION": { + "VERSION": "4.0.0", + "BUILD_VERSION": "4.0.0.24103", + "BUILD_DATE": "2024-04-12", + "BUILD_NUMBER": "24103", + "COMPATIBILITY_VERSION": { + "CONFIG_VERSION": "11" + } + } + } +} \ No newline at end of file diff --git a/examples/g2configmgr/get_config_list.py b/examples/szconfigmanager/get_config_list.py similarity index 100% rename from examples/g2configmgr/get_config_list.py rename to examples/szconfigmanager/get_config_list.py diff --git a/examples/g2configmgr/get_config_list.txt b/examples/szconfigmanager/get_config_list.txt similarity index 72% rename from examples/g2configmgr/get_config_list.txt rename to examples/szconfigmanager/get_config_list.txt index e4f5c34..25550a7 100644 --- a/examples/g2configmgr/get_config_list.txt +++ b/examples/szconfigmanager/get_config_list.txt @@ -5,12 +5,12 @@ { "CONFIG_ID": 41320074, "CONFIG_COMMENTS": "Default Senzing configuration", - "SYS_CREATE_DT": "2023-02-16 16:03:40.338" + "SYS_CREATE_DT": "YYYY-MM-DD HH:MM:SS.mmm" }, { "CONFIG_ID": 490826130, "CONFIG_COMMENTS": "Test", - "SYS_CREATE_DT": "2023-11-09 19:13:30.923" + "SYS_CREATE_DT": "YYYY-MM-DD HH:MM:SS.mmm" } ] } \ No newline at end of file diff --git a/examples/g2configmgr/get_default_config_id.py b/examples/szconfigmanager/get_default_config_id.py similarity index 100% rename from examples/g2configmgr/get_default_config_id.py rename to examples/szconfigmanager/get_default_config_id.py diff --git a/examples/g2configmgr/replace_default_config_id.py b/examples/szconfigmanager/replace_default_config_id.py similarity index 100% rename from examples/g2configmgr/replace_default_config_id.py rename to examples/szconfigmanager/replace_default_config_id.py diff --git a/examples/g2configmgr/set_default_config_id.py b/examples/szconfigmanager/set_default_config_id.py similarity index 100% rename from examples/g2configmgr/set_default_config_id.py rename to examples/szconfigmanager/set_default_config_id.py diff --git a/examples/g2config/save.py b/examples/szconfigmanager/szconfigmanager_constructor.py similarity index 100% rename from examples/g2config/save.py rename to examples/szconfigmanager/szconfigmanager_constructor.py diff --git a/examples/g2configmgr/g2configmgr_constructor.py b/examples/szconfigmanager/szconfigmanager_initialize_and_destroy.py similarity index 100% rename from examples/g2configmgr/g2configmgr_constructor.py rename to examples/szconfigmanager/szconfigmanager_initialize_and_destroy.py diff --git a/examples/g2configmgr/g2configmgr_init_and_destroy.py b/examples/szdiagnostic/check_datastore_performance.py similarity index 100% rename from examples/g2configmgr/g2configmgr_init_and_destroy.py rename to examples/szdiagnostic/check_datastore_performance.py diff --git a/examples/szdiagnostic/check_datastore_performance.txt b/examples/szdiagnostic/check_datastore_performance.txt new file mode 100644 index 0000000..1bfcaf4 --- /dev/null +++ b/examples/szdiagnostic/check_datastore_performance.txt @@ -0,0 +1,6 @@ +// Output has been formatted for easier reading. + +{ + "numRecordsInserted": 0, + "insertTime": 0 +} \ No newline at end of file diff --git a/examples/g2diagnostic/check_db_perf.py b/examples/szdiagnostic/get_datastore_info.py similarity index 100% rename from examples/g2diagnostic/check_db_perf.py rename to examples/szdiagnostic/get_datastore_info.py diff --git a/examples/szdiagnostic/get_datastore_info.txt b/examples/szdiagnostic/get_datastore_info.txt new file mode 100644 index 0000000..912a64e --- /dev/null +++ b/examples/szdiagnostic/get_datastore_info.txt @@ -0,0 +1,11 @@ +// Output has been formatted for easier reading. + +{ + "dataStores": [ + { + "id": "CORE", + "type": "sqlite3", + "location": "/tmp/sqlite/G2C.db" + } + ] +} \ No newline at end of file diff --git a/examples/g2diagnostic/g2diagnostic_constructor.py b/examples/szdiagnostic/get_feature.py similarity index 100% rename from examples/g2diagnostic/g2diagnostic_constructor.py rename to examples/szdiagnostic/get_feature.py diff --git a/examples/szdiagnostic/get_feature.txt b/examples/szdiagnostic/get_feature.txt new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/examples/szdiagnostic/get_feature.txt @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/examples/g2engine/purge_repository.py b/examples/szdiagnostic/purge_repository.py similarity index 100% rename from examples/g2engine/purge_repository.py rename to examples/szdiagnostic/purge_repository.py diff --git a/examples/g2diagnostic/g2diagnostic_init_and_destroy.py b/examples/szdiagnostic/szdiagnostic_constructor.py similarity index 100% rename from examples/g2diagnostic/g2diagnostic_init_and_destroy.py rename to examples/szdiagnostic/szdiagnostic_constructor.py diff --git a/examples/g2diagnostic/g2diagnostic_init_with_config_id.py b/examples/szdiagnostic/szdiagnostic_initialize_and_destroy.py similarity index 100% rename from examples/g2diagnostic/g2diagnostic_init_with_config_id.py rename to examples/szdiagnostic/szdiagnostic_initialize_and_destroy.py diff --git a/examples/g2diagnostic/g2diagnostic_reinit.py b/examples/szdiagnostic/szdiagnostic_initialize_with_config_id.py similarity index 100% rename from examples/g2diagnostic/g2diagnostic_reinit.py rename to examples/szdiagnostic/szdiagnostic_initialize_with_config_id.py diff --git a/examples/g2diagnostic/get_available_memory.py b/examples/szdiagnostic/szdiagnostic_reinitialize.py similarity index 100% rename from examples/g2diagnostic/get_available_memory.py rename to examples/szdiagnostic/szdiagnostic_reinitialize.py diff --git a/examples/g2engine/add_record.py b/examples/szengine/add_record.py similarity index 100% rename from examples/g2engine/add_record.py rename to examples/szengine/add_record.py diff --git a/examples/szengine/add_record.txt b/examples/szengine/add_record.txt new file mode 100644 index 0000000..485c9c8 --- /dev/null +++ b/examples/szengine/add_record.txt @@ -0,0 +1,10 @@ +// Output has been formatted for easier reading. + +{ + "DATA_SOURCE": "TEST", + "RECORD_ID": "1", + "AFFECTED_ENTITIES": [], + "INTERESTING_ENTITIES": { + "ENTITIES": [] + } +} \ No newline at end of file diff --git a/examples/g2engine/count_redo_records.py b/examples/szengine/count_redo_records.py similarity index 100% rename from examples/g2engine/count_redo_records.py rename to examples/szengine/count_redo_records.py diff --git a/examples/szengine/count_redo_records.txt b/examples/szengine/count_redo_records.txt new file mode 100644 index 0000000..d8263ee --- /dev/null +++ b/examples/szengine/count_redo_records.txt @@ -0,0 +1 @@ +2 \ No newline at end of file diff --git a/examples/g2engine/delete_record.py b/examples/szengine/delete_record.py similarity index 100% rename from examples/g2engine/delete_record.py rename to examples/szengine/delete_record.py diff --git a/examples/szengine/delete_record.txt b/examples/szengine/delete_record.txt new file mode 100644 index 0000000..89571d6 --- /dev/null +++ b/examples/szengine/delete_record.txt @@ -0,0 +1,14 @@ +// Output has been formatted for easier reading. + +{ + "DATA_SOURCE": "TEST", + "RECORD_ID": "1", + "AFFECTED_ENTITIES": [ + { + "ENTITY_ID": 1 + } + ], + "INTERESTING_ENTITIES": { + "ENTITIES": [] + } +} \ No newline at end of file diff --git a/examples/g2engine/export_csv_fetch_close.py b/examples/szengine/export_csv_fetch_close.py similarity index 100% rename from examples/g2engine/export_csv_fetch_close.py rename to examples/szengine/export_csv_fetch_close.py diff --git a/examples/szengine/export_csv_fetch_close.txt b/examples/szengine/export_csv_fetch_close.txt new file mode 100644 index 0000000..6fac94b --- /dev/null +++ b/examples/szengine/export_csv_fetch_close.txt @@ -0,0 +1,6 @@ +RESOLVED_ENTITY_ID,RESOLVED_ENTITY_NAME,RELATED_ENTITY_ID,MATCH_LEVEL,MATCH_KEY,IS_DISCLOSED,IS_AMBIGUOUS,DATA_SOURCE,RECORD_ID,JSON_DATA +1,"",0,0,"",0,0,"TEST","2","{}" +200001,"Robert Smith",0,0,"",0,0,"CUSTOMERS","1001","{""DATA_SOURCE"":""CUSTOMERS"",""RECORD_ID"":""1001"",""RECORD_TYPE"":""PERSON"",""PRIMARY_NAME_LAST"":""Smith"",""PRIMARY_NAME_FIRST"":""Robert"",""DATE_OF_BIRTH"":""12/11/1978"",""ADDR_TYPE"":""MAILING"",""ADDR_LINE1"":""123 Main Street, Las Vegas NV 89132"",""PHONE_TYPE"":""HOME"",""PHONE_NUMBER"":""702-919-1300"",""EMAIL_ADDRESS"":""bsmith@work.com"",""DATE"":""1/2/18"",""STATUS"":""Active"",""AMOUNT"":""100""}" +200001,"Robert Smith",0,1,"+NAME+DOB+PHONE",0,0,"CUSTOMERS","1002","{""DATA_SOURCE"":""CUSTOMERS"",""RECORD_ID"":""1002"",""RECORD_TYPE"":""PERSON"",""PRIMARY_NAME_LAST"":""Smith"",""PRIMARY_NAME_FIRST"":""Bob"",""DATE_OF_BIRTH"":""11/12/1978"",""ADDR_TYPE"":""HOME"",""ADDR_LINE1"":""1515 Adela Lane"",""ADDR_CITY"":""Las Vegas"",""ADDR_STATE"":""NV"",""ADDR_POSTAL_CODE"":""89111"",""PHONE_TYPE"":""MOBILE"",""PHONE_NUMBER"":""702-919-1300"",""DATE"":""3/10/17"",""STATUS"":""Inactive"",""AMOUNT"":""200""}" +200001,"Robert Smith",0,1,"+NAME+DOB+EMAIL",0,0,"CUSTOMERS","1003","{""DATA_SOURCE"":""CUSTOMERS"",""RECORD_ID"":""1003"",""RECORD_TYPE"":""PERSON"",""PRIMARY_NAME_LAST"":""Smith"",""PRIMARY_NAME_FIRST"":""Bob"",""PRIMARY_NAME_MIDDLE"":""J"",""DATE_OF_BIRTH"":""12/11/1978"",""EMAIL_ADDRESS"":""bsmith@work.com"",""DATE"":""4/9/16"",""STATUS"":""Inactive"",""AMOUNT"":""300""}" +200004,"Edward Kusha",0,0,"",0,0,"CUSTOMERS","1009","{""DATA_SOURCE"":""CUSTOMERS"",""RECORD_ID"":""1009"",""RECORD_TYPE"":""PERSON"",""PRIMARY_NAME_LAST"":""Kusha"",""PRIMARY_NAME_FIRST"":""Edward"",""DATE_OF_BIRTH"":""3/1/1970"",""SSN_NUMBER"":""294-66-9999"",""ADDR_TYPE"":""HOME"",""ADDR_LINE1"":""1304 Poppy Hills Dr"",""ADDR_CITY"":""Blacklick"",""ADDR_STATE"":""OH"",""ADDR_POSTAL_CODE"":""43004"",""EMAIL_ADDRESS"":""Kusha123@hmail.com"",""DATE"":""1/7/18"",""STATUS"":""Active"",""AMOUNT"":""600""}" diff --git a/examples/g2engine/export_json_fetch_close.py b/examples/szengine/export_json_fetch_close.py similarity index 100% rename from examples/g2engine/export_json_fetch_close.py rename to examples/szengine/export_json_fetch_close.py diff --git a/examples/szengine/export_json_fetch_close.txt b/examples/szengine/export_json_fetch_close.txt new file mode 100644 index 0000000..0739c19 --- /dev/null +++ b/examples/szengine/export_json_fetch_close.txt @@ -0,0 +1,3 @@ +{"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-04-29T14:31:34Z","LAST_SEEN_DT":"2024-04-29T14:31:34Z"}]},"RELATED_ENTITIES":[]} +{"RESOLVED_ENTITY":{"ENTITY_ID":200001,"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":16,"FEAT_DESC_VALUES":[{"FEAT_DESC":"PERSON","LIB_FEAT_ID":16}]}]},"RECORD_SUMMARY":[{"DATA_SOURCE":"CUSTOMERS","RECORD_COUNT":3}],"RECORDS":[{"DATA_SOURCE":"CUSTOMERS","RECORD_ID":"1001","INTERNAL_ID":200001,"MATCH_KEY":"","MATCH_LEVEL_CODE":"","ERRULE_CODE":"","FIRST_SEEN_DT":"2024-04-29T14:31:35Z","LAST_SEEN_DT":"2024-04-29T14:31:35Z"},{"DATA_SOURCE":"CUSTOMERS","RECORD_ID":"1002","INTERNAL_ID":200002,"MATCH_KEY":"+NAME+DOB+PHONE","MATCH_LEVEL_CODE":"RESOLVED","ERRULE_CODE":"CNAME_CFF_CEXCL","FIRST_SEEN_DT":"2024-04-29T14:31:35Z","LAST_SEEN_DT":"2024-04-29T14:31:35Z"},{"DATA_SOURCE":"CUSTOMERS","RECORD_ID":"1003","INTERNAL_ID":200003,"MATCH_KEY":"+NAME+DOB+EMAIL","MATCH_LEVEL_CODE":"RESOLVED","ERRULE_CODE":"SF1_PNAME_CSTAB","FIRST_SEEN_DT":"2024-04-29T14:31:35Z","LAST_SEEN_DT":"2024-04-29T14:31:35Z"}]},"RELATED_ENTITIES":[]} +{"RESOLVED_ENTITY":{"ENTITY_ID":200004,"ENTITY_NAME":"Edward Kusha","FEATURES":{"ADDRESS":[{"FEAT_DESC":"1304 Poppy Hills Dr Blacklick OH 43004","LIB_FEAT_ID":100003,"USAGE_TYPE":"HOME","FEAT_DESC_VALUES":[{"FEAT_DESC":"1304 Poppy Hills Dr Blacklick OH 43004","LIB_FEAT_ID":100003}]}],"DOB":[{"FEAT_DESC":"3/1/1970","LIB_FEAT_ID":100002,"FEAT_DESC_VALUES":[{"FEAT_DESC":"3/1/1970","LIB_FEAT_ID":100002}]}],"EMAIL":[{"FEAT_DESC":"Kusha123@hmail.com","LIB_FEAT_ID":100005,"FEAT_DESC_VALUES":[{"FEAT_DESC":"Kusha123@hmail.com","LIB_FEAT_ID":100005}]}],"NAME":[{"FEAT_DESC":"Edward Kusha","LIB_FEAT_ID":100001,"USAGE_TYPE":"PRIMARY","FEAT_DESC_VALUES":[{"FEAT_DESC":"Edward Kusha","LIB_FEAT_ID":100001}]}],"RECORD_TYPE":[{"FEAT_DESC":"PERSON","LIB_FEAT_ID":16,"FEAT_DESC_VALUES":[{"FEAT_DESC":"PERSON","LIB_FEAT_ID":16}]}],"SSN":[{"FEAT_DESC":"294-66-9999","LIB_FEAT_ID":100004,"FEAT_DESC_VALUES":[{"FEAT_DESC":"294-66-9999","LIB_FEAT_ID":100004}]}]},"RECORD_SUMMARY":[{"DATA_SOURCE":"CUSTOMERS","RECORD_COUNT":1}],"RECORDS":[{"DATA_SOURCE":"CUSTOMERS","RECORD_ID":"1009","INTERNAL_ID":200004,"MATCH_KEY":"","MATCH_LEVEL_CODE":"","ERRULE_CODE":"","FIRST_SEEN_DT":"2024-04-29T14:31:35Z","LAST_SEEN_DT":"2024-04-29T14:31:35Z"}]},"RELATED_ENTITIES":[]} diff --git a/examples/g2engine/find_interesting_entities_by_entity_id.py b/examples/szengine/find_interesting_entities_by_entity_id.py similarity index 100% rename from examples/g2engine/find_interesting_entities_by_entity_id.py rename to examples/szengine/find_interesting_entities_by_entity_id.py diff --git a/examples/g2engine/find_interesting_entities_by_entity_id.txt b/examples/szengine/find_interesting_entities_by_entity_id.txt similarity index 100% rename from examples/g2engine/find_interesting_entities_by_entity_id.txt rename to examples/szengine/find_interesting_entities_by_entity_id.txt diff --git a/examples/g2engine/find_interesting_entities_by_record_id.py b/examples/szengine/find_interesting_entities_by_record_id.py similarity index 100% rename from examples/g2engine/find_interesting_entities_by_record_id.py rename to examples/szengine/find_interesting_entities_by_record_id.py diff --git a/examples/g2engine/find_interesting_entities_by_record_id.txt b/examples/szengine/find_interesting_entities_by_record_id.txt similarity index 100% rename from examples/g2engine/find_interesting_entities_by_record_id.txt rename to examples/szengine/find_interesting_entities_by_record_id.txt diff --git a/examples/g2engine/find_network_by_entity_id.py b/examples/szengine/find_network_by_entity_id.py similarity index 100% rename from examples/g2engine/find_network_by_entity_id.py rename to examples/szengine/find_network_by_entity_id.py diff --git a/examples/szengine/find_network_by_entity_id.txt b/examples/szengine/find_network_by_entity_id.txt new file mode 100644 index 0000000..2a46920 --- /dev/null +++ b/examples/szengine/find_network_by_entity_id.txt @@ -0,0 +1,38 @@ +// Output has been formatted for easier reading. + +{ + "ENTITY_PATHS": [ + { + "START_ENTITY_ID": 1, + "END_ENTITY_ID": 200001, + "ENTITIES": [] + } + ], + "ENTITY_NETWORK_LINKS": [], + "ENTITIES": [ + { + "RESOLVED_ENTITY": { + "ENTITY_ID": 1, + "ENTITY_NAME": "", + "RECORD_SUMMARY": [ + { + "DATA_SOURCE": "TEST", + "RECORD_COUNT": 1 + } + ] + } + }, + { + "RESOLVED_ENTITY": { + "ENTITY_ID": 200001, + "ENTITY_NAME": "Robert Smith", + "RECORD_SUMMARY": [ + { + "DATA_SOURCE": "CUSTOMERS", + "RECORD_COUNT": 3 + } + ] + } + } + ] +} \ No newline at end of file diff --git a/examples/g2engine/find_network_by_record_id.py b/examples/szengine/find_network_by_record_id.py similarity index 100% rename from examples/g2engine/find_network_by_record_id.py rename to examples/szengine/find_network_by_record_id.py diff --git a/examples/szengine/find_network_by_record_id.txt b/examples/szengine/find_network_by_record_id.txt new file mode 100644 index 0000000..3775b1c --- /dev/null +++ b/examples/szengine/find_network_by_record_id.txt @@ -0,0 +1,38 @@ +// Output has been formatted for easier reading. + +{ + "ENTITY_PATHS": [ + { + "START_ENTITY_ID": 200001, + "END_ENTITY_ID": 200004, + "ENTITIES": [] + } + ], + "ENTITY_NETWORK_LINKS": [], + "ENTITIES": [ + { + "RESOLVED_ENTITY": { + "ENTITY_ID": 200001, + "ENTITY_NAME": "Robert Smith", + "RECORD_SUMMARY": [ + { + "DATA_SOURCE": "CUSTOMERS", + "RECORD_COUNT": 3 + } + ] + } + }, + { + "RESOLVED_ENTITY": { + "ENTITY_ID": 200004, + "ENTITY_NAME": "Edward Kusha", + "RECORD_SUMMARY": [ + { + "DATA_SOURCE": "CUSTOMERS", + "RECORD_COUNT": 1 + } + ] + } + } + ] +} \ No newline at end of file diff --git a/examples/g2engine/find_path_by_entity_id.py b/examples/szengine/find_path_by_entity_id.py similarity index 100% rename from examples/g2engine/find_path_by_entity_id.py rename to examples/szengine/find_path_by_entity_id.py diff --git a/examples/szengine/find_path_by_entity_id.txt b/examples/szengine/find_path_by_entity_id.txt new file mode 100644 index 0000000..fd44f56 --- /dev/null +++ b/examples/szengine/find_path_by_entity_id.txt @@ -0,0 +1,38 @@ +// Output has been formatted for easier reading. + +{ + "ENTITY_PATHS": [ + { + "START_ENTITY_ID": 1, + "END_ENTITY_ID": 200001, + "ENTITIES": [] + } + ], + "ENTITY_PATH_LINKS": [], + "ENTITIES": [ + { + "RESOLVED_ENTITY": { + "ENTITY_ID": 1, + "ENTITY_NAME": "", + "RECORD_SUMMARY": [ + { + "DATA_SOURCE": "TEST", + "RECORD_COUNT": 1 + } + ] + } + }, + { + "RESOLVED_ENTITY": { + "ENTITY_ID": 200001, + "ENTITY_NAME": "Robert Smith", + "RECORD_SUMMARY": [ + { + "DATA_SOURCE": "CUSTOMERS", + "RECORD_COUNT": 3 + } + ] + } + } + ] +} \ No newline at end of file diff --git a/examples/g2engine/find_path_by_record_id.py b/examples/szengine/find_path_by_record_id.py similarity index 100% rename from examples/g2engine/find_path_by_record_id.py rename to examples/szengine/find_path_by_record_id.py diff --git a/examples/szengine/find_path_by_record_id.txt b/examples/szengine/find_path_by_record_id.txt new file mode 100644 index 0000000..cd3e102 --- /dev/null +++ b/examples/szengine/find_path_by_record_id.txt @@ -0,0 +1,38 @@ +// Output has been formatted for easier reading. + +{ + "ENTITY_PATHS": [ + { + "START_ENTITY_ID": 200001, + "END_ENTITY_ID": 200004, + "ENTITIES": [] + } + ], + "ENTITY_PATH_LINKS": [], + "ENTITIES": [ + { + "RESOLVED_ENTITY": { + "ENTITY_ID": 200001, + "ENTITY_NAME": "Robert Smith", + "RECORD_SUMMARY": [ + { + "DATA_SOURCE": "CUSTOMERS", + "RECORD_COUNT": 3 + } + ] + } + }, + { + "RESOLVED_ENTITY": { + "ENTITY_ID": 200004, + "ENTITY_NAME": "Edward Kusha", + "RECORD_SUMMARY": [ + { + "DATA_SOURCE": "CUSTOMERS", + "RECORD_COUNT": 1 + } + ] + } + } + ] +} \ No newline at end of file diff --git a/examples/g2engine/get_active_config_id.py b/examples/szengine/get_active_config_id.py similarity index 100% rename from examples/g2engine/get_active_config_id.py rename to examples/szengine/get_active_config_id.py diff --git a/examples/szengine/get_active_config_id.txt b/examples/szengine/get_active_config_id.txt new file mode 100644 index 0000000..6d8920b --- /dev/null +++ b/examples/szengine/get_active_config_id.txt @@ -0,0 +1 @@ +4030462317 \ No newline at end of file diff --git a/examples/g2engine/get_entity_by_entity_id.py b/examples/szengine/get_entity_by_entity_id.py similarity index 100% rename from examples/g2engine/get_entity_by_entity_id.py rename to examples/szengine/get_entity_by_entity_id.py diff --git a/examples/szengine/get_entity_by_entity_id.txt b/examples/szengine/get_entity_by_entity_id.txt new file mode 100644 index 0000000..5f614f8 --- /dev/null +++ b/examples/szengine/get_entity_by_entity_id.txt @@ -0,0 +1,28 @@ +// Output has been formatted for easier reading. + +{ + "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-04-29T14:47:05Z", + "LAST_SEEN_DT": "2024-04-29T14:47:05Z" + } + ] + }, + "RELATED_ENTITIES": [] +} \ No newline at end of file diff --git a/examples/g2engine/get_entity_by_record_id.py b/examples/szengine/get_entity_by_record_id.py similarity index 100% rename from examples/g2engine/get_entity_by_record_id.py rename to examples/szengine/get_entity_by_record_id.py diff --git a/examples/szengine/get_entity_by_record_id.txt b/examples/szengine/get_entity_by_record_id.txt new file mode 100644 index 0000000..868216d --- /dev/null +++ b/examples/szengine/get_entity_by_record_id.txt @@ -0,0 +1,158 @@ +// Output has been formatted for easier reading. + +{ + "RESOLVED_ENTITY": { + "ENTITY_ID": 200001, + "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": 16, + "FEAT_DESC_VALUES": [ + { + "FEAT_DESC": "PERSON", + "LIB_FEAT_ID": 16 + } + ] + } + ] + }, + "RECORD_SUMMARY": [ + { + "DATA_SOURCE": "CUSTOMERS", + "RECORD_COUNT": 3 + } + ], + "RECORDS": [ + { + "DATA_SOURCE": "CUSTOMERS", + "RECORD_ID": "1001", + "INTERNAL_ID": 200001, + "MATCH_KEY": "", + "MATCH_LEVEL_CODE": "", + "ERRULE_CODE": "", + "FIRST_SEEN_DT": "2024-04-29T14:54:09Z", + "LAST_SEEN_DT": "2024-04-29T14:54:09Z" + }, + { + "DATA_SOURCE": "CUSTOMERS", + "RECORD_ID": "1002", + "INTERNAL_ID": 200002, + "MATCH_KEY": "+NAME+DOB+PHONE", + "MATCH_LEVEL_CODE": "RESOLVED", + "ERRULE_CODE": "CNAME_CFF_CEXCL", + "FIRST_SEEN_DT": "2024-04-29T14:54:09Z", + "LAST_SEEN_DT": "2024-04-29T14:54:09Z" + }, + { + "DATA_SOURCE": "CUSTOMERS", + "RECORD_ID": "1003", + "INTERNAL_ID": 200003, + "MATCH_KEY": "+NAME+DOB+EMAIL", + "MATCH_LEVEL_CODE": "RESOLVED", + "ERRULE_CODE": "SF1_PNAME_CSTAB", + "FIRST_SEEN_DT": "2024-04-29T14:54:09Z", + "LAST_SEEN_DT": "2024-04-29T14:54:09Z" + } + ] + }, + "RELATED_ENTITIES": [] +} \ No newline at end of file diff --git a/examples/g2engine/get_record.py b/examples/szengine/get_record.py similarity index 100% rename from examples/g2engine/get_record.py rename to examples/szengine/get_record.py diff --git a/examples/szengine/get_record.txt b/examples/szengine/get_record.txt new file mode 100644 index 0000000..9c97905 --- /dev/null +++ b/examples/szengine/get_record.txt @@ -0,0 +1,22 @@ +// Output has been formatted for easier reading. + +{ + "DATA_SOURCE": "CUSTOMERS", + "RECORD_ID": "1001", + "JSON_DATA": { + "DATA_SOURCE": "CUSTOMERS", + "RECORD_ID": "1001", + "RECORD_TYPE": "PERSON", + "PRIMARY_NAME_LAST": "Smith", + "PRIMARY_NAME_FIRST": "Robert", + "DATE_OF_BIRTH": "12/11/1978", + "ADDR_TYPE": "MAILING", + "ADDR_LINE1": "123 Main Street, Las Vegas NV 89132", + "PHONE_TYPE": "HOME", + "PHONE_NUMBER": "702-919-1300", + "EMAIL_ADDRESS": "bsmith@work.com", + "DATE": "1/2/18", + "STATUS": "Active", + "AMOUNT": "100" + } +} \ No newline at end of file diff --git a/examples/g2engine/get_redo_record.py b/examples/szengine/get_redo_record.py similarity index 100% rename from examples/g2engine/get_redo_record.py rename to examples/szengine/get_redo_record.py diff --git a/examples/szengine/get_redo_record.txt b/examples/szengine/get_redo_record.txt new file mode 100644 index 0000000..7462d18 --- /dev/null +++ b/examples/szengine/get_redo_record.txt @@ -0,0 +1,8 @@ +// Output has been formatted for easier reading. + +{ + "REASON": "deferred delete", + "DATA_SOURCE": "CUSTOMERS", + "RECORD_ID": "1003", + "DSRC_ACTION": "X" +} \ No newline at end of file diff --git a/examples/g2diagnostic/get_db_info.py b/examples/szengine/get_stats.py similarity index 100% rename from examples/g2diagnostic/get_db_info.py rename to examples/szengine/get_stats.py diff --git a/examples/szengine/get_stats.txt b/examples/szengine/get_stats.txt new file mode 100644 index 0000000..8abcdc5 --- /dev/null +++ b/examples/szengine/get_stats.txt @@ -0,0 +1,245 @@ +// Output has been formatted for easier reading. + +{ + "workload": { + "apiVersion": "4.0.0.24103", + "loadedRecords": 5, + "addedRecords": 10, + "optimizedOut": 7, + "optimizedOutSkipped": 0, + "newObsEnt": 4, + "obsEntHashSame": 6, + "obsEntHashDiff": 0, + "partiallyResolved": 0, + "deletedRecords": 1, + "changeDeletes": 0, + "reevaluations": 0, + "repairedEntities": 0, + "duration": 16, + "retries": 0, + "candidates": 2, + "actualAmbiguousTest": 0, + "cachedAmbiguousTest": 0, + "libFeatCacheHit": 142, + "libFeatCacheMiss": 52, + "resFeatStatCacheHit": 906, + "resFeatStatCacheMiss": 100, + "libFeatInsert": 28, + "resFeatStatInsert": 28, + "resFeatStatUpdateAttempt": 42, + "resFeatStatUpdateFail": 0, + "unresolveTest": 0, + "abortedUnresolve": 0, + "gnrScorersUsed": 1, + "unresolveTriggers": { + "normalResolve": 0, + "update": 0, + "relLink": 0, + "extensiveResolve": 0, + "ambiguousNoResolve": 0, + "ambiguousMultiResolve": 0 + }, + "reresolveTriggers": { + "abortRetry": 0, + "unresolveMovement": 0, + "multipleResolvableCandidates": 0, + "resolveNewFeatures": 2, + "newFeatureFTypes": [ + { + "ADDRESS": 1 + }, + { + "ADDR_KEY": 1 + }, + { + "DOB": 1 + }, + { + "NAME": 2 + }, + { + "NAMEADDR_KEY": 1 + }, + { + "NAME_KEY": 2 + }, + { + "PHONE": 1 + } + ] + }, + "reresolveSkipped": 0, + "filteredObsFeat": 0, + "expressedFeatureCalls": [ + { + "EFCALL_ID": 1, + "EFUNC_CODE": "PHONE_HASHER", + "numCalls": 2 + } + ], + "expressedFeaturesCreated": [ + { + "ADDR_KEY": 6 + }, + { + "EMAIL_KEY": 3 + }, + { + "ID_KEY": 1 + }, + { + "NAMEADDR_KEY": 10 + }, + { + "NAME_KEY": 47 + }, + { + "PHONE_KEY": 2 + }, + { + "SEARCH_KEY": 1 + } + ], + "scoredPairs": [ + { + "ADDRESS": 1 + }, + { + "DOB": 4 + }, + { + "EMAIL": 1 + }, + { + "NAME": 7 + }, + { + "PHONE": 1 + }, + { + "RECORD_TYPE": 2 + } + ], + "cacheHit": [], + "cacheMiss": [ + { + "ADDRESS": 1 + }, + { + "DOB": 4 + }, + { + "EMAIL": 1 + }, + { + "NAME": 7 + }, + { + "PHONE": 1 + } + ], + "redoTriggers": [], + "latchContention": [], + "highContentionFeat": [], + "highContentionResEnt": [], + "genericDetect": [], + "candidateBuilders": [ + { + "ADDR_KEY": 5 + }, + { + "DOB": 6 + }, + { + "EMAIL": 5 + }, + { + "EMAIL_KEY": 5 + }, + { + "ID_KEY": 1 + }, + { + "NAMEADDR_KEY": 5 + }, + { + "NAME_KEY": 6 + }, + { + "PHONE": 4 + }, + { + "PHONE_KEY": 4 + }, + { + "SEARCH_KEY": 1 + }, + { + "SSN": 1 + } + ], + "suppressedCandidateBuilders": [], + "suppressedScoredFeatureType": [], + "suppressedDisclosedRelationshipDomainCount": 0, + "CorruptEntityTestDiagnosis": { + "corruptionTypes": 0 + }, + "threadState": { + "active": 0, + "idle": 10, + "sqlExecuting": 0, + "loader": 0, + "resolver": 0, + "scoring": 0, + "dataLatchContention": 0, + "obsEntContention": 0, + "resEntContention": 0 + }, + "systemResources": { + "initResources": [ + { + "physicalCores": 16 + }, + { + "logicalCores": 16 + }, + { + "totalMemory": "62.6GB" + }, + { + "availableMemory": "47.3GB" + } + ], + "currResources": [ + { + "availableMemory": "41.9GB" + }, + { + "activeThreads": 0 + }, + { + "workerThreads": 10 + }, + { + "systemLoad": [ + { + "cpuUser": 14.45705 + }, + { + "cpuSystem": 2.269044 + }, + { + "cpuIdle": 83.079414 + }, + { + "cpuWait": 0.032415 + }, + { + "cpuSoftIrq": 0.162075 + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/examples/g2engine/get_virtual_entity_by_record_id.py b/examples/szengine/get_virtual_entity_by_record_id.py similarity index 100% rename from examples/g2engine/get_virtual_entity_by_record_id.py rename to examples/szengine/get_virtual_entity_by_record_id.py diff --git a/examples/szengine/get_virtual_entity_by_record_id.txt b/examples/szengine/get_virtual_entity_by_record_id.txt new file mode 100644 index 0000000..3fef9f8 --- /dev/null +++ b/examples/szengine/get_virtual_entity_by_record_id.txt @@ -0,0 +1,137 @@ +// Output has been formatted for easier reading. + +{ + "RESOLVED_ENTITY": { + "ENTITY_ID": 200001, + "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 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": 16, + "FEAT_DESC_VALUES": [ + { + "FEAT_DESC": "PERSON", + "LIB_FEAT_ID": 16 + } + ] + } + ] + }, + "RECORD_SUMMARY": [ + { + "DATA_SOURCE": "CUSTOMERS", + "RECORD_COUNT": 2 + } + ], + "RECORDS": [ + { + "DATA_SOURCE": "CUSTOMERS", + "RECORD_ID": "1001", + "INTERNAL_ID": 200001, + "FIRST_SEEN_DT": "2024-04-29T15:04:04Z", + "LAST_SEEN_DT": "2024-04-29T15:04:04Z" + }, + { + "DATA_SOURCE": "CUSTOMERS", + "RECORD_ID": "1002", + "INTERNAL_ID": 200002, + "FIRST_SEEN_DT": "2024-04-29T15:04:04Z", + "LAST_SEEN_DT": "2024-04-29T15:04:04Z" + } + ] + } +} \ No newline at end of file diff --git a/examples/g2engine/how_entity_by_entity_id.py b/examples/szengine/how_entity_by_entity_id.py similarity index 100% rename from examples/g2engine/how_entity_by_entity_id.py rename to examples/szengine/how_entity_by_entity_id.py diff --git a/examples/szengine/how_entity_by_entity_id.txt b/examples/szengine/how_entity_by_entity_id.txt new file mode 100644 index 0000000..51035bf --- /dev/null +++ b/examples/szengine/how_entity_by_entity_id.txt @@ -0,0 +1,26 @@ +// Output has been formatted for easier reading. + +{ + "HOW_RESULTS": { + "RESOLUTION_STEPS": [], + "FINAL_STATE": { + "NEED_REEVALUATION": 0, + "VIRTUAL_ENTITIES": [ + { + "VIRTUAL_ENTITY_ID": "V1", + "MEMBER_RECORDS": [ + { + "INTERNAL_ID": 1, + "RECORDS": [ + { + "DATA_SOURCE": "TEST", + "RECORD_ID": "2" + } + ] + } + ] + } + ] + } + } +} \ No newline at end of file diff --git a/examples/g2engine/prime_engine.py b/examples/szengine/prime_engine.py similarity index 100% rename from examples/g2engine/prime_engine.py rename to examples/szengine/prime_engine.py diff --git a/examples/g2engine/process.py b/examples/szengine/process.py similarity index 100% rename from examples/g2engine/process.py rename to examples/szengine/process.py diff --git a/examples/g2diagnostic/get_logical_cores.py b/examples/szengine/process_redo_record.py similarity index 100% rename from examples/g2diagnostic/get_logical_cores.py rename to examples/szengine/process_redo_record.py diff --git a/examples/szengine/process_redo_record.txt b/examples/szengine/process_redo_record.txt new file mode 100644 index 0000000..4857715 --- /dev/null +++ b/examples/szengine/process_redo_record.txt @@ -0,0 +1 @@ +// TODO: Construct output. \ No newline at end of file diff --git a/examples/g2engine/reevaluate_entity.py b/examples/szengine/reevaluate_entity.py similarity index 100% rename from examples/g2engine/reevaluate_entity.py rename to examples/szengine/reevaluate_entity.py diff --git a/examples/szengine/reevaluate_entity.txt b/examples/szengine/reevaluate_entity.txt new file mode 100644 index 0000000..b424013 --- /dev/null +++ b/examples/szengine/reevaluate_entity.txt @@ -0,0 +1,14 @@ +// Output has been formatted for easier reading. + +{ + "DATA_SOURCE": "TEST", + "RECORD_ID": "2", + "AFFECTED_ENTITIES": [ + { + "ENTITY_ID": 1 + } + ], + "INTERESTING_ENTITIES": { + "ENTITIES": [] + } +} \ No newline at end of file diff --git a/examples/g2diagnostic/get_physical_cores.py b/examples/szengine/reevaluate_record.py similarity index 100% rename from examples/g2diagnostic/get_physical_cores.py rename to examples/szengine/reevaluate_record.py diff --git a/examples/szengine/reevaluate_record.txt b/examples/szengine/reevaluate_record.txt new file mode 100644 index 0000000..3a989a7 --- /dev/null +++ b/examples/szengine/reevaluate_record.txt @@ -0,0 +1,14 @@ +// Output has been formatted for easier reading. + +{ + "DATA_SOURCE": "CUSTOMERS", + "RECORD_ID": "1001", + "AFFECTED_ENTITIES": [ + { + "ENTITY_ID": 200001 + } + ], + "INTERESTING_ENTITIES": { + "ENTITIES": [] + } +} \ No newline at end of file diff --git a/examples/g2engine/search_by_attributes.py b/examples/szengine/search_by_attributes.py similarity index 100% rename from examples/g2engine/search_by_attributes.py rename to examples/szengine/search_by_attributes.py diff --git a/examples/szengine/search_by_attributes.txt b/examples/szengine/search_by_attributes.txt new file mode 100644 index 0000000..4857715 --- /dev/null +++ b/examples/szengine/search_by_attributes.txt @@ -0,0 +1 @@ +// TODO: Construct output. \ No newline at end of file diff --git a/examples/g2diagnostic/get_total_system_memory.py b/examples/szengine/szengine_constructor.py similarity index 100% rename from examples/g2diagnostic/get_total_system_memory.py rename to examples/szengine/szengine_constructor.py diff --git a/examples/g2engine/add_record_with_info.py b/examples/szengine/szengine_initialize_and_destroy.py similarity index 100% rename from examples/g2engine/add_record_with_info.py rename to examples/szengine/szengine_initialize_and_destroy.py diff --git a/examples/g2engine/delete_record_with_info.py b/examples/szengine/szengine_initialize_with_config_id.py similarity index 100% rename from examples/g2engine/delete_record_with_info.py rename to examples/szengine/szengine_initialize_with_config_id.py diff --git a/examples/g2engine/export_config_and_config_id.py b/examples/szengine/szengine_reinitialize.py similarity index 100% rename from examples/g2engine/export_config_and_config_id.py rename to examples/szengine/szengine_reinitialize.py diff --git a/examples/g2engine/why_entities.py b/examples/szengine/why_entities.py similarity index 100% rename from examples/g2engine/why_entities.py rename to examples/szengine/why_entities.py diff --git a/examples/szengine/why_entities.txt b/examples/szengine/why_entities.txt new file mode 100644 index 0000000..4857715 --- /dev/null +++ b/examples/szengine/why_entities.txt @@ -0,0 +1 @@ +// TODO: Construct output. \ No newline at end of file diff --git a/examples/g2engine/find_network_by_entity_id_v2.py b/examples/szengine/why_record_in_entity.py similarity index 100% rename from examples/g2engine/find_network_by_entity_id_v2.py rename to examples/szengine/why_record_in_entity.py diff --git a/examples/szengine/why_record_in_entity.txt b/examples/szengine/why_record_in_entity.txt new file mode 100644 index 0000000..4857715 --- /dev/null +++ b/examples/szengine/why_record_in_entity.txt @@ -0,0 +1 @@ +// TODO: Construct output. \ No newline at end of file diff --git a/examples/g2engine/why_records.py b/examples/szengine/why_records.py similarity index 100% rename from examples/g2engine/why_records.py rename to examples/szengine/why_records.py diff --git a/examples/szengine/why_records.txt b/examples/szengine/why_records.txt new file mode 100644 index 0000000..ec838af --- /dev/null +++ b/examples/szengine/why_records.txt @@ -0,0 +1,46 @@ +// Output has been formatted and pruned for easier reading. + +{ + "WHY_RESULTS": [ + { + "INTERNAL_ID": 200001, + "ENTITY_ID": 200001, + "FOCUS_RECORDS": [], + "INTERNAL_ID_2": 200002, + "ENTITY_ID_2": 200001, + "FOCUS_RECORDS_2": [], + "MATCH_INFO": { + "WHY_KEY": "+NAME+DOB+PHONE", + "WHY_ERRULE_CODE": "CNAME_CFF_CEXCL", + "MATCH_LEVEL_CODE": "RESOLVED", + "CANDIDATE_KEYS": {}, + "DISCLOSED_RELATIONS": {}, + "FEATURE_SCORES": {} + } + } + ], + "ENTITIES": [ + { + "RESOLVED_ENTITY": { + "ENTITY_ID": 200001, + "ENTITY_NAME": "Robert Smith", + "FEATURES": { + "ADDRESS": [], + "ADDR_KEY": [], + "DOB": [], + "EMAIL": [], + "EMAIL_KEY": [], + "NAME": [], + "NAMEADDR_KEY": [], + "NAME_KEY": [], + "PHONE": [], + "PHONE_KEY": [], + "RECORD_TYPE": [] + }, + "RECORD_SUMMARY": [], + "RECORDS": [] + }, + "RELATED_ENTITIES": [] + } + ] +} \ No newline at end of file diff --git a/examples/g2engine/find_network_by_record_id_v2.py b/examples/szproduct/get_license.py similarity index 100% rename from examples/g2engine/find_network_by_record_id_v2.py rename to examples/szproduct/get_license.py diff --git a/examples/g2product/license.txt b/examples/szproduct/get_license.txt similarity index 100% rename from examples/g2product/license.txt rename to examples/szproduct/get_license.txt diff --git a/examples/g2engine/find_path_by_entity_id_v2.py b/examples/szproduct/get_version.py similarity index 100% rename from examples/g2engine/find_path_by_entity_id_v2.py rename to examples/szproduct/get_version.py diff --git a/examples/szproduct/get_version.txt b/examples/szproduct/get_version.txt new file mode 100644 index 0000000..309f017 --- /dev/null +++ b/examples/szproduct/get_version.txt @@ -0,0 +1,17 @@ +// Output has been formatted for easier reading. + +{ + "PRODUCT_NAME": "Senzing API", + "VERSION": "4.0.0", + "BUILD_VERSION": "4.0.0.24103", + "BUILD_DATE": "2024-04-12", + "BUILD_NUMBER": "2024_04_12__12_50", + "COMPATIBILITY_VERSION": { + "CONFIG_VERSION": "11" + }, + "SCHEMA_VERSION": { + "ENGINE_SCHEMA_VERSION": "4.0", + "MINIMUM_REQUIRED_SCHEMA_VERSION": "4.0", + "MAXIMUM_REQUIRED_SCHEMA_VERSION": "4.99" + } +} \ No newline at end of file diff --git a/examples/g2engine/find_path_by_record_id_v2.py b/examples/szproduct/szproduct_constructor.py similarity index 100% rename from examples/g2engine/find_path_by_record_id_v2.py rename to examples/szproduct/szproduct_constructor.py diff --git a/examples/g2engine/find_path_excluding_by_entity_id.py b/examples/szproduct/szproduct_initialize_and_destroy.py similarity index 100% rename from examples/g2engine/find_path_excluding_by_entity_id.py rename to examples/szproduct/szproduct_initialize_and_destroy.py diff --git a/makefiles/darwin.mk b/makefiles/darwin.mk index b6a679c..2f5d5b8 100644 --- a/makefiles/darwin.mk +++ b/makefiles/darwin.mk @@ -18,14 +18,16 @@ SENZING_TOOLS_DATABASE_URL ?= sqlite3://na:na@/tmp/sqlite/G2C.db .PHONY: clean-osarch-specific clean-osarch-specific: - @rm -rf $(TARGET_DIRECTORY) || true - @rm -rf $(DIST_DIRECTORY) || true - @rm -rf $(MAKEFILE_DIRECTORY)/__pycache__ || true - @rm $(MAKEFILE_DIRECTORY)/coverage.xml || true + @rm -fr $(DIST_DIRECTORY) || true + @rm -fr $(MAKEFILE_DIRECTORY)/__pycache__ || true + @rm -f $(MAKEFILE_DIRECTORY)/coverage.xml || true + @rm -fr $(TARGET_DIRECTORY) || true .PHONY: dependencies-osarch-specific dependencies-osarch-specific: + python3 -m pip install --upgrade pip + pip install psutil pytest pytest-cov pytest-schema .PHONY: hello-world-osarch-specific @@ -39,6 +41,10 @@ setup-osarch-specific: .PHONY: test-osarch-specific test-osarch-specific: + @echo "--- Unit tests -------------------------------------------------------" + @pytest tests/ --verbose --capture=no --cov=src/senzing + @echo "--- Test examples ----------------------------------------------------" + @pytest examples/ --verbose --capture=no --cov=src/senzing .PHONY: view-sphinx-osarch-specific diff --git a/makefiles/linux.mk b/makefiles/linux.mk index 97bb1e2..ed2475a 100644 --- a/makefiles/linux.mk +++ b/makefiles/linux.mk @@ -12,14 +12,22 @@ SENZING_TOOLS_DATABASE_URL ?= sqlite3://na:na@/tmp/sqlite/G2C.db .PHONY: clean-osarch-specific clean-osarch-specific: - @rm -rf $(TARGET_DIRECTORY) || true - @rm -rf $(DIST_DIRECTORY) || true - @rm -rf $(MAKEFILE_DIRECTORY)/__pycache__ || true - @rm $(MAKEFILE_DIRECTORY)/coverage.xml || true + @rm -fr $(DIST_DIRECTORY) || true + @rm -fr $(MAKEFILE_DIRECTORY)/__pycache__ || true + @rm -f $(MAKEFILE_DIRECTORY)/coverage.xml || true + @rm -fr $(TARGET_DIRECTORY) || true + + +.PHONY: coverage-osarch-specific +coverage-osarch-specific: + @coverage html + @xdg-open $(MAKEFILE_DIRECTORY)/htmlcov/index.html .PHONY: dependencies-osarch-specific dependencies-osarch-specific: + python3 -m pip install --upgrade pip + pip install build psutil pytest pytest-cov pytest-schema virtualenv .PHONY: hello-world-osarch-specific @@ -33,6 +41,25 @@ setup-osarch-specific: .PHONY: test-osarch-specific test-osarch-specific: + @echo "--- Unit tests -------------------------------------------------------" + @pytest tests/ --verbose --capture=no --cov=src/senzing_abstract --cov-report xml:coverage.xml +# @echo "--- Test examples ----------------------------------------------------" +# @pytest examples/ --verbose --capture=no --cov=src/senzing_abstract + @echo "--- Test examples using unittest -------------------------------------" + @python3 -m unittest \ + examples/szconfig/*.py \ + examples/szconfigmanager/*.py \ + examples/szdiagnostic/*.py \ + examples/szengine/*.py \ + examples/szproduct/*.py + + +.PHONY: test-examples +test-examples: + @echo "--- Test examples using unittest -------------------------------------" + @python3 -m unittest \ + examples/misc/add_truthset_datasources.py \ + examples/misc/add_truthset_data.py .PHONY: view-sphinx-osarch-specific diff --git a/makefiles/windows.mk b/makefiles/windows.mk index d2c235f..293746c 100644 --- a/makefiles/windows.mk +++ b/makefiles/windows.mk @@ -12,12 +12,17 @@ SENZING_TOOLS_DATABASE_URL ?= sqlite3://na:na@nowhere/C:\Temp\sqlite\G2C.db .PHONY: clean-osarch-specific clean-osarch-specific: - del /F /S /Q $(TARGET_DIRECTORY) + del /F /S /Q $(DIST_DIRECTORY) del /F /S /Q $(GOPATH)/bin/$(PROGRAM_NAME) + del /F /S /Q $(MAKEFILE_DIRECTORY)/__pycache__ + del /F /S /Q $(MAKEFILE_DIRECTORY)/coverage.xml + del /F /S /Q $(TARGET_DIRECTORY) .PHONY: dependencies-osarch-specific dependencies-osarch-specific: + python3 -m pip install --upgrade pip + pip install psutil pytest pytest-cov pytest-schema .PHONY: hello-world-osarch-specific @@ -31,6 +36,10 @@ setup-osarch-specific: .PHONY: test-osarch-specific test-osarch-specific: + @echo "--- Unit tests -------------------------------------------------------" + @pytest tests/ --verbose --capture=no --cov=src/senzing + @echo "--- Test examples ----------------------------------------------------" + @pytest examples/ --verbose --capture=no --cov=src/senzing .PHONY: view-sphinx-osarch-specific diff --git a/setup.cfg b/setup.cfg index ede3e63..076dd45 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,15 +1,15 @@ [metadata] name = senzing_abstract -version = 0.0.4 +version = 0.1.0 author = senzing author_email = support@senzing.com description = Python SDK method definitions license = Apache 2 long_description = file: README.md long_description_content_type = text/markdown -url = https://github.com/senzing-garage/g2-sdk-python-abstract +url = https://github.com/senzing-garage/sz-sdk-python-abstract project_urls = - Bug Tracker = https://github.com/senzing-garage/g2-sdk-python-abstract/issues + Bug Tracker = https://github.com/senzing-garage/sz-sdk-python-abstract/issues classifiers = Programming Language :: Python :: 3 License :: OSI Approved :: Apache Software License diff --git a/src/senzing_abstract/__init__.py b/src/senzing_abstract/__init__.py index b86600b..3479b34 100644 --- a/src/senzing_abstract/__init__.py +++ b/src/senzing_abstract/__init__.py @@ -1,45 +1,49 @@ -from .g2config_abstract import G2ConfigAbstract -from .g2configmgr_abstract import G2ConfigMgrAbstract -from .g2diagnostic_abstract import G2DiagnosticAbstract -from .g2engine_abstract import G2EngineAbstract -from .g2engineflags import G2EngineFlags -from .g2exception import ( +from .szconfig_abstract import SzConfigAbstract +from .szconfigmanager_abstract import SzConfigManagerAbstract +from .szdiagnostic_abstract import SzDiagnosticAbstract +from .szengine_abstract import SzEngineAbstract +from .szengineflags import SzEngineFlags +from .szerror import ( EXCEPTION_MAP, - G2BadInputError, - G2ConfigurationError, - G2DatabaseConnectionLostError, - G2DatabaseError, - G2Exception, - G2LicenseError, - G2NotFoundError, - G2NotInitializedError, - G2RetryableError, - G2RetryTimeoutExceededError, - G2UnhandledError, - G2UnknownDatasourceError, - G2UnrecoverableError, + SzBadInputError, + SzConfigurationError, + SzDatabaseConnectionLostError, + SzDatabaseError, + SzError, + SzLicenseError, + SzNotFoundError, + SzNotInitializedError, + SzRetryableError, + SzRetryTimeoutExceededError, + SzUnhandledError, + SzUnknownDataSourceError, + SzUnrecoverableError, + new_szexception, ) -from .g2product_abstract import G2ProductAbstract +from .szhasher_abstract import SzHasherAbstract +from .szproduct_abstract import SzProductAbstract __all__ = [ "EXCEPTION_MAP", - "G2BadInputError", - "G2ConfigAbstract", - "G2ConfigMgrAbstract", - "G2ConfigurationError", - "G2DatabaseConnectionLostError", - "G2DatabaseError", - "G2DiagnosticAbstract", - "G2EngineAbstract", - "G2EngineFlags", - "G2Exception", - "G2LicenseError", - "G2NotFoundError", - "G2NotInitializedError", - "G2ProductAbstract", - "G2RetryableError", - "G2RetryTimeoutExceededError", - "G2UnhandledError", - "G2UnknownDatasourceError", - "G2UnrecoverableError", + "new_szexception", + "SzBadInputError", + "SzConfigAbstract", + "SzConfigManagerAbstract", + "SzConfigurationError", + "SzDatabaseConnectionLostError", + "SzDatabaseError", + "SzDiagnosticAbstract", + "SzEngineAbstract", + "SzEngineFlags", + "SzError", + "SzHasherAbstract", + "SzLicenseError", + "SzNotFoundError", + "SzNotInitializedError", + "SzProductAbstract", + "SzRetryableError", + "SzRetryTimeoutExceededError", + "SzUnhandledError", + "SzUnknownDataSourceError", + "SzUnrecoverableError", ] diff --git a/src/senzing_abstract/g2config_abstract.py b/src/senzing_abstract/g2config_abstract.py deleted file mode 100644 index 4586dd8..0000000 --- a/src/senzing_abstract/g2config_abstract.py +++ /dev/null @@ -1,324 +0,0 @@ -#! /usr/bin/env python3 - -""" -g2config_abstract.py is the abstract class for all implementaions of g2config. -""" - -# TODO: Determine specific G2Exceptions, Errors for "Raises:" documentation. - -from abc import ABC, abstractmethod -from typing import Any, Dict, Union - -from .g2helpers import construct_help - -# Metadata - -__all__ = ["G2ConfigAbstract"] -__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ -__date__ = "2023-12-14" -__updated__ = "2023-12-14" - -# ----------------------------------------------------------------------------- -# G2ConfigAbstract -# ----------------------------------------------------------------------------- - - -class G2ConfigAbstract(ABC): - """ - G2ConfigAbstract is the definition of the Senzing Python API that is - implemented by packages such as g2config.py. - """ - - # ------------------------------------------------------------------------- - # Messages - # ------------------------------------------------------------------------- - - PREFIX = "g2config." - ID_MESSAGES = { - 4001: PREFIX + "G2Config_addDataSource({0}, {1}) failed. Return code: {2}", - 4002: PREFIX + "G2Config_close({0}) failed. Return code: {1}", - 4003: PREFIX + "G2Config_create() failed. Return code: {0}", - 4004: PREFIX + "G2Config_deleteDataSource({0}, {1}) failed. Return code: {2}", - 4006: PREFIX + "G2Config_destroy() failed. Return code: {0}", - 4007: PREFIX + "G2Config_init({0}, {1}, {2}) failed. Return code: {3}", - 4008: PREFIX + "G2Config_listDataSources() failed. Return code: {0}", - 4009: PREFIX + "G2Config_load({0}) failed. Return code: {1}", - 4010: PREFIX + "G2Config_save({0}) failed. Return code: {1}", - 4020: PREFIX - + "G2Config({0}, {1}) must have both module_name and ini_params nor neither.", - } - - # ------------------------------------------------------------------------- - # Interface definition - # ------------------------------------------------------------------------- - - @abstractmethod - def add_data_source( - self, - config_handle: int, - input_json: Union[str, Dict[Any, Any]], - *args: Any, - **kwargs: Any, - ) -> str: - """ - The `add_data_source` method adds a data source to an existing in-memory configuration. - - Args: - config_handle (int): An identifier of an in-memory configuration. Usually created by the `create` or `load` methods. - input_json (Union[str, Dict[Any, Any]]): A JSON document in the format `{"DSRC_CODE": "NAME_OF_DATASOURCE"}`. - - Returns: - str: A string containing a JSON document listing the newly created data source. - - Raises: - TypeError: Incorrect datatype of input parameter. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2config/add_data_source.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2config/add_data_source.txt - :linenos: - :language: json - """ - - @abstractmethod - def close(self, config_handle: int, *args: Any, **kwargs: Any) -> None: - """ - The `close` method cleans up the Senzing G2Config object pointed to by the `config_handle`. - - Args: - config_handle (int): An identifier of an in-memory configuration. Usually created by the `create` or `load` methods. - - Raises: - TypeError: Incorrect datatype of input parameter. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2config/create_and_close.py - :linenos: - :language: python - """ - - @abstractmethod - def create(self, *args: Any, **kwargs: Any) -> int: - """ - The `create` method creates an in-memory Senzing configuration from the `g2config.json` template configuration file located in the PIPELINE.RESOURCEPATH path. - A handle is returned to identify the in-memory configuration. - The handle is used by the `add_data_source`, `list_data_sources`, - `delete_data_source`, and `save` methods. - The handle is terminated by the `close` method. - - Returns: - int: A pointer to an in-memory Senzing configuration. - - Raises: - TypeError: Incorrect datatype of input parameter. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2config/create_and_close.py - :linenos: - :language: python - """ - - @abstractmethod - def delete_data_source( - self, - config_handle: int, - input_json: Union[str, Dict[Any, Any]], - *args: Any, - **kwargs: Any, - ) -> None: - """ - The `delete_data_source` method removes a data source from an existing in-memory configuration. - - Args: - config_handle (int): An identifier of an in-memory configuration. Usually created by the `create` or `load` methods - input_json (Union[str, Dict[Any, Any]]): A JSON document in the format `{"DSRC_CODE": "NAME_OF_DATASOURCE"}`. - - Raises: - TypeError: Incorrect datatype of input parameter. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2config/delete_data_source.py - :linenos: - :language: python - """ - - @abstractmethod - def destroy(self, *args: Any, **kwargs: Any) -> None: - """ - The `destroy` method will destroy and perform cleanup for the Senzing G2Config object. - It should be called after all other calls are complete. - - **Note:** If the `G2Config` constructor was called with parameters, - the destructor will automatically call the destroy() method. - In this case, a separate call to `destroy()` is not needed. - - Example: - - .. code-block:: python - - g2_config = g2config.G2Config(module_name, ini_params) - - Raises: - g2exception.G2Exception: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2config/g2config_init_and_destroy.py - :linenos: - :language: python - """ - - @abstractmethod - def init( - self, - module_name: str, - ini_params: Union[str, Dict[Any, Any]], - verbose_logging: int = 0, - **kwargs: Any, - ) -> None: - """ - The `init` method initializes the Senzing G2Config object. - It must be called prior to any other calls. - - **Note:** If the G2Config constructor is called with parameters, - the constructor will automatically call the `init()` method. - In this case, a separate call to `init()` is not needed. - - Example: - - .. code-block:: python - - g2_config = g2config.G2Config(module_name, ini_params) - - Args: - module_name (str): A short name given to this instance of the G2Config object, to help identify it within system logs. - ini_params (Union[str, Dict[Any, Any]]): A JSON string containing configuration parameters. - verbose_logging (int): `Optional:` A flag to enable deeper logging of the G2 processing. 0 for no Senzing logging; 1 for logging. Default: 0 - - Raises: - TypeError: Incorrect datatype of input parameter. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2config/g2config_init_and_destroy.py - :linenos: - :language: python - """ - - @abstractmethod - def list_data_sources(self, config_handle: int, *args: Any, **kwargs: Any) -> str: - """ - The `list_data_sources` method returns a JSON document of data sources contained in an in-memory configuration. - - Args: - config_handle (int): An identifier of an in-memory configuration. Usually created by the `create` or `load` methods - - Returns: - str: A string containing a JSON document listing all of the data sources. - - Raises: - TypeError: Incorrect datatype of input parameter. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2config/list_data_sources.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2config/list_data_sources.txt - :linenos: - :language: json - """ - - @abstractmethod - def load( - self, json_config: Union[str, Dict[Any, Any]], *args: Any, **kwargs: Any - ) -> int: - """ - The `load` method initializes an in-memory Senzing G2Config object from a JSON string. - A handle is returned to identify the in-memory configuration. - The handle is used by the `add_data_source`, `list_data_sources`, - `delete_data_source`, and `save` methods. - The handle is terminated by the `close` method. - - Args: - json_config (Union[str, Dict[Any, Any]]): A JSON document containing the Senzing configuration. - - Returns: - int: An identifier (config_handle) of an in-memory configuration. - - Raises: - TypeError: Incorrect datatype of input parameter. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2config/load.py - :linenos: - :language: python - - **Create, save, load, and close** - - .. literalinclude:: ../../examples/g2config/create_save_load_close.py - :linenos: - :language: python - """ - - @abstractmethod - def save(self, config_handle: int, *args: Any, **kwargs: Any) -> str: - """ - The `save` method creates a JSON string representation of the Senzing G2Config object. - - Args: - config_handle (int): An identifier of an in-memory configuration. Usually created by the `create` or `load` methods - - Returns: - str: A string containing a JSON Document representation of the Senzing G2Config object. - - Raises: - TypeError: Incorrect datatype of input parameter. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2config/save.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2config/save.txt - :linenos: - :language: json - - **Create, save, load, and close example** - - .. literalinclude:: ../../examples/g2config/create_save_load_close.py - :linenos: - :language: python - """ - - # ------------------------------------------------------------------------- - # Convenience methods - # ------------------------------------------------------------------------- - - def help(self, method_name: str = "") -> str: - """ - Return the help for a particular message. - - Args: - method_name (str): The name of the method. (e.g. "init"). If empty, a list of methods and descriptions is returned. - - Returns: - str: The Help information about the requested method - """ - return construct_help(self, method_name=method_name) diff --git a/src/senzing_abstract/g2diagnostic_abstract.py b/src/senzing_abstract/g2diagnostic_abstract.py deleted file mode 100644 index bcb3bb2..0000000 --- a/src/senzing_abstract/g2diagnostic_abstract.py +++ /dev/null @@ -1,300 +0,0 @@ -#! /usr/bin/env python3 - -""" -TODO: g2diagnostic_abstract.py -""" - -from abc import ABC, abstractmethod -from typing import Any, Dict, Union - -from .g2helpers import construct_help - -# Metadata - -__all__ = ["G2DiagnosticAbstract"] -__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ -__date__ = "2023-12-14" -__updated__ = "2023-12-14" - -# ----------------------------------------------------------------------------- -# G2DiagnosticAbstract -# ----------------------------------------------------------------------------- - - -class G2DiagnosticAbstract(ABC): - """ - G2 diagnostic module access library - """ - - # ------------------------------------------------------------------------- - # Messages - # ------------------------------------------------------------------------- - - PREFIX = "g2diagnostic." - ID_MESSAGES = { - # TODO: remove + concats for f-strings - 4001: PREFIX + "G2Diagnostic_checkDBPerf({0}) failed. Return code: {1}", - 4003: PREFIX + "G2Diagnostic_destroy() failed. Return code: {0}", - 4007: PREFIX + "G2Diagnostic_getDBInfo() failed. Return code: {0}", - 4018: PREFIX + "G2Diagnostic_init({0}, {1}, {2}) failed. Return code: {3}", - 4019: PREFIX - + "G2Diagnostic_initWithConfigID({0}, {1}, {2}, {3}) failed. Return code: {4}", - 4020: PREFIX + "G2Diagnostic_reinit({0}) failed. Return Code: {1}", - 4021: PREFIX - + "G2Config({0}, {1}) must have both module_name and ini_params nor neither.", - } - - # ------------------------------------------------------------------------- - # Interface definition - # ------------------------------------------------------------------------- - - @abstractmethod - def check_db_perf(self, seconds_to_run: int, *args: Any, **kwargs: Any) -> str: - """ - The `check_db_perf` method performs inserts to determine rate of insertion. - - Args: - seconds_to_run (int): Duration of the test in seconds. - - Returns: - str: A string containing a JSON document. - - Raises: - TypeError: Incorrect datatype of input parameter. - g2exception.G2Exception: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2diagnostic/check_db_perf.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2diagnostic/check_db_perf.txt - :linenos: - :language: json - """ - - @abstractmethod - def destroy(self, *args: Any, **kwargs: Any) -> None: - """ - The `destroy` method will destroy and perform cleanup for the Senzing G2Diagnostic object. - It should be called after all other calls are complete. - - **Note:** If the `G2Diagnostic` constructor was called with parameters, - the destructor will automatically call the destroy() method. - In this case, a separate call to `destroy()` is not needed. - - Example: - - .. code-block:: python - - g2_diagnostic = g2diagnostic.G2Diagnostic(module_name, ini_params) - - Raises: - g2exception.G2Exception: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2diagnostic/g2diagnostic_init_and_destroy.py - :linenos: - :language: python - """ - - @abstractmethod - def get_available_memory(self, *args: Any, **kwargs: Any) -> int: - """ - The `get_available_memory` method returns the available memory, in bytes, on the host system. - - Returns: - int: Number of bytes of available memory. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2diagnostic/get_available_memory.py - :linenos: - :language: python - """ - - @abstractmethod - def get_db_info(self, *args: Any, **kwargs: Any) -> str: - """ - The `get_db_info` method returns information about the database connection. - - Returns: - str: A JSON document enumerating data sources. - - Raises: - g2exception.G2Exception: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2diagnostic/get_db_info.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2diagnostic/get_db_info.txt - :linenos: - :language: json - """ - - @abstractmethod - def get_logical_cores(self, *args: Any, **kwargs: Any) -> int: - """ - The `get_logical_cores` method returns the number of logical cores on the host system. - - Returns: - int: Number of logical cores. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2diagnostic/get_logical_cores.py - :linenos: - :language: python - """ - - @abstractmethod - def get_physical_cores(self, *args: Any, **kwargs: Any) -> int: - """ - The `get_physical_cores` method returns the number of physical cores on the host system. - - Returns: - int: Number of physical cores. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2diagnostic/get_physical_cores.py - :linenos: - :language: python - """ - - @abstractmethod - def get_total_system_memory(self, *args: Any, **kwargs: Any) -> int: - """ - The `get_total_system_memory` method returns the total memory, in bytes, on the host system. - - Returns: - int: Number of bytes of memory. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2diagnostic/get_total_system_memory.py - :linenos: - :language: python - """ - - @abstractmethod - def init( - self, - module_name: str, - ini_params: Union[str, Dict[Any, Any]], - verbose_logging: int = 0, - **kwargs: Any - ) -> None: - """ - The `init` method initializes the Senzing G2Diagnosis object. - It must be called prior to any other calls. - - **Note:** If the G2Diagnosis constructor is called with parameters, - the constructor will automatically call the `init()` method. - In this case, a separate call to `init()` is not needed. - - Example: - - .. code-block:: python - - g2_diagnosis = g2diagnosis.G2Diagnosis(module_name, ini_params) - - Args: - module_name (str): A name for the auditing node, to help identify it within system logs. - ini_params (Union[str, Dict[Any, Any]]): A JSON string containing configuration parameters. - verbose_logging (int): `Optional:` A flag to enable deeper logging of the G2 processing. 0 for no Senzing logging; 1 for logging. Default: 0 - - Raises: - TypeError: Incorrect datatype of input parameter. - g2exception.G2Exception: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2diagnostic/g2diagnostic_init_and_destroy.py - :linenos: - :language: python - """ - - @abstractmethod - def init_with_config_id( - self, - module_name: str, - ini_params: Union[str, Dict[Any, Any]], - init_config_id: int, - verbose_logging: int = 0, - **kwargs: Any - ) -> None: - """ - The `init_with_config_id` method initializes the Senzing G2Diagnosis object with a non-default configuration ID. - It must be called prior to any other calls. - - **Note:** If the G2Diagnosis constructor is called with parameters, - the constructor will automatically call the `init()` method. - In this case, a separate call to `init()` is not needed. - - Example: - - .. code-block:: python - - g2_diagnosis = g2diagnosis.G2Diagnosis(module_name, ini_params, init_config_id) - - Args: - module_name (str): A name for the auditing node, to help identify it within system logs. - ini_params Union[str, Dict[Any, Any]]): A JSON string containing configuration parameters. - init_config_id (int): The configuration ID used for the initialization. - verbose_logging (int): `Optional:` A flag to enable deeper logging of the G2 processing. 0 for no Senzing logging; 1 for logging. Default: 0 - - Raises: - TypeError: Incorrect datatype of input parameter. - g2exception.G2Exception: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2diagnostic/g2diagnostic_init_with_config_id.py - :linenos: - :language: python - """ - - @abstractmethod - def reinit(self, init_config_id: int, *args: Any, **kwargs: Any) -> None: - """ - The `reinit` method re-initializes the Senzing G2Diagnosis object. - - Args: - init_config_id (int): The configuration ID used for the initialization - - Raises: - TypeError: Incorrect datatype of input parameter. - g2exception.G2Exception: init_config_id does not exist. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2diagnostic/g2diagnostic_reinit.py - :linenos: - :language: python - """ - - # ------------------------------------------------------------------------- - # Convenience methods - # ------------------------------------------------------------------------- - - def help(self, method_name: str = "") -> str: - """ - Return the help for a particular message. - - Args: - method_name (str): The name of the method. (e.g. "init"). If empty, a list of methods and descriptions is returned. - - Returns: - str: The Help information about the requested method - """ - return construct_help(self, method_name=method_name) diff --git a/src/senzing_abstract/g2engine_abstract.py b/src/senzing_abstract/g2engine_abstract.py deleted file mode 100644 index e74fe70..0000000 --- a/src/senzing_abstract/g2engine_abstract.py +++ /dev/null @@ -1,2601 +0,0 @@ -#! /usr/bin/env python3 - -""" -TODO: g2engine_abstract.py -""" - -# pylint: disable=C0302 - - -# Import from standard library. https://docs.python.org/3/library/ - -import json -from abc import ABC, abstractmethod -from typing import Any, Dict, Iterable, Tuple, Union, cast - -from .g2engineflags import G2EngineFlags -from .g2helpers import construct_help - -# Metadata - -__all__ = ["G2EngineAbstract"] -__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ -__date__ = "2023-12-14" -__updated__ = "2023-12-14" - - -class G2EngineAbstract(ABC): - """ - G2 engine module access library - """ - - # ------------------------------------------------------------------------- - # Messages - # ------------------------------------------------------------------------- - - # TODO: Change to f-strings - # Change to be same as g2Product: G2Engine_ - PREFIX = "g2engine." - """ :meta private: """ - - ID_MESSAGES = { - 4001: PREFIX + "G2_addRecord({0}, {1}, {2}, {3}) failed. Return code: {4}", - 4002: PREFIX - + "G2_addRecordWithInfo({0}, {1}, {2}, {3}, {4}) failed. Return code: {5}", - 4003: PREFIX - + "G2_addRecordWithInfoWithReturnedRecordID({0}, {1}, {2}, {3}) failed. Return code: {4}", - 4004: PREFIX - + "G2_addRecordWithReturnedRecordID({0}, {1}, {2}) failed. Return code: {3}", - 4005: PREFIX + "G2_checkRecord({0}, {1}) failed. Return code: {2}", - 4006: PREFIX + "G2_closeExport({0}) failed. Return code: {1}", - 4007: PREFIX + "G2_deleteRecord({0}, {1}, {2}) failed. Return code: {3}", - 4008: PREFIX - + "G2_deleteRecordWithInfo({0}, {1}, {2}, {3}) failed. Return code: {4}", - 4009: PREFIX + "G2_destroy() failed. Return code: {0}", - 4010: PREFIX + "G2_exportConfigAndConfigID() failed. Return code: {0}", - 4011: PREFIX + "G2_exportConfig() failed. Return code: {0}", - 4012: PREFIX + "G2_exportCSVEntityReport({0}, {1}) failed. Return code: {2}", - 4013: PREFIX + "G2_exportJSONEntityReport({0}) failed. Return code: {1}", - 4014: PREFIX + "G2_fetchNext({0}) failed. Return code: {1}", - 4015: PREFIX - + "G2_findInterestingEntitiesByEntityID({0}, {1}) failed. Return code: {2}", - 4016: PREFIX - + "G2_findInterestingEntitiesByRecordID({0}, {1}, {2}) failed. Return code: {3}", - 4017: PREFIX - + "G2_findNetworkByEntityID({0}, {1}, {2}, {3}) failed. Return code: {4}", - 4018: PREFIX - + "G2_findNetworkByEntityID_V2({0}, {1}, {2}, {3}, {4}) failed. Return code: {5}", - 4019: PREFIX - + "G2_findNetworkByRecordID({0}, {1}, {2}, {3}) failed. Return code: {4}", - 4020: PREFIX - + "G2_findNetworkByRecordID_V2({0}, {1}, {2}, {3}, {4}) failed. Return code: {5}", - 4021: PREFIX + "G2_findPathByEntityID({0}, {1}, {2}) failed. Return code: {3}", - 4022: PREFIX - + "G2_findPathByEntityID_V2({0}, {1}, {2}, {3}) failed. Return code: {4}", - 4023: PREFIX - + "G2_findPathByRecordID({0}, {1}, {2}, {3}, {4}) failed. Return code: {5}", - 4024: PREFIX - + "G2_findPathByRecordID_V2({0}, {1}, {2}, {3}, {4}, {5}) failed. Return code: {0}", - 4025: PREFIX - + "G2_findPathExcludingByEntityID({0}, {1}, {2}, {3}) failed. Return code: {4}", - 4026: PREFIX - + "G2_findPathExcludingByEntityID_V2({0}, {1}, {2}, {3}, {4}) failed. Return code: {5}", - 4027: PREFIX - + "G2_findPathExcludingByRecordID({0}, {1}, {2}, {3} {4}, {5}) failed. Return code: {6}", - 4028: PREFIX - + "G2_findPathExcludingByRecordID_V2({0}, {1}, {2}, {3} {4}, {5}, {6}) failed. Return code: {7}", - 4029: PREFIX - + "G2_findPathIncludingSourceByEntityID({0}, {1}, {2}, {3}, {4}) failed. Return code: {5}", - 4030: PREFIX - + "G2_findPathIncludingSourceByEntityID_V2({0}, {1}, {2}, {3}, {4}, {5}) failed. Return code: {6}", - 4031: PREFIX - + "G2_findPathIncludingSourceByRecordID({0}, {1}, {2}, {3} {4}, {5}, {6}) failed. Return code: {7}", - 4032: PREFIX - + "G2_findPathIncludingSourceByRecordID_V2({0}, {1}, {2}, {3} {4}, {5}, {6}, {7}) failed. Return code: {8}", - 4033: PREFIX + "G2_getActiveConfigID() failed. Return code: {0}", - # TODO Modified to reflect V4 - # 4034: PREFIX + "G2_getEntityByEntityID({0}) failed. Return code: {1}", - 4034: PREFIX + "G2_getEntityByEntityID({0}, {1}) failed. Return code: {2}", - 4035: PREFIX + "G2_getEntityByEntityID_V2({0}, {1}) failed. Return code: {2}", - 4036: PREFIX + "G2_getEntityByRecordID({0}, {1}) failed. Return code: {2}", - 4037: PREFIX - + "G2_getEntityByRecordID_V2({0}, {1}, {2}) failed. Return code: {3}", - 4038: PREFIX + "G2_getLastException() failed. Return code: {0}", - 4039: PREFIX + "G2_getRecord({0}, {1}) failed. Return code: {2}", - 4040: PREFIX + "G2_getRecord_V2({0}, {1}, {2}) failed. Return code: {3}", - 4041: PREFIX + "G2_getRedoRecord() failed. Return code: {0}", - 4042: PREFIX + "G2_getRepositoryLastModifiedTime() failed. Return code: {0}", - 4043: PREFIX + "G2_getVirtualEntityByRecordID({0}) failed. Return code: {1}", - 4044: PREFIX - + "G2_getVirtualEntityByRecordID_V2({0}, {1}) failed. Return code: {2}", - 4045: PREFIX + "G2_howEntityByEntityID({0}) failed. Return code: {1}", - 4046: PREFIX + "G2_howEntityByEntityID_V2({0}, {1}) failed. Return code: {2}", - 4047: PREFIX + "G2_init({0}, {1}, {2}) failed. Return code: {3}", - 4048: PREFIX - + "G2_initWithConfigID({0}, {1}, {2}, {3}) failed. Return code: {4}", - 4049: PREFIX + "G2_primeEngine() failed. Return code: {0}", - 4050: PREFIX + "G2_process({0}) failed. Return code: {1}", - 4051: PREFIX + "G2_processRedoRecord() failed. Return code: {0}", - 4052: PREFIX + "G2_processRedoRecordWithInfo({0}) failed. Return code: {0}", - 4053: PREFIX + "G2_processWithInfo({0}, {1}) failed. Return code: {2}", - 4054: PREFIX + "G2_processWithResponse({0}) failed. Return code: {1}", - 4055: PREFIX + "G2_processWithResponseResize({0}) failed. Return code: {1}", - 4056: PREFIX + "G2_purgeRepository() failed. Return code: {0}", - 4057: PREFIX + "G2_reevaluateEntity({0}, {1}) failed. Return code: {2}", - 4058: PREFIX + "G2_reevaluateEntityWithInfo({0}, {1}) failed. Return code: {2}", - 4059: PREFIX + "G2_reevaluateRecord({0}, {1}, {2}) failed. Return code: {3}", - 4060: PREFIX - + "G2_reevaluateRecordWithInfo({0}, {1}, {2}) failed. Return code: {3}", - 4061: PREFIX + "G2_reinit({0}) failed. Return code: {1}", - 4062: PREFIX + "G2_replaceRecord({0}, {1}, {2}, {3}) failed. Return code: {4}", - 4063: PREFIX - + "G2_replaceRecordWithInfo({0}, {1}, {2}, {3}, {4}) failed. Return code: {5}", - 4064: PREFIX + "G2_searchByAttributes({0}) failed. Return code: {5}", - 4065: PREFIX + "G2_searchByAttributes_V2({0}, {1}) failed. Return code: {2}", - 4066: PREFIX + "G2_stats() failed. Return code: {0}", - 4067: PREFIX + "G2_whyEntities({0}, {1}) failed. Return code: {2}", - 4068: PREFIX + "G2_whyEntities_V2({0}, {1}, {2}) failed. Return code: {3}", - 4069: PREFIX + "G2_whyEntityByEntityID({0}) failed. Return code: {1}", - 4070: PREFIX + "G2_whyEntityByEntityID_V2({0}, {1}) failed. Return code: {2}", - 4071: PREFIX + "G2_whyEntityByRecordID({0}, {1}) failed. Return code: {2}", - 4072: PREFIX - + "G2_whyEntityByRecordID_V2({0}, {1}, {2}) failed. Return code: {3}", - 4073: PREFIX + "G2_whyRecords({0}, {1}, {2}, {3}) failed. Return code: {4}", - 4074: PREFIX - + "G2_whyRecords_V2({0}, {1}, {2}, {3}, {4}) failed. Return code: {5}", - 4075: PREFIX - + "G2Engine{0}, {1}) failed. module_name and ini_params must both be set or both be empty", - } - """ :meta private: """ - - # ------------------------------------------------------------------------- - # Interface definition - # ------------------------------------------------------------------------- - - @abstractmethod - def add_record( - self, - data_source_code: str, - record_id: str, - json_data: Union[str, Dict[Any, Any]], - # TODO: load_id is no longer used, being removed from V4 C api? - load_id: str = "", - **kwargs: Any, - ) -> None: - """ - 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. - - Args: - data_source_code (str): Identifies the provenance of the data. - record_id (str): The unique identifier within the records of the same data source. - json_data (Union[str, Dict[Any, Any]]): A JSON document containing the record to be added to the Senzing repository. - load_id (str, optional): An identifier used to distinguish different load batches/sessions. An empty string is acceptable. Defaults to "". - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/add_record.py - :linenos: - :language: python - """ - - @abstractmethod - def add_record_with_info( - self, - data_source_code: str, - record_id: str, - json_data: Union[str, Dict[Any, Any]], - # TODO: load_id is no longer used, being removed from V4 C api? - load_id: str = "", - flags: int = 0, - **kwargs: Any, - ) -> str: - """ - The `add_record_with_info` method adds a record into the Senzing repository and returns information on the affected entities. - Can be called as many times as desired and from multiple threads at the same time. - - Args: - data_source_code (str): Identifies the provenance of the data. - record_id (str): The unique identifier within the records of the same data source. - json_data (Union[str, Dict[Any, Any]]): A JSON document containing the record to be added to the Senzing repository. - load_id (str, optional): An identifier used to distinguish different load batches/sessions. An empty string is acceptable. Defaults to "". - flags (int, optional): Flags used to control information returned. Defaults to 0. - - Returns: - str: A JSON document containing the ENTITY_ID values of the affected entities. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/add_record_with_info.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/add_record_with_info.txt - :linenos: - :language: json - """ - - @abstractmethod - def close_export(self, response_handle: int, **kwargs: Any) -> None: - """ - 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. - - Args: - response_handle (int): A handle created by `export_json_entity_report` or `export_csv_entity_report`. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/export_json_fetch_close.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/export_json_fetch_close.txt - :linenos: - :language: json - """ - - @abstractmethod - def count_redo_records(self, **kwargs: Any) -> int: - """ - The `count_redo_records` method returns the number of records in need of redo-ing. - - Returns: - int: The number of redo records in Senzing's redo queue. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/count_redo_records.py - :linenos: - :language: python - """ - - @abstractmethod - def delete_record( - self, - data_source_code: str, - record_id: str, - # TODO: load_id is no longer used, being removed from V4 C api? - load_id: str = "", - **kwargs: Any, - ) -> None: - """ - 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. - - Args: - data_source_code (str): Identifies the provenance of the data. - record_id (str): The unique identifier within the records of the same data source. - load_id (str, optional): An identifier used to distinguish different load batches/sessions. An empty string is acceptable. Defaults to "". - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/delete_record.py - :linenos: - :language: python - """ - - @abstractmethod - def delete_record_with_info( - self, - data_source_code: str, - record_id: str, - # TODO: load_id is no longer used, being removed from V4 C api? - load_id: str = "", - flags: int = 0, - **kwargs: Any, - ) -> str: - """ - The `delete_record_with_info` method deletes a record from the Senzing repository and returns a JSON document containing the IDs of the affected entities. - - Args: - data_source_code (str): Identifies the provenance of the data. - record_id (str): The unique identifier within the records of the same data source. - load_id (str, optional): An identifier used to distinguish different load batches/sessions. An empty string is acceptable. Defaults to "". - flags (int, optional): Flags used to control information returned. Defaults to 0. - - Returns: - str: Flags used to control information returned. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/delete_record_with_info.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/delete_record_with_info.txt - :linenos: - :language: json - """ - - @abstractmethod - def destroy(self, **kwargs: Any) -> None: - """ - The `destroy` method releases resources and performs cleanup for the G2Engine object and any in-memory configurations. - It should be called after all other calls are complete. - - **Note:** If the `G2Engine` constructor was called with parameters, - the destructor will automatically call the destroy() method. - In this case, a separate call to `destroy()` is not needed. - - Example: - - .. code-block:: python - - g2_engine = g2engine.G2Engine(module_name, ini_params) - - Raises: - g2exception.G2Exception: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/g2engine_init_and_destroy.py - :linenos: - :language: python - """ - - @abstractmethod - def export_config(self, **kwargs: Any) -> str: - """ - The `export_config` method returns the current Senzing engine configuration. - - Returns: - str: A JSON document containing the current Senzing Engine configuration. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/export_config.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/export_config.txt - :linenos: - :language: json - """ - - @abstractmethod - def export_config_and_config_id(self, **kwargs: Any) -> Tuple[str, int]: - """ - Similar to `export_config`, the `export_config_and_config_id` method returns the current Senzing engine configuration and it's identifier. - - Returns: - Tuple[str, int]: [A JSON document containing the current Senzing Engine configuration, The unique identifier of the Senzing Engine configuration] - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/export_config_and_config_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/export_config_and_config_id.txt - :linenos: - :language: json - """ - - @abstractmethod - def export_csv_entity_report( - self, - csv_column_list: str, - flags: int = G2EngineFlags.G2_EXPORT_DEFAULT_FLAGS, - **kwargs: Any, - ) -> int: - """ - **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. - - Args: - 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 G2EngineFlags.G2_EXPORT_DEFAULT_FLAGS. - - Returns: - int: A handle that identifies the document to be scrolled through using `fetch_next`. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/export_csv_fetch_close.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/export_csv_fetch_close.txt - :linenos: - :language: json - """ - - @abstractmethod - def export_csv_entity_report_iterator( - self, - flags: int = G2EngineFlags.G2_EXPORT_DEFAULT_FLAGS, - **kwargs: Any, - ) -> Iterable[str]: - """ - A simplification of the `export_csv_entity_report`, `fetch_next`, `close_export` lifecycle of a list of entities to export. - - Args: - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_EXPORT_DEFAULT_FLAGS. - - Returns: - Iterable[str]: _description_ - """ - - @abstractmethod - def export_json_entity_report( - self, flags: int = G2EngineFlags.G2_EXPORT_DEFAULT_FLAGS, **kwargs: Any - ) -> int: - """ - **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. - - Args: - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_EXPORT_DEFAULT_FLAGS. - - Returns: - int: A handle that identifies the document to be scrolled through using `fetch_next`. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/export_json_fetch_close.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/export_json_fetch_close.txt - :linenos: - :language: json - """ - - @abstractmethod - def export_json_entity_report_iterator( - self, - flags: int = G2EngineFlags.G2_EXPORT_DEFAULT_FLAGS, - **kwargs: Any, - ) -> Iterable[str]: - """ - A simplification of the `export_json_entity_report`, `fetch_next`, `close_export` lifecycle of a list of entities to export. - - Args: - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_EXPORT_DEFAULT_FLAGS. - - Returns: - Iterable[str]: TODO: - """ - - @abstractmethod - def fetch_next(self, response_handle: int, **kwargs: Any) -> str: - """ - 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. - - Args: - response_handle (int): A handle created by `export_json_entity_report` or `export_json_entity_report`. - - Returns: - str: TODO: - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/export_json_fetch_close.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/export_json_fetch_close.txt - :linenos: - :language: json - """ - - @abstractmethod - def find_interesting_entities_by_entity_id( - self, entity_id: int, flags: int = 0, **kwargs: Any - ) -> str: - """ - The `find_interesting_entities_by_entity_id` method... TODO: - - Args: - entity_id (int): The unique identifier of an entity. - flags (int, optional): Flags used to control information returned. Defaults to 0. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_interesting_entities_by_entity_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_interesting_entities_by_entity_id.txt - :linenos: - :language: json - """ - - @abstractmethod - def find_interesting_entities_by_record_id( - self, data_source_code: str, record_id: str, flags: int = 0, **kwargs: Any - ) -> str: - """ - The `find_interesting_entities_by_record_id` method... TODO: - - Args: - 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: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_interesting_entities_by_record_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_interesting_entities_by_record_id.txt - :linenos: - :language: json - """ - - # TODO: This should be going away in V4? - @abstractmethod - def find_network_by_entity_id_v2( - self, - entity_list: Union[str, Dict[Any, Any]], - max_degree: int, - build_out_degree: int, - max_entities: int, - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `find_network_by_entity_id_v2` method finds all entities surrounding a requested set of entities. - This includes the requested entities, paths between them, and relations to other nearby entities. - It extends `find_network_by_entity_id` by adding output control flags. - - Args: - entity_list (Union[str, Dict[Any, Any]]): A JSON document listing entities. - max_degree (int): The maximum number of degrees in paths between search entities. - build_out_degree (int): The number of degrees of relationships to show around each search entity. - 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 G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_network_by_entity_id_v2.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_network_by_entity_id_v2.txt - :linenos: - :language: json - """ - - @abstractmethod - def find_network_by_entity_id( - self, - entity_list: Union[str, Dict[Any, Any]], - max_degree: int, - build_out_degree: int, - max_entities: int, - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - 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. - - To control output, use `find_network_by_entity_id_v2` instead. - - Args: - entity_list (Union[str, Dict[Any, Any]]): A JSON document listing entities. - max_degree (int): The maximum number of degrees in paths between search entities. - build_out_degree (int): The number of degrees of relationships to show around each search entity. - 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 G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_network_by_entity_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_network_by_entity_id.txt - :linenos: - :language: json - """ - - # TODO: This should be going away in V4? - @abstractmethod - def find_network_by_record_id_v2( - self, - record_list: Union[str, Dict[Any, Any]], - max_degree: int, - build_out_degree: int, - max_entities: int, - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `find_network_by_record_id_v2` 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. - - It extends `find_network_by_record_id` by adding output control flags. - - Args: - record_list (Union[str, Dict[Any, Any]]): A JSON document listing records. - max_degree (int): The maximum number of degrees in paths between search entities. - build_out_degree (int): The number of degrees of relationships to show around each search entity. - 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 G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_network_by_record_id_v2.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_network_by_record_id_v2.txt - :linenos: - :language: json - """ - - @abstractmethod - def find_network_by_record_id( - self, - record_list: Union[str, Dict[Any, Any]], - max_degree: int, - build_out_degree: int, - max_entities: int, - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - 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. - - To control output, use `find_network_by_record_id_v2` instead. - - Args: - record_list (Union[str, Dict[Any, Any]]): A JSON document listing records. - max_degree (int): The maximum number of degrees in paths between search entities. - build_out_degree (int): The number of degrees of relationships to show around each search entity. - 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 G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_network_by_record_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_network_by_record_id.txt - :linenos: - :language: json - """ - - # TODO: This should be going away in V4? - @abstractmethod - def find_path_by_entity_id_v2( - self, - entity_id_1: int, - entity_id_2: int, - max_degree: int, - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `find_path_by_entity_id_v2` method finds single relationship paths between two entities. - Paths are found using known relationships with other entities. - It extends `find_path_by_entity_id` by adding output control flags. - - Args: - 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. - max_degree (int): The maximum number of degrees in paths between search entities. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_path_by_entity_id_v2.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_path_by_entity_id_v2.txt - :linenos: - :language: json - """ - - @abstractmethod - def find_path_by_entity_id( - self, - entity_id_1: int, - entity_id_2: int, - max_degree: int, - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - 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. - To control output, use `find_path_by_entity_id_v2` instead. - - Args: - 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. - max_degree (int): The maximum number of degrees in paths between search entities. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS. - - Returns: - str: A JSON document with an ENTITY_PATHS section that details the path between the entities. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_path_by_entity_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_path_by_entity_id.txt - :linenos: - :language: json - """ - - # TODO: This should be going away in V4? - @abstractmethod - def find_path_by_record_id_v2( - self, - data_source_code_1: str, - record_id_1: str, - data_source_code_2: str, - record_id_2: str, - max_degree: int, - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `find_path_by_record_id_v2` method finds all entities surrounding a requested set of entities identified by record identifiers. - This includes the requested entities, paths between them, and relations to other nearby entities. - It extends `find_path_by_record_id` by adding output control flags. - - Args: - data_source_code_1 (str): Identifies the provenance of the record for the starting entity of the search path. - record_id_1 (str): The unique identifier within the records of the same data source for the starting entity of the search path. - data_source_code_2 (str): Identifies the provenance of the record for the ending entity of the search path. - record_id_2 (str): The unique identifier within the records of the same data source for the ending entity of the search path. - max_degree (int): The maximum number of degrees in paths between search entities. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_path_by_record_id_v2.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_path_by_record_id_v2.txt - :linenos: - :language: json - """ - - @abstractmethod - def find_path_by_record_id( - self, - data_source_code_1: str, - record_id_1: str, - data_source_code_2: str, - record_id_2: str, - max_degree: int, - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - 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. - To control output, use `find_path_by_record_id_v2` instead. - - Args: - data_source_code_1 (str): Identifies the provenance of the record for the starting entity of the search path. - record_id_1 (str): The unique identifier within the records of the same data source for the starting entity of the search path. - data_source_code_2 (str): Identifies the provenance of the record for the ending entity of the search path. - record_id_2 (str): The unique identifier within the records of the same data source for the ending entity of the search path. - max_degree (int): The maximum number of degrees in paths between search entities. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_path_by_record_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_path_by_record_id.txt - :linenos: - :language: json - """ - - # TODO: This should be going away in V4? - @abstractmethod - def find_path_excluding_by_entity_id_v2( - self, - entity_id_1: int, - entity_id_2: int, - max_degree: int, - excluded_entities: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `find_path_excluding_by_entity_id_v2` method finds single relationship paths between two entities. - Paths are found using known relationships with other entities. - In addition, it will find paths that exclude certain entities from being on the path. - It extends `find_path_excluding_by_entity_id` by adding output control flags. - - Args: - 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. - max_degree (int): The maximum number of degrees in paths between search entities. - excluded_entities (Union[str, Dict[Any, Any]]): A JSON document listing entities that should be avoided on the path. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_path_excluding_by_entity_id_v2.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_path_excluding_by_entity_id_v2.txt - :linenos: - :language: json - """ - - @abstractmethod - def find_path_excluding_by_entity_id( - self, - entity_id_1: int, - entity_id_2: int, - max_degree: int, - excluded_entities: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `find_path_excluding_by_entity_id` method finds the most efficient relationship between two entities path based on the parameters while preferentially excluding specific ENTITY_IDs, 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. - To control output, use `find_path_excluding_by_entity_id_v2` instead. - - By default, any excluded entities are strictly excluded. - The G2_FIND_PATH_PREFER_EXCLUDE flag sets the exclusion to preferred instead of strict exclusion. - Preferred exclusion means that if an excluded entity is the only one in the path, it will be used, - but strict will never include excluded entities in the path. - - Args: - 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. - max_degree (int): The maximum number of degrees in paths between search entities. - excluded_entities (Union[str, Dict[Any, Any]]): A JSON document listing entities that should be avoided on the path. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_path_excluding_by_entity_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_path_excluding_by_entity_id.txt - :linenos: - :language: json - """ - - # TODO: This should be going away in V4? - @abstractmethod - def find_path_excluding_by_record_id_v2( - self, - data_source_code_1: str, - record_id_1: str, - data_source_code_2: str, - record_id_2: str, - max_degree: int, - excluded_records: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `find_path_excluding_by_record_id_v2` method finds single relationship paths between two entities. - Paths are found using known relationships with other entities. - In addition, it will find paths that exclude certain entities from being on the path. - It extends `find_path_excluding_by_record_id` by adding output control flags. - - When excluding entities, the user may choose to either strictly exclude the entities, - or prefer to exclude the entities but still include them if no other path is found. - By default, entities will be strictly excluded. - A "preferred exclude" may be done by specifying the G2_FIND_PATH_PREFER_EXCLUDE control flag. - - Args: - data_source_code_1 (str): Identifies the provenance of the record for the starting entity of the search path. - record_id_1 (str): The unique identifier within the records of the same data source for the starting entity of the search path. - data_source_code_2 (str): Identifies the provenance of the record for the ending entity of the search path. - record_id_2 (str): The unique identifier within the records of the same data source for the ending entity of the search path. - max_degree (int): The maximum number of degrees in paths between search entities. - excluded_records (Union[str, Dict[Any, Any]]): A JSON document listing entities that should be avoided on the path. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_path_excluding_by_record_id_v2.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_path_excluding_by_record_id_v2.txt - :linenos: - :language: json - """ - - @abstractmethod - def find_path_excluding_by_record_id( - self, - data_source_code_1: str, - record_id_1: str, - data_source_code_2: str, - record_id_2: str, - max_degree: int, - excluded_records: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `find_path_excluding_by_record_id` method finds the most efficient relationship between two entities path based on the parameters by RECORD_IDs while preferentially excluding specific ENTITY_IDs 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. - To control output, use `find_path_excluding_by_record_id_v2` instead. - - By default, any excluded entities are strictly excluded. - The G2_FIND_PATH_PREFER_EXCLUDE flag sets the exclusion to preferred instead of strict exclusion. - Preferred exclusion means that if an excluded entity is the only one in the path, it will be used, - but strict will never include excluded entities in the path. - - Args: - data_source_code_1 (str): Identifies the provenance of the record for the starting entity of the search path. - record_id_1 (str): The unique identifier within the records of the same data source for the starting entity of the search path. - data_source_code_2 (str): Identifies the provenance of the record for the ending entity of the search path. - record_id_2 (str): The unique identifier within the records of the same data source for the ending entity of the search path. - max_degree (int): The maximum number of degrees in paths between search entities. - excluded_records (Union[str, Dict[Any, Any]]): A JSON document listing entities that should be avoided on the path. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_path_excluding_by_record_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_path_excluding_by_record_id.txt - :linenos: - :language: json - """ - - # TODO: This should be going away in V4? - @abstractmethod - def find_path_including_source_by_entity_id_v2( - self, - entity_id_1: int, - entity_id_2: int, - max_degree: int, - excluded_entities: Union[str, Dict[Any, Any]], - required_dsrcs: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `find_path_including_source_by_entity_id_v2` method finds single relationship paths between two entities. - In addition, one of the enties along the path must include a specified data source. - Specific entities may also be excluded, - using the same methodology as the `find_path_excluding_by_entity_id_v2` and `find_path_excluding_by_record_id`. - It extends `find_path_including_source_by_entity_id` by adding output control flags. - - Args: - 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. - max_degree (int): The maximum number of degrees in paths between search entities. - excluded_entities (Union[str, Dict[Any, Any]]): A JSON document listing entities that should be avoided on the path. - required_dsrcs (Union[str, Dict[Any, Any]]): A JSON document listing data sources that should be included on the path. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_path_including_source_by_entity_id_v2.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_path_including_source_by_entity_id_v2.txt - :linenos: - :language: json - """ - - @abstractmethod - def find_path_including_source_by_entity_id( - self, - entity_id_1: int, - entity_id_2: int, - max_degree: int, - excluded_entities: Union[str, Dict[Any, Any]], - required_dsrcs: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `find_path_including_source_by_entity_id` method finds the most efficient relationship between two entities path based on the parameters, requiring a path entity to include a RECORD_ID from specified data source. - Specific ENTITY_IDs to exclude can optionally be listed. - - 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. - - By default, any excluded entities are strictly excluded. - The G2_FIND_PATH_PREFER_EXCLUDE flag sets the exclusion to preferred instead of strict exclusion. - Preferred exclusion means that if an excluded entity is the only one in the path, it will be used, - but strict will never include excluded entities in the path. - - To control output, use `find_path_including_source_by_entity_id_v2` instead. - - Args: - 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. - max_degree (int): The maximum number of degrees in paths between search entities. - excluded_entities (Union[str, Dict[Any, Any]]): A JSON document listing entities that should be avoided on the path. - required_dsrcs (Union[str, Dict[Any, Any]]): A JSON document listing data sources that should be included on the path. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_path_including_source_by_entity_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_path_including_source_by_entity_id.txt - :linenos: - :language: json - """ - - # TODO: This should be going away in V4? - @abstractmethod - def find_path_including_source_by_record_id_v2( - self, - data_source_code_1: str, - record_id_1: str, - data_source_code_2: str, - record_id_2: str, - max_degree: int, - excluded_records: Union[str, Dict[Any, Any]], - required_dsrcs: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `find_path_including_source_by_record_id_v2` method finds single relationship paths between two entities. - In addition, one of the enties along the path must include a specified data source. - Specific entities may also be excluded, - using the same methodology as the `find_path_excluding_by_entity_id_v2` and `find_path_excluding_by_record_id_v2`. - It extends `find_path_including_source_by_record_id` by adding output control flags. - - Args: - data_source_code_1 (str): Identifies the provenance of the record for the starting entity of the search path. - record_id_1 (str): The unique identifier within the records of the same data source for the starting entity of the search path. - data_source_code_2 (str): Identifies the provenance of the record for the ending entity of the search path. - record_id_2 (str): The unique identifier within the records of the same data source for the ending entity of the search path. - max_degree (int): The maximum number of degrees in paths between search entities. - excluded_records (Union[str, Dict[Any, Any]]): A JSON document listing entities that should be avoided on the path. - required_dsrcs (Union[str, Dict[Any, Any]]): A JSON document listing data sources that should be included on the path. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_path_including_source_by_record_id_v2.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_path_including_source_by_record_id_v2.txt - :linenos: - :language: json - """ - - @abstractmethod - def find_path_including_source_by_record_id( - self, - data_source_code_1: str, - record_id_1: str, - data_source_code_2: str, - record_id_2: str, - max_degree: int, - excluded_records: Union[str, Dict[Any, Any]], - required_dsrcs: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `find_path_including_source_by_record_id` method finds the most efficient relationship between two entities path based on the parameters by RECORD_IDs, requiring a path entity to include a RECORD_ID from specified data source. - Specific ENTITY_IDs to exclude can optionally be listed. - - 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. - - By default, any excluded entities are strictly excluded. - The G2_FIND_PATH_PREFER_EXCLUDE flag sets the exclusion to preferred instead of strict exclusion. - Preferred exclusion means that if an excluded entity is the only one in the path, it will be used, - but strict will never include excluded entities in the path. - - To control output, use `find_path_including_source_by_record_id_v2` instead. - - Args: - data_source_code_1 (str): Identifies the provenance of the record for the starting entity of the search path. - record_id_1 (str): The unique identifier within the records of the same data source for the starting entity of the search path. - data_source_code_2 (str): Identifies the provenance of the record for the ending entity of the search path. - record_id_2 (str): The unique identifier within the records of the same data source for the ending entity of the search path. - max_degree (int): The maximum number of degrees in paths between search entities. - excluded_records (Union[str, Dict[Any, Any]]): A JSON document listing entities that should be avoided on the path. - required_dsrcs (Union[str, Dict[Any, Any]]): A JSON document listing data sources that should be included on the path. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/find_path_including_source_by_record_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/find_path_including_source_by_record_id.txt - :linenos: - :language: json - """ - - @abstractmethod - def get_active_config_id(self, **kwargs: Any) -> int: - """ - The `get_active_config_id` method returns the identifier of the currently active Senzing engine configuration. - - Returns: - int: The identifier of the active Senzing Engine configuration. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/get_active_config_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/get_active_config_id.txt - :linenos: - :language: json - """ - - # TODO: This should be going away in V4? - @abstractmethod - def get_entity_by_entity_id_v2( - self, - entity_id: int, - flags: int = G2EngineFlags.G2_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `get_entity_by_entity_id_v2` method returns entity data based on the ID of a resolved identity. - It extends `get_entity_by_entity_id` by adding output control flags. - - Args: - entity_id (int): The unique identifier of an entity. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_ENTITY_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/get_entity_by_entity_id_v2.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/get_entity_by_entity_id_v2.txt - :linenos: - :language: json - """ - - @abstractmethod - def get_entity_by_entity_id( - self, - entity_id: int, - flags: int = G2EngineFlags.G2_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `get_entity_by_entity_id` method returns entity data based on the ID of a resolved identity. - To control output, use `get_entity_by_entity_id_v2` instead. - - Args: - entity_id (int): The unique identifier of an entity. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_ENTITY_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/get_entity_by_entity_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/get_entity_by_entity_id.txt - :linenos: - :language: json - """ - - # TODO: This should be going away in V4? - @abstractmethod - def get_entity_by_record_id_v2( - self, - data_source_code: str, - record_id: str, - flags: int = G2EngineFlags.G2_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `get_entity_by_record_id_v2` method returns entity data based on the ID of a record which is a member of the entity. - It extends `get_entity_by_record_id` by adding output control flags. - - Args: - 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 G2EngineFlags.G2_ENTITY_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/get_entity_by_record_id_v2.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/get_entity_by_record_id_v2.txt - :linenos: - :language: json - """ - - @abstractmethod - def get_entity_by_record_id( - self, - data_source_code: str, - record_id: str, - flags: int = G2EngineFlags.G2_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `get_entity_by_record_id` method returns entity data based on the ID of a record which is a member of the entity. - To control output, use `get_entity_by_record_id_v2` instead. - - Args: - 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 G2EngineFlags.G2_ENTITY_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/get_entity_by_record_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/get_entity_by_record_id.txt - :linenos: - :language: json - """ - - # TODO: This should be going away in V4? - @abstractmethod - def get_record_v2( - self, - data_source_code: str, - record_id: str, - flags: int = G2EngineFlags.G2_RECORD_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `get_record_v2` method returns a JSON document of a single record from the Senzing repository. - It extends `get_record` by adding output control flags. - Can be called as many times as desired and from multiple threads at the same time. - - Args: - 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 G2EngineFlags.G2_RECORD_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/get_record_v2.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/get_record_v2.txt - :linenos: - :language: json - """ - - @abstractmethod - def get_record( - self, - data_source_code: str, - record_id: str, - flags: int = G2EngineFlags.G2_RECORD_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `get_record` method returns a JSON document of a single record from the Senzing repository. - To control output, use `get_record_v2` instead. - Can be called as many times as desired and from multiple threads at the same time. - - Args: - 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 G2EngineFlags.G2_RECORD_DEFAULT_FLAGS. - - Returns: - str: A JSON document of a single record. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/get_record.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/get_record.txt - :linenos: - :language: json - """ - - @abstractmethod - def get_redo_record(self, **kwargs: Any) -> str: - """ - The `get_redo_record` method returns the next internally queued redo record from the Senzing repository. - Usually, the `process_redo_record` or `process_redo_record_with_info` method is called to process the redo record - retrieved by `get_redo_record`. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/get_redo_record.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/get_redo_record.txt - :linenos: - :language: json - """ - - @abstractmethod - def get_repository_last_modified_time(self, **kwargs: Any) -> int: - """ - The `get_repository_last_modified_time` method retrieves the last modified time of the Senzing repository, - measured in the number of seconds between the last modified time and January 1, 1970 12:00am GMT (epoch time). - - Returns: - int: A Unix Timestamp. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/get_repository_last_modified_time.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/get_repository_last_modified_time.txt - :linenos: - :language: json - """ - - # TODO: This should be going away in V4? - @abstractmethod - def get_virtual_entity_by_record_id_v2( - self, - record_list: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_HOW_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - TODO: The `get_virtual_entity_by_record_id_v2` method... - It extends `get_virtual_entity_by_record_id` by adding output control flags. - - Args: - record_list (Union[str, Dict[Any, Any]]): A JSON document of one or more records by DATA_SOURCE and RECORD_ID pairs, formatted as `{"RECORDS":[{"DATA_SOURCE":"DS1","RECORD_ID":"R1"},{"DATA_SOURCE":"DS2","RECORD_ID":"R2"}]}`. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_HOW_ENTITY_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/get_virtual_entity_by_record_id_v2.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/get_virtual_entity_by_record_id_v2.txt - :linenos: - :language: json - """ - - @abstractmethod - def get_virtual_entity_by_record_id( - self, - record_list: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_HOW_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - 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. - To control output, use `get_virtual_entity_by_record_id_v2` instead. - - Args: - record_list (Union[str, Dict[Any, Any]]): A JSON document of one or more records by DATA_SOURCE and RECORD_ID pairs, formatted as `{"RECORDS":[{"DATA_SOURCE":"DS1","RECORD_ID":"R1"},{"DATA_SOURCE":"DS2","RECORD_ID":"R2"}]}`. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_HOW_ENTITY_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/get_virtual_entity_by_record_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/get_virtual_entity_by_record_id.txt - :linenos: - :language: json - """ - - # TODO: This should be going away in V4? - @abstractmethod - def how_entity_by_entity_id_v2( - self, - entity_id: int, - flags: int = G2EngineFlags.G2_HOW_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - TODO: The `how_entity_by_entity_id_v2` method... - It extends `how_entity_by_entity_id` by adding output control flags. - - Args: - entity_id (int): The unique identifier of an entity. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_HOW_ENTITY_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/how_entity_by_entity_id_v2.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/how_entity_by_entity_id_v2.txt - :linenos: - :language: json - """ - - @abstractmethod - def how_entity_by_entity_id( - self, - entity_id: int, - flags: int = G2EngineFlags.G2_HOW_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - TODO: The `how_entity_by_entity_id` method determines and details steps-by-step *how* records resolved to an ENTITY_ID. - - In most cases, *how* provides more detailed information than *why* as the resolution is detailed step-by-step. - - To control output, use `how_entity_by_entity_id_v2` instead. - - Args: - entity_id (int): The unique identifier of an entity. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_HOW_ENTITY_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/how_entity_by_entity_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/how_entity_by_entity_id.txt - :linenos: - :language: json - """ - - @abstractmethod - def init( - self, - module_name: str, - ini_params: Union[str, Dict[Any, Any]], - verbose_logging: int = 0, - **kwargs: Any, - ) -> None: - """ - The `init` method initializes the Senzing G2Engine object. - It must be called prior to any other calls. - - **Note:** If the G2Engine constructor is called with parameters, - the constructor will automatically call the `init()` method. - In this case, a separate call to `init()` is not needed. - - Example: - - .. code-block:: python - - g2_engine = g2engine.G2Engine(module_name, ini_params) - - Args: - module_name (str): A short name given to this instance of the G2Engine object, to help identify it within system logs. - ini_params (Union[str, Dict[Any, Any]]): A JSON document containing configuration parameters. - verbose_logging (int): `Optional:` A flag to enable deeper logging of the G2 processing. 0 for no Senzing logging; 1 for logging. Default: 0 - - Raises: - TypeError: Incorrect datatype of input parameter. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/g2engine_init_and_destroy.py - :linenos: - :language: python - """ - - @abstractmethod - def init_with_config_id( - self, - module_name: str, - ini_params: Union[str, Dict[Any, Any]], - init_config_id: int, - verbose_logging: int = 0, - **kwargs: Any, - ) -> None: - """ - The `init_with_config_id` method initializes the Senzing G2Engine object with a non-default configuration ID. - It must be called prior to any other calls. - - **Note:** If the G2Engine constructor is called with parameters, - the constructor will automatically call the `init()` method. - In this case, a separate call to `init()` is not needed. - - Example: - - .. code-block:: python - - g2_engine = g2engine.G2Engine(module_name, ini_params, init_config_id) - - Args: - module_name (str): A short name given to this instance of the G2Engine object, to help identify it within system logs. - ini_params (Union[str, Dict[Any, Any]]): A JSON document containing configuration parameters. - init_config_id (int): The configuration ID used for the initialization. - verbose_logging (int): `Optional:` A flag to enable deeper logging of the G2 processing. 0 for no Senzing logging; 1 for logging. Default: 0 - - Raises: - TypeError: Incorrect datatype of input parameter. - g2exception.G2Exception: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/g2engine_init_with_config_id.py - :linenos: - :language: python - """ - - @abstractmethod - def prime_engine(self, **kwargs: Any) -> None: - """ - 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 requries these resources. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/prime_engine.py - :linenos: - :language: python - """ - - @abstractmethod - def process(self, record: Union[str, Dict[Any, Any]], **kwargs: Any) -> None: - """ - The `process` method processes the redo record. - Usually the redo record is retrieved with `get_redo_record`. - - Args: - record (Union[str, Dict[Any, Any]]): A JSON document containing the redo record to be processed. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/process.py - :linenos: - :language: python - """ - - @abstractmethod - def process_with_info( - self, record: Union[str, Dict[Any, Any]], flags: int, **kwargs: Any - ) -> str: - """_summary_ - The `process_with_info` method processes the redo record and returns a JSON document containing the ENTITY_ID values of the affected entities. - - Args: - record (Union[str, Dict[Any, Any]]): A JSON document containing the record to be added to the Senzing repository. - flags (int): Flags used to control information returned. - - Returns: - str: A JSON document containing the ENTITY_ID values of the affected entities. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/process_with_info.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/process_with_info.txt - :linenos: - :language: json - """ - - @abstractmethod - def purge_repository(self, **kwargs: Any) -> None: - """ - **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: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/purge_repository.py - :linenos: - :language: python - """ - - @abstractmethod - def reevaluate_entity(self, entity_id: int, flags: int = 0, **kwargs: Any) -> None: - """ - The `reevaluate_entity` method reevaluates the specified entity. - - Args: - entity_id (int): The unique identifier of an entity. - flags (int, optional): Flags used to control information returned. Defaults to 0. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/reevaluate_entity.py - :linenos: - :language: python - """ - - @abstractmethod - def reevaluate_entity_with_info( - self, entity_id: int, flags: int = 0, **kwargs: Any - ) -> str: - """ - TODO: The `reevaluate_entity_with_info` method reevaluates the specified entity. - and returns a JSON document containing the ENTITY_ID values of the affected entities. - - Args: - entity_id (int): The unique identifier of an entity. - flags (int, optional): Flags used to control information returned. Defaults to 0. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/reevaluate_entity_with_info.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/reevaluate_entity_with_info.txt - :linenos: - :language: json - """ - - @abstractmethod - def reevaluate_record( - self, data_source_code: str, record_id: str, flags: int = 0, **kwargs: Any - ) -> None: - """ - The `reevaluate_record` method reevaluates a specific record. - - Args: - 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. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/reevaluate_entity.py - :linenos: - :language: python - """ - - @abstractmethod - def reevaluate_record_with_info( - self, data_source_code: str, record_id: str, flags: int = 0, **kwargs: Any - ) -> str: - """ - The `reevaluate_record_with_info` reevaluates a specific record - and returns a JSON document containing the ENTITY_ID values of the affected entities. - - Args: - 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: - str: A JSON document containing the ENTITY_ID values of the affected entities. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/reevaluate_record_with_info.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/reevaluate_record_with_info.txt - :linenos: - :language: json - """ - - @abstractmethod - def reinit(self, init_config_id: int, **kwargs: Any) -> None: - """ - The `reinit` method re-initializes the Senzing G2Engine object using a specific configuration identifier. - A list of available configuration identifiers can be retrieved using - `g2configmgr.get_config_list`. - - Args: - init_config_id (int): The configuration ID used for the initialization - - Raises: - TypeError: Incorrect datatype of input parameter. - g2exception.G2Exception: init_config_id does not exist. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/g2engine_reinit.py - :linenos: - :language: python - """ - - @abstractmethod - def replace_record( - self, - data_source_code: str, - record_id: str, - json_data: Union[str, Dict[Any, Any]], - # TODO: load_id is no longer used, being removed from V4 C api? - load_id: str = "", - **kwargs: Any, - ) -> None: - """ - The `replace_record` method updates/replaces a record in the Senzing repository. - If record doesn't exist, a new record is added to the data repository. - - Args: - data_source_code (str): Identifies the provenance of the data. - record_id (str): The unique identifier within the records of the same data source. - json_data (Union[str, Dict[Any, Any]]): A JSON document containing the record to be added to the Senzing repository. - load_id (str, optional): An identifier used to distinguish different load batches/sessions. An empty string is acceptable. Defaults to "". - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/replace_record.py - :linenos: - :language: python - """ - - @abstractmethod - def replace_record_with_info( - self, - data_source_code: str, - record_id: str, - json_data: Union[str, Dict[Any, Any]], - # TODO: load_id is no longer used, being removed from V4 C api? - load_id: str = "", - flags: int = 0, - **kwargs: Any, - ) -> str: - """ - The `replace_record_with_info` method updates/replaces a record in the Senzing repository and returns information on the affected entities. - If record doesn't exist, a new record is added to the data repository. - - Args: - data_source_code (str): Identifies the provenance of the data. - record_id (str): The unique identifier within the records of the same data source. - json_data (Union[str, Dict[Any, Any]]): A JSON document containing the record to be added to the Senzing repository. - load_id (str, optional): An identifier used to distinguish different load batches/sessions. An empty string is acceptable. Defaults to "". - flags (int, optional): Flags used to control information returned. Defaults to 0. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/replace_record_with_info.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/replace_record_with_info.txt - :linenos: - :language: json - """ - - # TODO: This should be going away in V4? - @abstractmethod - def search_by_attributes_v2( - self, - json_data: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `search_by_attributes_v2` method retrieves entity data based on a user-specified set of entity attributes. - It extends `search_by_attributes` by adding output control flags. - - Args: - json_data (Union[str, Dict[Any, Any]]): TODO: - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/search_by_attributes_v2.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/search_by_attributes_v2.txt - :linenos: - :language: json - """ - - # TODO: This should be going away in V4? - @abstractmethod - def search_by_attributes_v3( - self, - json_data: Union[str, Dict[Any, Any]], - search_profile: str, - flags: int = G2EngineFlags.G2_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `search_by_attributes_v3` method retrieves entity data based on a user-specified set of entity attributes. - It extends `search_by_attributes` by adding output control flags and supporting a `search_profile`. - - Args: - json_data (Union[str, Dict[Any, Any]]): TODO: - search_profile (str): TODO: - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/search_by_attributes_v3.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/search_by_attributes_v3.txt - :linenos: - :language: json - """ - - @abstractmethod - def search_by_attributes( - self, - json_data: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `search_by_attributes` method retrieves entity data based on a user-specified set of entity attributes. - To control output, use `search_by_attributes_v2` instead. - To specify a search profile, use `search_by_attributes_v3` instead. - - Args: - json_data (Union[str, Dict[Any, Any]]): A JSON document with the attribute data to search for. - flags (int, optional): _description_. Defaults to G2EngineFlags.G2_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/search_by_attributes.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/search_by_attributes.txt - :linenos: - :language: json - """ - - @abstractmethod - def stats(self, **kwargs: Any) -> str: - """ - The `stats` method retrieves workload statistics for the current process. - These statistics will automatically reset after retrieval. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/stats.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/stats.txt - :linenos: - :language: json - """ - - @abstractmethod - def why_entities_v2( - self, - entity_id_1: int, - entity_id_2: int, - flags: int = G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `why_entities_v2` method explains why records belong to their resolved entities. - `why_entities_v2` will compare the record data within an entity - against the rest of the entity data and show why they are connected. - This is calculated based on the features that record data represents. - It extends `why_entities` by adding output control flags. - - Args: - 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 G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/why_entities_v2.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/why_entities_v2.txt - :linenos: - :language: json - """ - - @abstractmethod - def why_entities( - self, - entity_id_1: int, - entity_id_2: int, - flags: int = G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `why_entities` method determines why entities did not resolve or why they do relate. - - To control output, use `why_entities_v2` instead. - - Args: - 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 G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/why_entities.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/why_entities.txt - :linenos: - :language: json - """ - - # TODO: This should be going away in V4? - @abstractmethod - def why_entity_by_entity_id_v2( - self, - entity_id: int, - flags: int = G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `why_entity_by_entity_id_v2` method explains why records belong to their resolved entities. - It extends `why_entity_by_entity_id` by adding output control flags. - - Args: - entity_id (str): The unique identifier of an entity for the starting entity of the search path. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/why_entity_by_entity_id_v2.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/why_entity_by_entity_id_v2.txt - :linenos: - :language: json - """ - - @abstractmethod - def why_entity_by_entity_id( - self, - entity_id: int, - flags: int = G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `why_entity_by_entity_id` method determines *why* records resolved to an ENTITY_ID. - Returns a JSON document that gives the results of the record analysis. - - It has a “WHY_KEY”, which is similar to a match key, in defining the relevant connected data. - It shows candidate keys for features that initially cause the records to be analyzed for a relationship, - plus a series of feature scores that show how similar the feature data was. - - The response JSON document also contains a separate ENTITIES section, - with the full information about the resolved entity. - - The recommended composite flag is G2_WHY_ENTITY_DEFAULT_FLAGS. - Additional recommended flags are G2_ENTITY_OPTION_INCLUDE_INTERNAL_FEATURES and G2_ENTITY_OPTION_INCLUDE_FEATURE_STATS, - which provide detailed feature data that is useful for understanding the WHY_RESULTS data. - - To control output, use `why_entity_by_entity_id_v2` instead. - - Args: - entity_id (int): The unique identifier of an entity for the starting entity of the search path. - flags (int, optional): Flags used to control information returned. Defaults to G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/why_entity_by_entity_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/why_entity_by_entity_id.txt - :linenos: - :language: json - """ - - # TODO: This should be going away in V4? - @abstractmethod - def why_entity_by_record_id_v2( - self, - data_source_code: str, - record_id: str, - flags: int = G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `why_entity_by_record_id_v2` method explains why records belong to their resolved entities. - It extends `why_entity_by_record_id` by adding output control flags. - - Args: - 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 G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/why_entity_by_record_id_v2.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/why_entity_by_record_id_v2.txt - :linenos: - :language: json - """ - - @abstractmethod - def why_entity_by_record_id( - self, - data_source_code: str, - record_id: str, - flags: int = G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `why_entity_by_record_id` method determines *why* records resolved to an ENTITY_ID by a RECORD_ID. - Returns a JSON document that gives the results of the record analysis. - - It has a “WHY_KEY”, which is similar to a match key, in defining the relevant connected data. - It shows candidate keys for features that initially cause the records to be analyzed for a relationship, - plus a series of feature scores that show how similar the feature data was. - - The response JSON document also contains a separate ENTITIES section, - with the full information about the resolved entity. - - The recommended composite flag is G2_WHY_ENTITY_DEFAULT_FLAGS. - Additional recommended flags are G2_ENTITY_OPTION_INCLUDE_INTERNAL_FEATURES and G2_ENTITY_OPTION_INCLUDE_FEATURE_STATS, - which provide detailed feature data that is useful for understanding the WHY_RESULTS data. - - To control output, use `why_entity_by_record_id_v2` instead. - - Args: - 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 G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/why_entity_by_record_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/why_entity_by_record_id.txt - :linenos: - :language: json - """ - - @abstractmethod - def why_record_in_entity( - self, - data_source_code: str, - record_id: str, - **kwargs: Any, - ) -> str: - """ - Describe why a particular record resolved to an entity. - - Args: - data_source_code (str): Identifies the provenance of the data. - record_id (str): The unique identifier within the records of the same data source. - - Returns: - str: A JSON document describing the relationship of the record to the entity. - """ - - @abstractmethod - def why_record_in_entity_v2( - self, - data_source_code: str, - record_id: str, - flags: int, - **kwargs: Any, - ) -> str: - """ - Describe why a particular record resolved to an entity. - - Args: - 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. - - Returns: - str: A JSON document describing the relationship of the record to the entity. - """ - - # TODO: This should be going away in V4? - @abstractmethod - def why_records_v2( - self, - data_source_code_1: str, - record_id_1: str, - data_source_code_2: str, - record_id_2: str, - flags: int = G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `why_records_v2` determines if any two records can or cannot resolve together, or if they relate. - It extends `why_records` by adding output control flags. - - Args: - 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 G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/why_entity_by_record_id.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/why_entity_by_record_id.txt - :linenos: - :language: json - """ - - @abstractmethod - def why_records( - self, - data_source_code_1: str, - record_id_1: str, - data_source_code_2: str, - record_id_2: str, - flags: int = G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - """ - The `why_records` determines if any two records can or cannot resolve together, or if they relate. - - To control output, use `why_records_v2` instead. - - Args: - 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 G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS. - - Returns: - str: A JSON document. - - Raises: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2engine/why_records.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2engine/why_records.txt - :linenos: - :language: json - """ - - # ------------------------------------------------------------------------- - # Convenience methods - # ------------------------------------------------------------------------- - - def get_record_as_dict( - # self, data_source_code: str, record_id: str, **kwargs: Any - self, - data_source_code: str, - record_id: str, - flags: int = G2EngineFlags.G2_RECORD_DEFAULT_FLAGS, - **kwargs: Any, - ) -> Dict[str, Any]: - """TODO: document""" - return cast( - Dict[str, Any], - json.loads(self.get_record(data_source_code, record_id, flags, **kwargs)), - ) - - def help(self, method_name: str = "") -> str: - """ - Return the help for a particular message. - - Args: - method_name (str): The name of the method. (e.g. "init"). If empty, a list of methods and descriptions is returned. - - Returns: - str: The Help information about the requested method - """ - return construct_help(self, method_name=method_name) diff --git a/src/senzing_abstract/g2engineflags.py b/src/senzing_abstract/g2engineflags.py deleted file mode 100644 index b7f0ca4..0000000 --- a/src/senzing_abstract/g2engineflags.py +++ /dev/null @@ -1,186 +0,0 @@ -#! /usr/bin/env python3 - -""" -TODO: g2engineflags.py -""" - -# TODO: Fix the duplication of this file with g2-sdk-python-next. - -from enum import IntFlag -from typing import Any, List - -# Metadata - -__all__ = ["G2EngineFlags"] -__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ -__date__ = "2023-12-14" -__updated__ = "2023-12-14" - -# ----------------------------------------------------------------------------- -# G2EngineFlags class -# ----------------------------------------------------------------------------- - - -class G2EngineFlags(IntFlag): - """Engine Flags ...""" - - @classmethod - def combine_flags( - cls, list_of_strings: List[str], *args: Any, **kwargs: Any - ) -> int: - """OR together all strings in list_of_strings""" - # pylint: disable=unused-argument - - result = 0 - for string in list_of_strings: - result = result | G2EngineFlags[string] - return result - - # Flags for exporting entity data. - - G2_EXPORT_INCLUDE_RESOLVED = 1 << 0 - G2_EXPORT_INCLUDE_POSSIBLY_SAME = 1 << 1 - G2_EXPORT_INCLUDE_POSSIBLY_RELATED = 1 << 2 - G2_EXPORT_INCLUDE_NAME_ONLY = 1 << 3 - G2_EXPORT_INCLUDE_DISCLOSED = 1 << 4 - G2_EXPORT_INCLUDE_SINGLETONS = 1 << 5 - G2_EXPORT_INCLUDE_ALL_ENTITIES = ( - G2_EXPORT_INCLUDE_RESOLVED | G2_EXPORT_INCLUDE_SINGLETONS - ) - G2_EXPORT_INCLUDE_ALL_RELATIONSHIPS = ( - G2_EXPORT_INCLUDE_POSSIBLY_SAME - | G2_EXPORT_INCLUDE_POSSIBLY_RELATED - | G2_EXPORT_INCLUDE_NAME_ONLY - | G2_EXPORT_INCLUDE_DISCLOSED - ) - - # Flags for outputting entity relation data. - - G2_ENTITY_INCLUDE_POSSIBLY_SAME_RELATIONS = 1 << 6 - G2_ENTITY_INCLUDE_POSSIBLY_RELATED_RELATIONS = 1 << 7 - G2_ENTITY_INCLUDE_NAME_ONLY_RELATIONS = 1 << 8 - G2_ENTITY_INCLUDE_DISCLOSED_RELATIONS = 1 << 9 - G2_ENTITY_INCLUDE_ALL_RELATIONS = ( - G2_ENTITY_INCLUDE_POSSIBLY_SAME_RELATIONS - | G2_ENTITY_INCLUDE_POSSIBLY_RELATED_RELATIONS - | G2_ENTITY_INCLUDE_NAME_ONLY_RELATIONS - | G2_ENTITY_INCLUDE_DISCLOSED_RELATIONS - ) - - # Flags for outputting entity feature data. - - G2_ENTITY_INCLUDE_ALL_FEATURES = 1 << 10 - G2_ENTITY_INCLUDE_REPRESENTATIVE_FEATURES = 1 << 11 - - # Flags for getting extra information about an entity. - - G2_ENTITY_INCLUDE_ENTITY_NAME = 1 << 12 - G2_ENTITY_INCLUDE_RECORD_SUMMARY = 1 << 13 - G2_ENTITY_INCLUDE_RECORD_DATA = 1 << 14 - G2_ENTITY_INCLUDE_RECORD_MATCHING_INFO = 1 << 15 - G2_ENTITY_INCLUDE_RECORD_JSON_DATA = 1 << 16 - G2_ENTITY_INCLUDE_RECORD_FORMATTED_DATA = 1 << 17 - G2_ENTITY_INCLUDE_RECORD_FEATURE_IDS = 1 << 18 - G2_ENTITY_INCLUDE_RELATED_ENTITY_NAME = 1 << 19 - G2_ENTITY_INCLUDE_RELATED_MATCHING_INFO = 1 << 20 - G2_ENTITY_INCLUDE_RELATED_RECORD_SUMMARY = 1 << 21 - G2_ENTITY_INCLUDE_RELATED_RECORD_DATA = 1 << 22 - - # Flags for extra feature data. - - G2_ENTITY_OPTION_INCLUDE_INTERNAL_FEATURES = 1 << 23 - G2_ENTITY_OPTION_INCLUDE_FEATURE_STATS = 1 << 24 - - # Flags for finding entity path data. - - G2_FIND_PATH_PREFER_EXCLUDE = 1 << 25 - - # Flags for including search result information. - - G2_INCLUDE_FEATURE_SCORES = 1 << 26 - G2_SEARCH_INCLUDE_STATS = 1 << 27 - G2_SEARCH_INCLUDE_FEATURE_SCORES = G2_INCLUDE_FEATURE_SCORES - - # Flags for exporting entity data. - - G2_SEARCH_INCLUDE_RESOLVED = G2_EXPORT_INCLUDE_RESOLVED - G2_SEARCH_INCLUDE_POSSIBLY_SAME = G2_EXPORT_INCLUDE_POSSIBLY_SAME - G2_SEARCH_INCLUDE_POSSIBLY_RELATED = G2_EXPORT_INCLUDE_POSSIBLY_RELATED - G2_SEARCH_INCLUDE_NAME_ONLY = G2_EXPORT_INCLUDE_NAME_ONLY - G2_SEARCH_INCLUDE_ALL_ENTITIES = ( - G2_SEARCH_INCLUDE_RESOLVED - | G2_SEARCH_INCLUDE_POSSIBLY_SAME - | G2_SEARCH_INCLUDE_POSSIBLY_RELATED - | G2_SEARCH_INCLUDE_NAME_ONLY - ) - - # Recommended settings. - - G2_RECORD_DEFAULT_FLAGS = G2_ENTITY_INCLUDE_RECORD_JSON_DATA - G2_ENTITY_DEFAULT_FLAGS = ( - G2_ENTITY_INCLUDE_ALL_RELATIONS - | G2_ENTITY_INCLUDE_REPRESENTATIVE_FEATURES - | G2_ENTITY_INCLUDE_ENTITY_NAME - | G2_ENTITY_INCLUDE_RECORD_SUMMARY - | G2_ENTITY_INCLUDE_RECORD_DATA - | G2_ENTITY_INCLUDE_RECORD_MATCHING_INFO - | G2_ENTITY_INCLUDE_RELATED_ENTITY_NAME - | G2_ENTITY_INCLUDE_RELATED_RECORD_SUMMARY - | G2_ENTITY_INCLUDE_RELATED_MATCHING_INFO - ) - G2_ENTITY_BRIEF_DEFAULT_FLAGS = ( - G2_ENTITY_INCLUDE_RECORD_MATCHING_INFO - | G2_ENTITY_INCLUDE_ALL_RELATIONS - | G2_ENTITY_INCLUDE_RELATED_MATCHING_INFO - ) - G2_EXPORT_DEFAULT_FLAGS = ( - G2_EXPORT_INCLUDE_ALL_ENTITIES - | G2_EXPORT_INCLUDE_ALL_RELATIONSHIPS - | G2_ENTITY_INCLUDE_ALL_RELATIONS - | G2_ENTITY_INCLUDE_REPRESENTATIVE_FEATURES - | G2_ENTITY_INCLUDE_ENTITY_NAME - | G2_ENTITY_INCLUDE_RECORD_DATA - | G2_ENTITY_INCLUDE_RECORD_MATCHING_INFO - | G2_ENTITY_INCLUDE_RELATED_MATCHING_INFO - ) - G2_FIND_PATH_DEFAULT_FLAGS = ( - G2_ENTITY_INCLUDE_ALL_RELATIONS - | G2_ENTITY_INCLUDE_ENTITY_NAME - | G2_ENTITY_INCLUDE_RECORD_SUMMARY - | G2_ENTITY_INCLUDE_RELATED_MATCHING_INFO - ) - G2_WHY_ENTITY_DEFAULT_FLAGS = ( - G2_ENTITY_DEFAULT_FLAGS - | G2_ENTITY_INCLUDE_RECORD_FEATURE_IDS - | G2_ENTITY_OPTION_INCLUDE_INTERNAL_FEATURES - | G2_ENTITY_OPTION_INCLUDE_FEATURE_STATS - | G2_INCLUDE_FEATURE_SCORES - ) - G2_HOW_ENTITY_DEFAULT_FLAGS = ( - G2_ENTITY_DEFAULT_FLAGS - | G2_ENTITY_INCLUDE_RECORD_FEATURE_IDS - | G2_ENTITY_OPTION_INCLUDE_INTERNAL_FEATURES - | G2_ENTITY_OPTION_INCLUDE_FEATURE_STATS - | G2_INCLUDE_FEATURE_SCORES - ) - - G2_SEARCH_BY_ATTRIBUTES_ALL = ( - G2_SEARCH_INCLUDE_ALL_ENTITIES - | G2_ENTITY_INCLUDE_REPRESENTATIVE_FEATURES - | G2_ENTITY_INCLUDE_ENTITY_NAME - | G2_ENTITY_INCLUDE_RECORD_SUMMARY - | G2_SEARCH_INCLUDE_FEATURE_SCORES - ) - G2_SEARCH_BY_ATTRIBUTES_STRONG = ( - G2_SEARCH_INCLUDE_RESOLVED - | G2_SEARCH_INCLUDE_POSSIBLY_SAME - | G2_ENTITY_INCLUDE_REPRESENTATIVE_FEATURES - | G2_ENTITY_INCLUDE_ENTITY_NAME - | G2_ENTITY_INCLUDE_RECORD_SUMMARY - | G2_SEARCH_INCLUDE_FEATURE_SCORES - ) - G2_SEARCH_BY_ATTRIBUTES_MINIMAL_ALL = G2_SEARCH_INCLUDE_ALL_ENTITIES - G2_SEARCH_BY_ATTRIBUTES_MINIMAL_STRONG = ( - G2_SEARCH_INCLUDE_RESOLVED | G2_SEARCH_INCLUDE_POSSIBLY_SAME - ) - G2_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS = G2_SEARCH_BY_ATTRIBUTES_ALL diff --git a/src/senzing_abstract/g2exception.py b/src/senzing_abstract/g2exception.py deleted file mode 100644 index 0116b96..0000000 --- a/src/senzing_abstract/g2exception.py +++ /dev/null @@ -1,642 +0,0 @@ -#! /usr/bin/env python3 - -""" -TODO: g2exception.py -""" - -# Metadata - -__all__ = [ - "EXCEPTION_MAP", - "G2BadInputError", - "G2ConfigurationError", - "G2DatabaseConnectionLostError", - "G2DatabaseError", - "G2Exception", - "G2LicenseError", - "G2NotFoundError", - "G2NotInitializedError", - "G2RetryableError", - "G2RetryTimeoutExceededError", - "G2UnhandledError", - "G2UnknownDatasourceError", - "G2UnrecoverableError", -] - -__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ -__date__ = "2023-12-15" -__updated__ = "2023-12-15" - -# ----------------------------------------------------------------------------- -# Base G2Exception -# ----------------------------------------------------------------------------- - - -class G2Exception(Exception): - """Base exception for G2 related python code.""" - - -# ----------------------------------------------------------------------------- -# Category exceptions -# - These exceptions represent categories of actions that can be taken by -# the calling program. -# ----------------------------------------------------------------------------- - - -class G2BadInputError(G2Exception): - """The user-supplied input contained an error.""" - - -class G2ConfigurationError(G2Exception): - """The program can provide a remedy and continue.""" - - -class G2RetryableError(G2Exception): - """The program can provide a remedy and continue.""" - - -class G2UnrecoverableError(G2Exception): - """System failure, can't continue.""" - - -# ----------------------------------------------------------------------------- -# Detail exceptions for G2BadInputException -# - Processing did not complete. -# - These exceptions are "per record" exceptions. -# - The record should be recorded as "bad". (logged, queued as failure) -# - Processing may continue. -# ----------------------------------------------------------------------------- - - -class G2NotFoundError(G2BadInputError): - """Not found""" - - -class G2UnknownDatasourceError(G2BadInputError): - """Unknown Datasource""" - - -# ----------------------------------------------------------------------------- -# Detail exceptions for G2RetryableException -# - Processing did not complete. -# - These exceptions may be remedied programmatically. -# - The call to the Senzing method should be retried. -# - Processing may continue. -# ----------------------------------------------------------------------------- - - -class G2DatabaseConnectionLostError(G2RetryableError): - """Database connection lost""" - - -class G2RetryTimeoutExceededError(G2RetryableError): - """Retry timeout exceeded time limit""" - - -# ----------------------------------------------------------------------------- -# Detail exceptions for G2UnrecoverableException -# - Processing did not complete. -# - These exceptions cannot be remedied programmatically. -# - Processing cannot continue. -# ----------------------------------------------------------------------------- - - -class G2DatabaseError(G2UnrecoverableError): - """Database exception""" - - -class G2LicenseError(G2UnrecoverableError): - """ "Licence exception""" - - -class G2NotInitializedError(G2UnrecoverableError): - """Not initialized""" - - -class G2UnhandledError(G2UnrecoverableError): - """Could not handle exception""" - - -# ----------------------------------------------------------------------------- -# Determine Exception based on Senzing reason code. -# Reference: https://senzing.zendesk.com/hc/en-us/articles/360026678133-Engine-Error-codes -# ----------------------------------------------------------------------------- - -EXCEPTION_MAP = { - 2: G2BadInputError, # EAS_ERR_INVALID_XML "Invalid XML" - 5: G2Exception, # EAS_ERR_EXCEEDED_MAX_RETRIES "Exceeded the Maximum Number of Retries Allowed" - 7: G2BadInputError, # EAS_ERR_EMPTY_XML_MESSAGE "Empty XML Message" - 10: G2RetryTimeoutExceededError, # EAS_ERR_RETRY_TIMEOUT "Retry timeout exceeded" - 14: G2ConfigurationError, # EAS_ERR_INVALID_DATASTORE_CONFIGURATION_TYPE "Invalid Datastore Configuration Type" - 19: G2ConfigurationError, # EAS_ERR_NO_CONFIGURATION_FOUND "Configuration not found" - 20: G2ConfigurationError, # EAS_ERR_CONFIG_CANNOT_BE_NULL_DATABASE "Configuration cannot be loaded from database connection" - 21: G2ConfigurationError, # EAS_ERR_CONFIG_CANNOT_BE_NULL_CONFIG_FILE "Configuration cannot be loaded from config file" - 22: G2BadInputError, # EAS_ERR_INVALID_DOCTYPE "Invalid DocType {0}" - 23: G2BadInputError, # EAS_ERR_CONFLICTING_DATA_SOURCE_VALUES "Conflicting DATA_SOURCE values '{0}' and '{1}'" - 24: G2BadInputError, # EAS_ERR_CONFLICTING_RECORD_ID_VALUES "Conflicting RECORD_ID values '{0}' and '{1}'" - 25: G2BadInputError, # EAS_ERR_CONFLICTING_LOAD_ID_VALUES "Conflicting LOAD_ID values '{0}' and '{1}'" - 26: G2BadInputError, # EAS_ERR_RESERVED_WORD_USED_IN_DOCUMENT "Inbound data contains a reserved keyword '{0}'" - 27: G2UnknownDatasourceError, # EAS_ERR_UNKNOWN_DSRC_CODE_VALUE "Unknown DATA_SOURCE value '{0}'" - 28: G2ConfigurationError, # EAS_ERR_INVALID_JSON_CONFIG_DOCUMENT "Invalid JSON config document" - 29: G2Exception, # EAS_ERR_INVALID_HANDLE "Invalid Handle" - 30: G2ConfigurationError, # EAS_ERR_INVALID_MATCH_LEVEL "Invalid match level '{0}'" - 33: G2NotFoundError, # EAS_ERR_UNKNOWN_DSRC_RECORD_ID "Unknown record: dsrc[{0}], record[{1}]" - 34: G2ConfigurationError, # EAS_ERR_AMBIGUOUS_ENTITY_FTYPE_MISSING "AMBIGUOUS_ENTITY Feature Type is not configured" - 35: G2ConfigurationError, # EAS_ERR_AMBIGUOUS_TIER_FELEM_MISSING "AMBIGUOUS_TIER Feature Element is not configured" - 36: G2ConfigurationError, # EAS_ERR_AMBIGUOUS_FTYPE_ID_FELEM_MISSING "AMBIGUOUS_FTYPE_ID Feature Element is not configured" - 37: G2NotFoundError, # EAS_ERR_UNKNOWN_RESOLVED_ENTITY_VALUE "Unknown resolved entity value '{0}'" - # EAS_ERR_RECORD_HAS_NO_RESOLVED_ENTITY "Data source record has no resolved entity: dsrc[{0}], recordID[{1}]" - 38: G2Exception, - # EAS_ERR_NO_OBSERVED_ENTITY_FOR_DSRC_ENTITY_KEY "No observed entity for entity key: dsrc[{0}], record_id[{1}], key[{2}]" - 39: G2Exception, - # EAS_ERR_CONFIG_COMPATIBILITY_MISMATCH "The engine configuration compatibility version [{0}] does not match the version of the provided config[{1}]." - 40: G2ConfigurationError, - 41: G2Exception, # EAS_ERR_DOCUMENT_PREPROCESSING_FAILED "Document preprocessing failed" - 42: G2Exception, # EAS_ERR_DOCUMENT_LOAD_PROCESSING_FAILED "Document load processing failed" - 43: G2Exception, # EAS_ERR_DOCUMENT_ER_PROCESSING_FAILED "Document ER processing failed" - 44: G2Exception, # EAS_ERR_CHECK_ENTITY_PROCESSING_FAILED "Check entity processing failed" - 45: G2Exception, # EAS_ERR_UMF_PROC_PROCESSING_FAILED "UMF procedure processing failed" - 46: G2Exception, # EAS_ERR_DOCUMENT_HASHING_PROCESSING_FAILED "Document hashing-processing failed" - 47: G2Exception, # EAS_ERR_SESSION_IS_INVALID "Session is invalid" - 48: G2NotInitializedError, # EAS_ERR_G2_NOT_INITIALIZED "G2 is not initialized" - 49: G2NotInitializedError, # EAS_ERR_G2AUDIT_NOT_INITIALIZED "G2Audit is not initialized" - 50: G2NotInitializedError, # EAS_ERR_G2HASHER_NOT_INITIALIZED "G2Hasher is not initialized" - 51: G2BadInputError, # EAS_ERR_BOTH_RECORD_ID_AND_ENT_SRC_KEY_SPECIFIED "Cannot use both Record ID and Entity Source Key in record" - 52: G2Exception, # EAS_ERR_UNKNOWN_RELATIONSHIP_ID_VALUE "Unknown relationship ID value '{0}'" - 53: G2BadInputError, # EAS_ERR_G2DIAGNOSTIC_NOT_INITIALIZED "G2Diagnostic is not initialized" - 54: G2DatabaseError, # EAS_ERR_G2_DATA_REPOSITORY_WAS_PURGED "Data repository was purged" - # EAS_ERR_NO_RESOLVED_ENTITY_FOR_DSRC_ENTITY_KEY "No resolved entity for entity key: dsrc[{0}], record_id[{1}], key[{2}]" - 55: G2Exception, - 56: G2Exception, # EAS_ERR_NO_RECORDS_EXIST_FOR_RESOLVED_ENTITY "No data source records exist for entity ID: entityID[{0}]" - 57: G2Exception, # EAS_ERR_UNKNOWN_FEATURE_ID_VALUE "Unknown feature ID value '{0}'" - 58: G2Exception, # EAS_ERR_G2_INITIALIZATION_FAILURE "G2 initialization process has failed" - # EAS_ERR_CONFIG_DATABASE_MISMATCH "The engine configuration does not match the records loaded into the repository: errors[{0}]." - 60: G2ConfigurationError, - 61: G2ConfigurationError, # EAS_ERR_AMBIGUOUS_SUPPRESSED_LIBFEAT_FELEM_MISSING "AMBIGUOUS_SUPRESSED_LIBFEAT Feature Element is not configured" - 62: G2ConfigurationError, # EAS_ERR_AMBIGUOUS_TYPE_FELEM_MISSING "AMBIGUOUS_TYPE Feature Element is not configured" - 63: G2NotInitializedError, # EAS_ERR_G2CONFIGMGR_NOT_INITIALIZED "G2ConfigMgr is not initialized" - 64: G2ConfigurationError, # EAS_ERR_CONFUSED_ENTITY_FTYPE_MISSING "CONFUSED_ENTITY Feature Type is not configured" - 65: G2BadInputError, # EAS_ERR_UNKNOWN_ENTITY_TYPE_ID "Unknown entity type ID '{0}'" - 66: G2BadInputError, # EAS_ERR_UNKNOWN_GENERIC_PLAN_VALUE "Unknown generic plan value '{0}'" - # EAS_ERR_INVALID_GENERIC_PLAN_VALUE "Invalid Generic Plan ID [{0}] configured for the '{1}' retention level.'" - 67: G2ConfigurationError, - 68: G2Exception, # EAS_ERR_UNKNOWN_ER_RESULT "Unknown ER-result." - 69: G2Exception, # EAS_ERR_NO_CANDIDATES "No candidates." - # EAS_ERR_INBOUND_FEATURE_VERSION_NEWER_THAN_CONFIG "Inbound Feature Version [{0}] is newer than configured version [{1}] for feature type[{2}]." - 76: G2Exception, - 77: G2Exception, # EAS_ERR_ERROR_WHEN_PRIMING_GNR "Error when priming GNR resources '{0}'" - 78: G2Exception, # EAS_ERR_ERROR_WHEN_ENCRYPTING "Error when encrypting '{0}'" - 79: G2Exception, # EAS_ERR_ERROR_WHEN_DECRYPTING "Error when decryting '{0}'" - 80: G2Exception, # EAS_ERR_ERROR_WHEN_VALIDATING_ENCRYPTION_SIGNATURE_COMPATIBILITY "Error when validating encryption signature compatibility '{0}'" - 81: G2Exception, # EAS_ERR_ERROR_WHEN_CHECKING_DISTINCT_FEATURE_GENERALIZATION "Error when checking distinct feature generalization '{0}'" - 82: G2Exception, # EAS_ERR_ERROR_WHEN_RUNNING_DQM "Error when running DQM '{0}'" - 83: G2Exception, # EAS_ERR_ERROR_WHEN_CREATING_EFEATS "Error when creating EFEATS '{0}'" - 84: G2Exception, # EAS_ERR_ERROR_WHEN_SIMPLE_SCORING "Error when simple scoring '{0}'" - 85: G2Exception, # EAS_ERR_ERROR_WHEN_SCORING_PAIR "Error when scoring a pair '{0}'" - 86: G2Exception, # EAS_ERR_ERROR_WHEN_SCORING_SET "Error when scoring a set '{0}'" - 87: G2UnhandledError, # EAS_ERR_SRD_EXCEPTION "SRD Exception '{0}'" - 88: G2BadInputError, # EAS_ERR_UNKNOWN_SEARCH_PROFILE_VALUE "Unknown search profile value '{0}'" - 89: G2ConfigurationError, # EAS_ERR_MISCONFIGURED_SEARCH_PROFILE_VALUE "Misconfigured search profile value '{0}'" - 90: G2ConfigurationError, # EAS_ERR_CANNOT_ADD_LIBRARY_FEATURES_TO_DATASTORE "Cannot add library features to datastore" - 999: G2LicenseError, # EAS_ERR_LICENSE_HAS_EXPIRED "License has expired" - 1000: G2DatabaseError, # EAS_ERR_UNHANDLED_DATABASE_ERROR "Unhandled Database Error '{0}'" - 1001: G2DatabaseError, # EAS_ERR_CRITICAL_DATABASE_ERROR "Critical Database Error '{0}'" - 1002: G2DatabaseError, # EAS_ERR_DATABASE_MEMORY_ERROR "Database Memory Error '{0}'" - 1003: G2DatabaseError, # EAS_ERR_TABLE_SPACE_OR_LOG_VIOLATION "Table Space or Log Violation '{0}'" - 1004: G2DatabaseError, # EAS_ERR_RESOURCE_CONTENTION "Resource Contention '{0}'" - 1005: G2DatabaseError, # EAS_ERR_USER_DEFINED_PROC_ERROR "User Defined Procedure or Function Error '{0}'" - 1006: G2DatabaseConnectionLostError, # EAS_ERR_DATABASE_CONNECTION_FAILURE "Database Connection Failure '{0}'" - 1007: G2DatabaseConnectionLostError, # EAS_ERR_DATABASE_CONNECTION_LOST "Database Connection Lost '{0}'" - 1008: G2DatabaseError, # EAS_ERR_DEADLOCK_ERROR "Deadlock Error '{0}'" - 1009: G2DatabaseError, # EAS_ERR_INSUFFICIENT_PERMISSIONS "Insufficient Permissions '{0}'" - 1010: G2DatabaseError, # EAS_ERR_TRANSACTION_ERROR "Transaction Error '{0}'" - 1011: G2DatabaseError, # EAS_ERR_UNIQUE_CONSTRAINT_VIOLATION "Unique Constraint Violation '{0}'" - 1012: G2DatabaseError, # EAS_ERR_CONSTRAINT_VIOLATION "Constraint Violation '{0}'" - 1013: G2DatabaseError, # EAS_ERR_SYNTAX_ERROR "Syntax Error '{0}'" - 1014: G2DatabaseError, # EAS_ERR_CURSOR_ERROR "Cursor Error '{0}'" - 1015: G2DatabaseError, # EAS_ERR_DATATYPE_ERROR "Data Type Error '{0}'" - 1016: G2DatabaseError, # EAS_ERR_TRANSACTION_ABORTED_ERROR "Transaction Aborted '{0}'" - 1017: G2DatabaseError, # EAS_ERR_DATABASE_OPERATOR_NOT_SET "Database operator not set '{0}'" - 1018: G2DatabaseError, # EAS_ERR_DATABASE_EXCEPTION_GENERATOR_NOT_SET "Database exception generator not set '{0}'" - 1019: G2ConfigurationError, # EAS_ERR_DATABASE_SCHEMA_TABLES_NOT_FOUND "Datastore schema tables not found. [{0}]" - 2001: G2ConfigurationError, # EAS_ERR_FEATURE_HAS_NO_FTYPE_CODE "Cannot process feature with no FTYPE_CODE[{0}]" - 2002: G2Exception, # EAS_ERR_REQUESTED_CONFIG_FOR_INVALID_FTYPE_CODE "Requested config for invalid FTYPE_CODE[{0}]" - 2003: G2Exception, # EAS_ERR_NO_FELEM_CODE "Cannot process OBS_FELEM with no FELEM_CODE[{0}]" - 2005: G2Exception, # EAS_ERR_INVALID_FELEM_CODE "FELEM_CODE[{0}] is not configured for FTYPE_CODE[{1}]" - 2006: G2Exception, # EAS_ERR_MISSING_ENT_SRC_KEY "OBS_ENT is missing ENT_SRC_KEY" - 2007: G2Exception, # EAS_ERR_MISSING_OBS_SRC_KEY "OBS is missing OBS_SRC_KEY" - 2012: G2ConfigurationError, # EAS_ERR_ERRULE_CONFIGURED_FOR_RESOLVE_AND_RELATE "ER Rule [{0}] is configured for both resolve and relate." - 2015: G2ConfigurationError, # EAS_ERR_INVALID_FTYPE_CODE "Invalid FTYPE_CODE[{0}]" - 2027: G2Exception, # EAS_ERR_PLUGIN_INIT "Plugin initialization error {0}" - 2029: G2ConfigurationError, # EAS_ERR_REQUESTED_CONFIG_FOR_INVALID_PLUGIN "Configuration not found for plugin type: {0}" - # EAS_ERR_INVALID_CFRTN_VAL "CFRTN_ID[{0}]/FTYPE[{1}] is expecting CFRTN_VAL[{2}] which is not offered by CFUNC_ID[{3}][{4}]. Available scores are [{5}]" - 2034: G2ConfigurationError, - # EAS_ERR_FTYPE_HAS_NO_BOM "FType configured with no Feature Elements (Bill of Materials) FTYPE_ID[{0}] FTYPE_CODE[{1}]" - 2036: G2ConfigurationError, - # EAS_ERR_FUNC_CALL_HAS_NO_BOM "Function call ({3}) configured with no Bill of Materials {4}[{0}] FTYPE_ID[{1}] FTYPE_CODE[{2}]" - 2037: G2ConfigurationError, - # EAS_ERR_DISTINCT_FEATURE_HAS_NO_BOM "Distinct feature call configured with no Bill of Materials DFCALL_ID[{0}]" - 2038: G2ConfigurationError, - # EAS_ERR_EFCALL_HAS_NO_BOM "EFeature creation call configured with no Bill of Materials EFCALL_ID[{0}]" - 2041: G2ConfigurationError, - 2045: G2ConfigurationError, # EAS_ERR_CFRTN_REFERS_BAD_CFUNC_ID "CFG_CFRTN references CFUNC_ID[{0}] which is not configured" - 2047: G2ConfigurationError, # EAS_ERR_MISSING_DSRC_CODE "OBS_SRC_KEY[{0}] is missing DSRC_CODE tag which is required" - # EAS_ERR_FEAT_FREQ_INVALID "FEATURE CODE[{0}] FEATURE FREQUENCY[{1}] is an invalid frequency" - 2048: G2ConfigurationError, - 2049: G2ConfigurationError, # EAS_ERR_FUNC_INVALID "{2} [{0}] is invalid for {3}[{1}]" - 2050: G2ConfigurationError, # EAS_ERR_QUAL_FRAG_NOT_FOUND "Rule[{0}] Qualifier Fragment[{1}]: Fragment not found" - 2051: G2ConfigurationError, # EAS_ERR_DISQUAL_FRAG_NOT_FOUND "Rule[{0}] Disqualifier Fragment[{1}]: Fragment not found" - # EAS_ERR_BAD_DSRC_ACTION "OBS_SRC_KEY[{0}] has DSRC_ACTION[{1}] which is invalid. Valid values are [A]dd, [C]hange, [D]elete, [P]rune or E[X]tensive Evaluation" - 2057: G2BadInputError, - # EAS_ERR_DUPLICATE_LOOKUP_IDENTIFIER "Duplicate [{0}] with identifier value [{1}]. Only unique values are allowed." - 2061: G2ConfigurationError, - # EAS_ERR_INVALID_LOOKUP_IDENTIFIER "Requested lookup of [{0}] using unknown value [{1}]. Value not found." - 2062: G2ConfigurationError, - # EAS_ERR_FTYPE_HAS_MULTIPLE_DEFINITIONS "FType configured with multiple definitions. FTYPE_CODE[{0}] used in FTYPE_ID[{1}] and FTYPE_ID[{2}]" - 2065: G2ConfigurationError, - # EAS_ERR_FELEM_HAS_MULTIPLE_DEFINITIONS "FElem configured with multiple definitions. FELEM_CODE[{0}] used in FELEM_ID[{1}] and FELEM_ID[{2}]" - 2066: G2ConfigurationError, - # EAS_ERR_ERFRAG_HAS_MULTIPLE_DEFINITIONS "ER Fragment code configured with multiple definitions. ERFRAG_CODE[{0}] used in ERFRAG_ID[{1}] and ERFRAG_ID[{2}]" - 2067: G2ConfigurationError, - # EAS_ERR_BOM_CONFIG_INVALID_FOR_SIMPLE_PLUGIN "Configured plugin for CFCALL_ID[{0}] requires exactly one value in BOM" - 2069: G2ConfigurationError, - # EAS_ERR_EFCALL_HAS_INVALID_FUNCTION "EFeature creation call configured with invalid function ID EFCALL_ID[{0}] EFUNC_ID[{1}]" - 2070: G2ConfigurationError, - 2071: G2ConfigurationError, # EAS_ERR_EFBOM_HAS_INVALID_EFCALL "EFeature BOM configured with invalid EFCALL_ID[{0}]" - 2073: G2Exception, # EAS_ERR_LOADING_LIBRARY "Library loading error {0}" - 2074: G2Exception, # EAS_ERR_SCORING_MANAGER_PLUGIN "Scoring manager: id {0} and {1} do not match" - 2075: G2ConfigurationError, # EAS_ERR_TABLE_CONFIGURED_WITH_INVALID_FTYPE_CODE "Table {0} configured with an invalid type FTYPE_CODE[{1}]" - 2076: G2ConfigurationError, # EAS_ERR_TABLE_CONFIGURED_WITH_INVALID_FELEM_CODE "Table {0} configured with an invalid type FELEM_CODE[{1}]" - 2077: G2ConfigurationError, # EAS_ERR_TABLE_CONFIGURED_WITH_INVALID_ETYPE_ID "Table {0} configured with an invalid type ETYPE_ID[{1}]" - 2079: G2ConfigurationError, # EAS_ERR_EFBOM_CONFIGURED_WITH_INVALID_FTYPE_ID "CFG_EFBOM configured with an invalid type FTYPE_ID[{0}]" - 2080: G2ConfigurationError, # EAS_ERR_EFBOM_CONFIGURED_WITH_INVALID_FELEM_ID "CFG_EFBOM configured with an invalid type FELEM_ID[{0}]" - 2081: G2ConfigurationError, # EAS_ERR_FUNC_CALL_CONFIGURED_WITH_INVALID_FTYPE_ID "{1} configured with an invalid type FTYPE_ID[{0}]" - 2082: G2ConfigurationError, # EAS_ERR_FUNC_CALL_CONFIGURED_WITH_INVALID_FUNC_ID "{1} configured with an invalid type {2}[{0}]" - 2083: G2ConfigurationError, # EAS_ERR_FUNC_BOM_CONFIGURED_WITH_INVALID_FTYPE_ID "{1} configured with an invalid type FTYPE_ID[{0}]" - 2084: G2ConfigurationError, # EAS_ERR_FUNC_BOM_CONFIGURED_WITH_INVALID_FELEM_ID "{1} configured with an invalid type FELEM_ID[{0}]" - # EAS_ERR_TABLE_CONFIGURED_WITH_DUPLICATE_CONFIG_FOR_EFU_TYPE "Table [{0}] configured with duplicate config values for ETYPE_ID[{1}]/FTYPE_ID[{2}]/UTYPE_CODE[{3}]" - 2087: G2ConfigurationError, - 2088: G2ConfigurationError, # EAS_ERR_TABLE_CONFIGURED_WITH_INVALID_RCLASS_ID "Table {0} configured with an invalid RCLASS_ID[{1}]" - 2089: G2ConfigurationError, # EAS_ERR_UNKNOWN_FCLASS_ID "UNKNOWN FCLASS ID[{0}]" - # EAS_ERR_SFCALL_HAS_INVALID_FUNCTION "Feature standardization call configured with invalid function ID SFCALL_ID[{0}] SFUNC_ID[{1}]" - 2090: G2ConfigurationError, - 2091: G2ConfigurationError, # EAS_ERR_TABLE_CONFIGURED_WITH_BOTH_FTYPE_ID_AND_FELEM_ID "{0} configured with both an FTYPE_ID[{1}] and FELEM_ID[{2}]" - 2092: G2ConfigurationError, # EAS_ERR_TABLE_CONFIGURED_WITH_NEITHER_FTYPE_ID_NOR_FELEM_ID "{0} configured with neither an FTYPE_ID nor an FELEM_ID" - # EAS_ERR_TABLE_CONFIGURED_WITH_DUPLICATE_EXEC_ORDER_FOR_IDENTIFIER_LIST "Table [{0}] configured with duplicate execution order value [{3}] for identifiers[{1}] with values [{2}]" - 2093: G2ConfigurationError, - 2094: G2ConfigurationError, # EAS_ERR_DUPLICATE_VALUE_FOR_FIELD_IN_TABLE "Duplicate value [{2}] of field [{1}] in config [{0}]" - # EAS_ERR_TABLE_CONFIGURED_WITH_INVALID_FTYPE_CODE_FELEM_CODE_PAIR "Table {0} configured with an invalid FTYPE_CODE[{1}]/FELEM_CODE[{2}] pair" - 2095: G2ConfigurationError, - # EAS_ERR_COUNTER_CONFIG_INVALID_THRESHOLD "Next Threshold for a counter should be no less than 10, but has NEXT_THRESH{0}" - 2099: G2ConfigurationError, - 2101: G2ConfigurationError, # EAS_ERR_XPATH_OP_UNSUPPORTED "XPath operation unsupported [{0}]" - 2102: G2ConfigurationError, # EAS_ERR_XPATH_AXIS_UNSUPPORTED "XPath axis unsupported [{0}]" - 2103: G2ConfigurationError, # EAS_ERR_XPATH_TEST_UNSUPPORTED "XPath test unsupported [{0}]" - 2104: G2ConfigurationError, # EAS_ERR_XPATH_TYPE_UNSUPPORTED "XPath type unsupported [{0}]" - 2105: G2ConfigurationError, # EAS_ERR_XPATH_NODE_PREFIX_UNSUPPORTED "XPath node prefix unsupported [{0}]" - 2106: G2ConfigurationError, # EAS_ERR_XPATH_NODE_NAME_UNSUPPORTED "XPath node name unsupported position[{0}], name[{1}]" - 2107: G2ConfigurationError, # EAS_ERR_XPATH_BEHAVIOR_TYPE_UNSUPPORTED "XPath behavior type unsupported [{0}]" - 2108: G2ConfigurationError, # EAS_ERR_XPATH_BUCKET_UNSUPPORTED "XPath bucket type unsupported [{0}]" - 2109: G2ConfigurationError, # EAS_ERR_XPATH_VALUE_TYPE_UNSUPPORTED "XPath value type unsupported [{0}]" - 2110: G2ConfigurationError, # EAS_ERR_XPATH_PLUS_TYPE_UNSUPPORTED "XPath plus operand type unsupported [{0}]" - 2111: G2ConfigurationError, # EAS_ERR_XPATH_FRAGMENT_NOT_EVALUATED "XPath fragment not evaluated[{0}]" - 2112: G2ConfigurationError, # EAS_ERR_XPATH_FRAGMENT_NOT_CONFIGURED "XPath fragment not configured[{0}]" - 2113: G2ConfigurationError, # EAS_ERR_XPATH_FUNCTION_UNSUPPORTED "XPath function unsupported [{0}]" - 2114: G2ConfigurationError, # EAS_ERR_INVALID_FTYPE_SCORESET "Cannot set score for invalid FTYPE_ID [{0}]" - 2116: G2Exception, # EAS_ERR_UNITIALIZED_AMBIGUOUS_CACHE "Uninitialized Ambiguous Test Cache" - # EAS_ERR_SCORING_CALL_HAS_NO_BOM "Scoring call configured with no Bill of Materials CFCALL_ID[{0}]." - 2117: G2ConfigurationError, - 2118: G2ConfigurationError, # EAS_ERR_BOM_CONFIG_INVALID_FOR_SCORING_PLUGIN "Configured plugin for CFCALL_ID[{0}] has invalid BOM." - 2120: G2ConfigurationError, # EAS_ERR_TABLE_CONFIGURED_WITH_INVALID_FTYPE_ID "Table {0} configured with an invalid type FTYPE_ID[{1}]" - 2121: G2ConfigurationError, # EAS_ERR_TABLE_CONFIGURED_WITH_INVALID_FELEM_ID "Table {0} configured with an invalid type FELEM_ID[{1}]" - # EAS_ERR_CFUNC_CONFIGURED_WITH_NO_CFRTN "CFG_CFUNC [{0}] feature type [{1}] configured without any corresponding return values in CFG_CFRTN" - 2123: G2ConfigurationError, - # EAS_ERR_OBS_ENT_NOT_FOUND "Requested resolution of OBS_ENT_ID that is not loaded OBS_ENT_ID[{0}]" - 2131: G2ConfigurationError, - 2135: G2ConfigurationError, # EAS_ERR_UMF_MAPPING_CONFIG_ERROR "Error in UMF Mapping Config[{0}]" - 2136: G2ConfigurationError, # EAS_ERR_UMF_MAPPING_MISSING_REQUIRED_FIELD "Error in UMF Mapping, missing required field[{0}]" - 2137: G2ConfigurationError, # EAS_ERR_UMF_MAPPING_MALFORMED_INPUT "Error in UMF Mapping, input message is malformed[{0}]" - 2138: G2ConfigurationError, # EAS_ERR_INVALID_CFRTN_INDEX "CFRTN_ID[{0}] is out of range. Valid range is 0-7" - # EAS_ERR_DSRC_INTEREST_CONFIGURED_WITH_INVALID_DSRCID "Data Source Interest configured with invalid Data Source ID DSRC_ID[{0}]" - 2139: G2ConfigurationError, - 2205: G2ConfigurationError, # EAS_ERR_ENTITY_TYPE_CODE_ALREADY_EXISTS "Entity type code [{0}] already exists." - 2206: G2ConfigurationError, # EAS_ERR_ENTITY_TYPE_ID_ALREADY_EXISTS "Entity type ID [{0}] already exists." - 2207: G2ConfigurationError, # EAS_ERR_DATA_SOURCE_CODE_DOES_NOT_EXIST "Data source code [{0}] does not exist." - 2208: G2ConfigurationError, # EAS_ERR_DATA_SOURCE_CODE_ALREADY_EXISTS "Data source code [{0}] already exists." - 2209: G2ConfigurationError, # EAS_ERR_DATA_SOURCE_ID_ALREADY_EXISTS "Data source ID [{0}] already exists." - 2210: G2ConfigurationError, # EAS_ERR_FELEM_CODE_DOES_NOT_EXIST "Feature element code [{0}] does not exist." - 2211: G2ConfigurationError, # EAS_ERR_FELEM_CODE_ALREADY_EXISTS "Feature element code [{0}] already exists." - 2212: G2ConfigurationError, # EAS_ERR_FELEM_ID_ALREADY_EXISTS "Feature element ID [{0}] already exists." - # EAS_ERR_INVALID_FELEM_DATA_TYPE "Invalid feature element datatype [{0}] found. Datatype must be in [{1}]." - 2213: G2ConfigurationError, - # EAS_ERR_FELEM_IS_CONFIGURED_FOR_USE_IN_FEATURES "Feature element [{0}] is configured for use in feature(s) [{1}]." - 2214: G2ConfigurationError, - 2215: G2ConfigurationError, # EAS_ERR_FTYPE_CODE_DOES_NOT_EXIST "Feature type code [{0}] does not exist." - 2216: G2ConfigurationError, # EAS_ERR_FTYPE_CODE_ALREADY_EXISTS "Feature type code [{0}] already exists." - 2217: G2ConfigurationError, # EAS_ERR_FTYPE_ID_ALREADY_EXISTS "Feature type ID [{0}] already exists." - 2218: G2ConfigurationError, # EAS_ERR_FEATURE_FREQUENCY_IS_INVALID "Feature type frequency [{0}] is invalid." - 2219: G2ConfigurationError, # EAS_ERR_FEATURE_ELEMENT_LIST_IS_EMPTY "Feature element list is empty." - 2220: G2ConfigurationError, # EAS_ERR_STANDARDIZATION_FUNCTION_DOES_NOT_EXIST "Standardization function [{0}] does not exist." - # EAS_ERR_FUNCTION_USES_BOTH_FTYPE_AND_FELEM_TRIGGER "Function call requested uses both triggering feature type [{0}] and triggering feature element code [{1}]. Cannot use both triggering feature type and triggering feature element code." - 2221: G2ConfigurationError, - 2222: G2ConfigurationError, # EAS_ERR_EXPRESSION_FUNCTION_DOES_NOT_EXIST "Expression function [{0}] does not exist." - 2223: G2ConfigurationError, # EAS_ERR_EXPRESSION_FUNCTION_FEATURE_ELEMENT_LIST_IS_EMPTY "Expression function feature element list is empty." - 2224: G2ConfigurationError, # EAS_ERR_COMPARISON_FUNCTION_DOES_NOT_EXIST "Comparison function [{0}] does not exist." - 2225: G2ConfigurationError, # EAS_ERR_COMPARISON_FUNCTION_FEATURE_ELEMENT_LIST_IS_EMPTY "Comparison function feature element list is empty." - 2226: G2ConfigurationError, # EAS_ERR_DISTINCT_FUNCTION_DOES_NOT_EXIST "Distinct feature function [{0}] does not exist." - 2227: G2ConfigurationError, # EAS_ERR_DISTINCT_FUNCTION_FEATURE_ELEMENT_LIST_IS_EMPTY "Distinct feature function feature element list is empty." - 2228: G2ConfigurationError, # EAS_ERR_FELEM_CODE_MUST_BE_UNIQUE_IN_FELEM_LIST "Feature element code [{0}] must be unique in felem list." - # EAS_ERR_FTYPE_CODE_AND_FELEM_CODE_MUST_BE_UNIQUE_IN_EXPRESSED_FUNCTION_CALL "Feature type [{0}] and feature element [{1}] must be unique in expressed feature function call." - 2230: G2ConfigurationError, - # EAS_ERR_FTYPE_CODE_AND_FELEM_CODE_IN_EXPRESSED_FUNCTION_CALL_DO_NOT_EXIST_IN_FEATURE "Feature type [{0}] and feature element [{1}] requested for expressed feature function call, but don't exist in feature [{0}]." - 2231: G2ConfigurationError, - # EAS_ERR_FELEM_CODE_MUST_BE_UNIQUE_IN_COMPARISON_FUNCTION_CALL "Feature element [{0}] must be unique in comparison feature function call." - 2232: G2ConfigurationError, - # EAS_ERR_FELEM_CODE_IN_COMPARISON_FUNCTION_CALL_DOES_NOT_EXIST_IN_FEATURE "Feature element [{0}] requested for comparison feature function call, but doesn't exist in feature [{1}]." - 2233: G2ConfigurationError, - # EAS_ERR_FELEM_CODE_MUST_BE_UNIQUE_IN_DISTINCT_FUNCTION_CALL "Feature element [{0}] must be unique in distinct feature function call." - 2234: G2ConfigurationError, - # EAS_ERR_FELEM_CODE_IN_DISTINCT_FUNCTION_CALL_DOES_NOT_EXIST_IN_FEATURE "Feature element [{0}] requested for distinct feature function call, but doesn't exist in feature [{1}]." - 2235: G2ConfigurationError, - 2236: G2ConfigurationError, # EAS_ERR_EXEC_ORDER_IS_NOT_SPECIFIED_FOR_FUNCTION "Exec order not specified for function." - 2237: G2ConfigurationError, # EAS_ERR_SFCALL_ID_ALREADY_EXISTS "Standardization function call ID [{0}] already exists." - 2238: G2ConfigurationError, # EAS_ERR_EFCALL_ID_ALREADY_EXISTS "Expression function call ID [{0}] already exists." - 2239: G2ConfigurationError, # EAS_ERR_CFCALL_ID_ALREADY_EXISTS "Comparison function call ID [{0}] already exists." - 2240: G2ConfigurationError, # EAS_ERR_DFCALL_ID_ALREADY_EXISTS "Distinct feature function call ID [{0}] already exists." - # EAS_ERR_FTYPE_CODE_REQUIRED_BY_SEPARATE_EXPRESSED_FUNCTION_CALL "Feature type [{0}] required for separate expressed feature function call [{1}]." - 2241: G2ConfigurationError, - 2242: G2ConfigurationError, # EAS_ERR_SFCALL_ID_DOES_NOT_EXIST "Standardization function call ID [{0}] does not exist." - 2243: G2ConfigurationError, # EAS_ERR_EFCALL_ID_DOES_NOT_EXIST "Expression function call ID [{0}] does not exist." - 2244: G2ConfigurationError, # EAS_ERR_CFCALL_ID_DOES_NOT_EXIST "Comparison function call ID [{0}] does not exist." - 2245: G2ConfigurationError, # EAS_ERR_DFCALL_ID_DOES_NOT_EXIST "Distinct feature function call ID [{0}] does not exist." - 2246: G2ConfigurationError, # EAS_ERR_BOM_EXEC_ORDER_ALREADY_EXISTS "BOM exec order value [{0}] already exists." - 2247: G2ConfigurationError, # EAS_ERR_COMPARISON_FUNCTION_CALL_DOES_NOT_EXIST_FOR_FEATURE "Comparison function call does not exist for feature [{0}]." - # EAS_ERR_DISTINCT_FUNCTION_CALL_DOES_NOT_EXIST_FOR_FEATURE "Distinct feature function call does not exist for feature [{0}]." - 2248: G2ConfigurationError, - # EAS_ERR_CONFLICTING_SPECIFIERS_FOR_FUNCTION_CALL "Conflicting specifiers: Function call ID [{0}] does not match function call ID [{1}] from feature type." - 2249: G2ConfigurationError, - 2250: G2ConfigurationError, # EAS_ERR_ATTR_CODE_DOES_NOT_EXIST "Attribute code [{0}] does not exist." - 2251: G2ConfigurationError, # EAS_ERR_ATTR_CODE_ALREADY_EXISTS "Attribute code [{0}] already exists." - 2252: G2ConfigurationError, # EAS_ERR_ATTR_ID_ALREADY_EXISTS "Attribute ID [{0}] already exists." - 2253: G2ConfigurationError, # EAS_ERR_ATTR_CLASS_CODE_DOES_NOT_EXIST "Attribute class code [{0}] does not exist." - # EAS_ERR_FUNCTION_USES_NEITHER_FTYPE_NOR_FELEM_TRIGGER "Function call requested uses neither triggering feature type [{0}] nor triggering feature element code [{1}]. At least one trigger must be specified." - 2254: G2ConfigurationError, - 2255: G2ConfigurationError, # EAS_ERR_FEATURE_CLASS_CODE_DOES_NOT_EXIST "Feature class code [{0}] does not exist." - 2256: G2ConfigurationError, # EAS_ERR_RELATIONSHIP_TYPE_CODE_DOES_NOT_EXIST "Relationship type code [{0}] does not exist." - 2257: G2ConfigurationError, # EAS_ERR_FELEM_CODE_NOT_IN_FEATURE "Feature element code [{0}] not included in feature[{1}]." - 2258: G2ConfigurationError, # EAS_ERR_ER_FRAGMENT_DOES_NOT_EXIST "ER fragment code [{0}] does not exist." - 2259: G2ConfigurationError, # EAS_ERR_ER_RULE_DOES_NOT_EXIST "ER rule code [{0}] does not exist." - 2260: G2ConfigurationError, # EAS_ERR_ERFRAG_ID_ALREADY_EXISTS "ER fragment ID [{0}] already exists." - 2261: G2ConfigurationError, # EAS_ERR_ERRULE_ID_ALREADY_EXISTS "ER rule ID [{0}] already exists." - 2262: G2ConfigurationError, # EAS_ERR_ERFRAG_CODE_ALREADY_EXISTS "ER fragment code [{0}] already exists." - 2263: G2ConfigurationError, # EAS_ERR_ERRULE_CODE_ALREADY_EXISTS "ER rule code [{0}] already exists." - 2264: G2ConfigurationError, # EAS_ERR_ERFRAG_CODE_DOES_NOT_EXIST "ER fragment code [{0}] does not exist." - 2266: G2ConfigurationError, # EAS_ERR_ERFRAG_CODE_MUST_BE_UNIQUE_IN_DEPENDENCY_LIST "ER fragment code [{0}] must be unique in dependency list." - 2267: G2ConfigurationError, # EAS_ERR_SECTION_NAME_ALREADY_EXISTS "Section name [{0}] already exists." - 2268: G2ConfigurationError, # EAS_ERR_SECTION_NAME_DOES_NOT_EXIST "Section name [{0}] does not exist." - 2269: G2ConfigurationError, # EAS_ERR_SECTION_FIELD_NAME_ALREADY_EXISTS "Section field name [{0}] already exists." - 2270: G2ConfigurationError, # EAS_ERR_SFUNC_ID_ALREADY_EXISTS "Feature standardization function ID [{0}] already exists." - 2271: G2ConfigurationError, # EAS_ERR_SFUNC_CODE_ALREADY_EXISTS "Feature standardization function code [{0}] already exists." - 2272: G2ConfigurationError, # EAS_ERR_EFUNC_ID_ALREADY_EXISTS "Feature expression function ID [{0}] already exists." - 2273: G2ConfigurationError, # EAS_ERR_EFUNC_CODE_ALREADY_EXISTS "Feature expression function code [{0}] already exists." - 2274: G2ConfigurationError, # EAS_ERR_CFUNC_ID_ALREADY_EXISTS "Feature comparison function ID [{0}] already exists." - 2275: G2ConfigurationError, # EAS_ERR_CFUNC_CODE_ALREADY_EXISTS "Feature comparison function code [{0}] already exists." - 2276: G2ConfigurationError, # EAS_ERR_DFUNC_ID_ALREADY_EXISTS "Feature distinct function ID [{0}] already exists." - 2277: G2ConfigurationError, # EAS_ERR_DFUNC_CODE_ALREADY_EXISTS "Feature distinct function code [{0}] already exists." - 2278: G2ConfigurationError, # EAS_ERR_COMPATIBILITY_VERSION_NOT_FOUND_IN_CONFIG "Compatibility version not found in document." - 2279: G2ConfigurationError, # EAS_ERR_CFRTN_ID_ALREADY_EXISTS "Feature comparison function return ID [{0}] already exists." - 2280: G2ConfigurationError, # EAS_ERR_CFUNC_CODE_DOES_NOT_EXIST "Feature comparison function code [{0}] does not exist." - # EAS_ERR_CFRTN_VALUE_ALREADY_EXISTS "Feature comparison function return value [{0}] already exists for comparison function [{1}] ftype [{2}]." - 2281: G2ConfigurationError, - # EAS_ERR_CFUNC_EXEC_ORDER_ALREADY_EXISTS "Feature comparison function exec order value [{0}] already exists for comparison function [{1}] ftype [{2}]." - 2282: G2ConfigurationError, - 2283: G2ConfigurationError, # EAS_ERR_EFUNC_CODE_DOES_NOT_EXIST "Feature expression function code [{0}] does not exist." - 2285: G2Exception, # EAS_ERR_INVALID_FORMAT_FOR_ENTITIES "Invalid format for ENTITIES." - 2286: G2Exception, # EAS_ERR_NO_ENTITY_ID_FOUND_FOR_ENTITY "No entity ID found for entity." - 2287: G2Exception, # EAS_ERR_NO_DATA_SOURCE_FOUND "No data source found." - 2288: G2Exception, # EAS_ERR_NO_RECORD_ID_FOUND "No record ID found." - 2289: G2ConfigurationError, # EAS_ERR_INVALID_FEATURE_CLASS_FOR_FEATURE_TYPE "Invalid feature class [{0}] for feature type [{1}]." - 2290: G2ConfigurationError, # EAS_ERR_FRAGMENT_IS_CONFIGURED_FOR_USE_IN_RULES "Rule fragment [{0}] is configured for use in rules(s) [{1}]." - # EAS_ERR_FRAGMENT_IS_CONFIGURED_FOR_USE_IN_FRAGMENT "Rule fragment [{0}] is configured for use in fragments(s) [{1}]." - 2291: G2ConfigurationError, - # EAS_ERR_CANT_RETRIEVE_OBS_FEATURE_DATA_FOR_OBS_ENT "Could not retrieve observed feature data for observed entity [{0}]." - 2292: G2Exception, - 2293: G2Exception, # EAS_ERR_NO_RECORDS_SPECIFIED "No records specified." - 2294: G2Exception, # EAS_ERR_DATA_SOURCE_ID_DOES_NOT_EXIST "Data source ID [{0}] does not exist." - 2295: G2Exception, # EAS_ERR_ETYPE_CODE_DOES_NOT_EXIST "Entity type code [{0}] does not exist." - 7209: G2ConfigurationError, # EAS_ERR_DB_BAD_BACKEND_TYPE "Invalid [SQL] Backend Parameter. Valid values are SQL or HYBRID" - # EAS_ERR_DB_BAD_CLUSTER_SIZE "Cluster [{0}] is configured with an invalid size. Size must be equal to 1." - 7211: G2ConfigurationError, - 7212: G2ConfigurationError, # EAS_ERR_DB_BAD_CLUSTER_NODE "Cluster [{0}] Node [{1}] is not configured." - 7216: G2ConfigurationError, # EAS_ERR_DB_BAD_CLUSTER_DEFINITION "Cluster [{0}] is not properly configured" - 7217: G2ConfigurationError, # EAS_ERR_DB_CONFLICTING_DEFAULT_SHARD_CONFIG "Cannot specify both default backend database and default backend cluster" - 7218: G2ConfigurationError, # EAS_ERR_DB_CLUSTER_DOES_NOT_EXIST "Cluster [{0}] does not exist" - # EAS_ERR_NO_CONFIG_REGISTERED_IN_DATASTORE "No engine configuration registered in datastore (see https:#senzing.zendesk.com/hc/en-us/articles/360036587313)." - 7220: G2ConfigurationError, - 7221: G2ConfigurationError, # EAS_ERR_NO_CONFIG_REGISTERED_FOR_DATA_ID "No engine configuration registered with data ID [{0}]." - # EAS_ERR_FAILED_TO_SET_SYS_VAR_IN_DATASTORE "Could not set system variable value in database for Group[{0}],Code[{1}],Value[{2}]." - 7222: G2Exception, - 7223: G2ConfigurationError, # EAS_ERR_INVALID_SCHEMA_VERSION_IN_DATASTORE "Invalid version number for datastore schema [version '{0}']." - 7224: G2ConfigurationError, # EAS_ERR_INVALID_SCHEMA_VERSION_IN_ENGINE "Invalid version number for engine schema [version '{0}']." - # EAS_ERR_INCOMPATIBLE_DATASTORE_SCHEMA_VERSION "Incompatible datastore schema version: [Engine version '{0}'. Datastore version '{1}' is installed, but must be between '{2}' and '{3}'.]" - 7226: G2ConfigurationError, - 7227: G2ConfigurationError, # EAS_ERR_CONFLICTING_SCHEMA_VERSIONS_IN_DATASTORE "Conflicting version numbers for datastore schema [{0}]." - 7228: G2ConfigurationError, # EAS_ERR_INVALID_SCHEMA_VERSION "Invalid schema version number [version '{0}']." - 7230: G2ConfigurationError, # EAS_ERR_ENGINE_CONFIGURATION_FILE_NOT_FOUND "Engine configuration file not found [{0}]." - 7232: G2ConfigurationError, # EAS_ERR_ENGINE_CONFIGURATION_NOT_FOUND "No engine configuration found." - 7233: G2ConfigurationError, # EAS_ERR_DATASTORE_ENCRYPTION_SIGNATURE_IS_INCOMPATIBLE "Datastore encryption signature is not compatible." - 7234: G2ConfigurationError, # EAS_ERR_FAILED_TO_GET_ENCRYPTION_SIGNATURE "Failed to get encryption signature: '{0}'" - # EAS_ERR_FTYPE_CONFIGURED_AS_REL_BUT_NO_RTYPE "FTYPE_CODE[{0}] IS CONFIGURED AS A RELATIONSHIP FEATURE TYPE BUT RTYPE_ID IS NOT SET." - 7235: G2ConfigurationError, - # EAS_ERR_DUPLICATE_BEHAVIOR_OVERRIDE_KEY_IN_CFG_FBOVR "Duplicate behavior override keys in CFG_FBOVR -- FTYPE_ID[{0}], UTYPE_CODE[{1}] referenced in CFG_FBOVR." - 7236: G2ConfigurationError, - 7237: G2ConfigurationError, # EAS_ERR_UNKNOWN_FTYPE_IN_TABLE "Unknown FTYPE_ID[{0}] referenced in {1}." - # EAS_ERR_INVALID_GENERIC_THRESHOLD_CANDIDATE_CAP "Invalid generic threshold {0} cap [{1}] for [GPLAN_ID[{2}], BEHAVIOR[{3}], FTYPE_ID[{4}]]." - 7239: G2ConfigurationError, - # EAS_ERR_INCORRECT_BEHAVIOR_REFERENCED "Incorrect BEHAVIOR[{0}] referenced in CFG_GENERIC_THRESHOLD for [GPLAN_ID[{1}], FTYPE_ID[{2}]]. FType configured for behavior [{3}]" - 7240: G2ConfigurationError, - 7241: G2ConfigurationError, # EAS_ERR_UNKNOWN_GPLAN_IN_TABLE "Unknown FTYPE_ID[{0}] referenced in {1}." - # EAS_ERR_MULTIPLE_GENERIC_THRESHOLD_DEFINITIONS "Multiple Generic Threshold definitions for [GPLAN_ID[{0}], BEHAVIOR[{1}], FTYPE_ID[{2}]]." - 7242: G2ConfigurationError, - # EAS_ERR_ER_FRAGMENT_HAS_UNDEFINED_DEPENDENT_FRAGMENTS "ER Fragment [{0}] configured with undefined dependent fragments. Fragment [{1}] undefined." - 7243: G2ConfigurationError, - 7244: G2ConfigurationError, # EAS_ERR_ER_RULE_FRAGMENT_LACKS_REQUIRED_FRAGMENT "ER Rule Fragment configuration lacks the required {0} fragment." - # EAS_ERR_CURRENT_CONFIG_REGISTERED_DOES_NOT_MATCH_DATA_ID "Current configuration ID does not match specified data ID [{0}]." - 7245: G2ConfigurationError, - # EAS_ERR_INVALID_MAXIMUM_DATASTORE_SCHEMA_VERSION "Invalid maximum datastore version number for engine schema [version '{0}']." - 7246: G2ConfigurationError, - # EAS_ERR_INVALID_MINIMUM_DATASTORE_SCHEMA_VERSION "Invalid minimum datastore version number for engine schema [version '{0}']." - 7247: G2ConfigurationError, - 7303: G2BadInputError, # EAS_ERR_MANDATORY_SEGMENT_WITH_MISSING_REQUIREMENTS "Mandatory segment with missing requirements:" - 7305: G2BadInputError, # EAS_ERR_MISSING_JSON_ROOT_ELEMENT "No root element name in json TEMPLATE" - 7313: G2BadInputError, # EAS_ERR_REQUIRED_ELEMENT_WITH_EMPTY_FIELD "A non-empty value for [{0}] must be specified." - 7314: G2BadInputError, # EAS_ERR_REQUIRED_ELEMENT_NOT_FOUND "A value for [{0}] must be specified." - 7317: G2ConfigurationError, # EAS_ERR_FAILED_TO_OPEN_FILE "Failed to open file: {0}" - 7344: G2ConfigurationError, # EAS_ERR_UNKNOWN_MAPPING_DIRECTIVE "Invalid mapping directive [{0}] for attribute [{1}]." - 7426: G2BadInputError, # EAS_ERR_XLITERATOR_FAILED "Transliteration failed" - # EAS_ERR_ABORT_ER_AND_RETRY "Detected change in candidate entity[{0}]. Restarting ER evaluation." - 7511: G2Exception, - 8000: G2BadInputError, # EAS_ERR_GNRNP "GNR NameParser Failure" - 8410: G2Exception, # EAS_ERR_UNINITIALIZED_AMBIGUOUS_FEATURE "Cannot use uninitialized ambiguous feature." - 8501: G2ConfigurationError, # EAS_ERR_SALT_DIGEST_ALGORITHM_NOT_AVAILABLE "Failed to get {0} digest algorithm from ICC." - 8502: G2Exception, # EAS_ERR_SALT_DIGEST_CONTEXT_CREATE_FAILED "Failed to create a digest context." - 8503: G2Exception, # EAS_ERR_SALT_DIGEST_CONTEXT_INIT_FAILED "Failed {0} to initialise a digest context." - 8504: G2Exception, # EAS_ERR_SALT_DIGEST_FAILED "Failed {0} to digest block {1}." - 8505: G2Exception, # EAS_ERR_SALT_DIGEST_FINAL_FAILED "Failed {0} to complete digest." - 8508: G2Exception, # EAS_ERR_SALT_DIGEST_UNKNOWN_EXCEPTION "Unrecognized exception thrown generating digest." - 8509: G2Exception, # EAS_ERR_SALT_DIGEST_ALGORITHM_REQUIRED "Cannot generate a digest without a valid algorithm." - 8514: G2Exception, # EAS_ERR_SALT_RANDOM_FAILED "Failed {0} to get random content" - # EAS_ERR_SALT_MUST_BE_SIZE "A salt value must be {0} bytes long but the provided one is {1} bytes." - 8516: G2ConfigurationError, - 8517: G2ConfigurationError, # EAS_ERR_SALT_DOES_NOT_MATCH_CHECKSUM "The salt value does not match the recorded checksum." - 8520: G2Exception, # EAS_ERR_SALT_G2SS_INIT_FAILED "Secure Store initialization failed." - 8521: G2Exception, # EAS_ERR_SALT_G2SS_TOKEN_MUST_BE_INIT "Hashing with a named salt requires the Secure Store to be initialised." - 8522: G2ConfigurationError, # EAS_ERR_SALT_G2SS_SOPIN_NOT_VALID "The Security Officer (SO) PIN is not correct." - 8524: G2Exception, # EAS_ERR_SALT_G2SS_INIT_UNKNOWN_EXCEPTION "Secure Store initialization failed with an unrecognised exception" - 8525: G2ConfigurationError, # EAS_ERR_SALT_G2SS_REQUIRED_FOR_LOAD "Secure Store is required to load salt" - 8526: G2ConfigurationError, # EAS_ERR_SALT_G2SS_REQUIRED_FOR_GENERATE "Secure Store is required to generate salt" - 8527: G2ConfigurationError, # EAS_ERR_SALT_G2SS_REQUIRED_FOR_IMPORT "Secure Store is required to import salt" - 8528: G2ConfigurationError, # EAS_ERR_SALT_G2SS_REQUIRED_FOR_EXPORT "Secure Store is required to export salt" - 8529: G2ConfigurationError, # EAS_ERR_SALT_G2SS_REQUIRED_FOR_DELETE "Secure Store is required to delete salt" - 8530: G2Exception, # EAS_ERR_SALT_CANNOT_OVERWRITE "You cannot overwrite an existing salt called {0}" - 8536: G2ConfigurationError, # EAS_ERR_SALT_G2SS_REQUIRED_FOR_LEGACY "Secure Store is required to add a legacy salt" - 8538: G2ConfigurationError, # EAS_ERR_SALT_G2SS_REQUIRED_FOR_METHOD "Secure Store is required to change hashing method" - 8539: G2Exception, # EAS_ERR_SALT_G2SS_ERROR_CHANGING_METHOD "Secure Store error changing hashing method" - 8540: G2ConfigurationError, # EAS_ERR_SALT_WRONG_SIZE "The object called {0} is not a salt" - 8541: G2Exception, # EAS_ERR_SALT_BASE64_DECODE_ERROR "Base64 decoding error in salt {0} at character {1}" - 8542: G2Exception, # EAS_ERR_SALT_UNINITIALISED "Must load a salt before using it." - 8543: G2ConfigurationError, # EAS_ERR_SALT_NOT_FOUND "There is no salt called {0} in the Secure Store." - 8544: G2ConfigurationError, # EAS_ERR_SALT_PASSWORD_NOT_STRONG_ENOUGH "The password must be stronger: {0}" - 8545: G2ConfigurationError, # EAS_ERR_SALT_ADMIN_NAME_REQUIRED "Specify -name and the name to use for the salt" - 8556: G2ConfigurationError, # EAS_ERR_SALT_ADMIN_METHOD_NOT_RECOGNISED "Hashing method {0} not supported." - # EAS_ERR_SALT_METHOD_DOES_NOT_MATCH "The hashing method in the configuration ({1}) does not match the method ({2}) of the salt {0}" - 8557: G2ConfigurationError, - 8593: G2Exception, # EAS_ERR_SALT_HMAC_CONTEXT_INIT_FAILED "Failed {0} to initialise an HMAC context." - 8594: G2Exception, # EAS_ERR_SALT_HMAC_FAILED "Failed {0} to HMAC block {1}." - 8595: G2Exception, # EAS_ERR_SALT_HMAC_FINAL_FAILED "Failed {0} to complete HMAC." - 8598: G2Exception, # EAS_ERR_SALT_HMAC_UNKNOWN_EXCEPTION "Unrecognized exception thrown generating HMAC." - 8599: G2ConfigurationError, # EAS_ERR_SALT_UNKNOWN_HASHING_METHOD "Unrecognized hashing method ({0}) requested." - 8601: G2ConfigurationError, # EAS_ERR_HASHER_REQUIRES_SECURE_STORE "Using a named salt requires the Secure Store configured and running" - # EAS_ERR_HASHER_CHECKSUM_DOES_NOT_MATCH "The hashing checksum configured ({1}) does not match the checksum ({2}) of the salt named {0}" - 8602: G2ConfigurationError, - 8603: G2Exception, # EAS_ERR_HASHER_UNABLE_TO_RECORD_SALT "Unable to record the configured salt" - 8604: G2ConfigurationError, # EAS_ERR_HASHER_REQUIRES_FUNCTION "Using hashing requires a configured hashing function" - 8605: G2ConfigurationError, # EAS_ERR_HASHER_EPHEMERAL_OR_NAMED_SALT "Specify either a named salt or an ephemeral one. Can not have both" - 8606: G2ConfigurationError, # EAS_ERR_HASHER_SALT_REQUIRED "Hashing requires a salt to be configured." - # EAS_ERR_HASHER_INVALID_ARGS "Invalid arguments to hashing function. Either a parameter wasn't provided or a buffer was too small: location={0}, dataPtr={1}, dataLength={2}, outputPtr={3}, outputLength={4}, output={5}" - 8607: G2ConfigurationError, - 8608: G2ConfigurationError, # EAS_ERR_NO_SALT_VALUE_CONFIGURED "No salt value is configured. A salt value must be configured if you wish to export the token library." - 8701: G2ConfigurationError, # EAS_ERR_PARAMETER_NOT_READABLE "The parameter store does not support a read interface" - 8702: G2ConfigurationError, # EAS_ERR_PARAMETER_NOT_WRITABLE "The parameter store does not support a write interface" - 9000: G2LicenseError, # EAS_LIMIT_MAX_OBS_ENT "LIMIT: Maximum number of records ingested: {0}" - 9107: G2ConfigurationError, # EAS_ERR_CANT_GET_PARAMETER_FROM_THE_STORE "Cannot get parameter [{0}] from parameter store" - 9110: G2ConfigurationError, # EAS_ERR_INSUFFICIENT_CONFIG "Insufficient configuration for the {0} table!" - # EAS_ERR_PARSE_FRAGMENT "ERROR parsing FragmentID[{0}] FragmentName[{1}] : [{2}] is an invalid RuleID dependency" - 9111: G2ConfigurationError, - 9112: G2ConfigurationError, # EAS_ERR_FAILED_TO_OPEN_INI_FILE_FOR_WRITING "Failed to open ini file for writing [{0}]" - 9113: G2ConfigurationError, # EAS_ERR_FAILED_TO_OPEN_INI_FILE_FOR_READING "Failed to open ini file for reading [{0}]" - 9115: G2BadInputError, # EAS_ERR_INPUT_NOT_STANDARDIZED "Cannot process Observation that has not been standardized" - 9116: G2ConfigurationError, # EAS_ERR_CONFIG_TABLE_NOT_FOUND "CONFIG information for {0} not found!" - 9117: G2ConfigurationError, # EAS_ERR_CONFIG_TABLE_COLUMN_NOT_FOUND "CONFIG information for {0} not found in {1}!" - 9118: G2ConfigurationError, # EAS_ERR_CONFIG_TABLE_COLUMN_INDEX_NOT_FOUND "Invalid column index {0} queried from {1} container!" - 9119: G2ConfigurationError, # EAS_ERR_CONFIG_TABLE_COLUMN_NAME_NOT_FOUND "Invalid column name {0} queried from {1} container!" - 9120: G2ConfigurationError, # EAS_ERR_CONFIG_TABLE_MALFORMED "CONFIG information for {0} is malformed!" - 9210: G2ConfigurationError, # EAS_ERR_DIGEST_CONTEXT_INIT_FAILED "Unable to initialize Digest Context." - # EAS_ERR_FTYPE_CANNOT_BE_HASHED "FType configured to be hashed, but cannot be scored. FTYPE_ID[{0}] FTYPE_CODE[{1}]" - 9220: G2ConfigurationError, - # EAS_ERR_FTYPE_CONFIGURED_TO_BE_HASHED_MISSING_SALT "A Feature Type is marked for hashing, but a valid salt value was not found. FTYPE_ID[{0}] FTYPE_CODE[{1}]" - 9222: G2ConfigurationError, - # EAS_ERR_FTYPE_CONFIGURED_TO_BE_HASHED "FType configured to be hashed, but no hashable data found. FTYPE_ID[{0}] FTYPE_CODE[{1}]" - 9224: G2ConfigurationError, - # EAS_ERR_UNEXPECTED_SALT_CHECKUM_LIST "The SALT checksum on the Observation does not match the EXPECTED SALT checksum: EXPECTED=[{0}] Observation=[{1}]" - 9228: G2ConfigurationError, - 9240: G2ConfigurationError, # EAS_ERR_CIPHER_CONTEXT_INIT_FAILED "Unable to initialize an ICC Context." - 9241: G2ConfigurationError, # EAS_ERR_CIPHER_OP_FAILED "Unable to perform a required ICC operation." - 9250: G2ConfigurationError, # EAS_ERR_G2SS_INVALID_LIB "Invalid ({1}) Secure Store plug-in library: {0}" - 9251: G2ConfigurationError, # EAS_ERR_G2SS_INVALID_URL "Invalid Secure Store URL: {0}" - 9252: G2ConfigurationError, # EAS_ERR_G2SS_INVALID_PIN "Invalid Secure Store credential specification: {0}" - 9253: G2ConfigurationError, # EAS_ERR_G2SS_TOKEN_INIT_FAILED "Secure Store token initialization failed: {0}." - 9254: G2ConfigurationError, # EAS_ERR_G2SS_TOKEN_UNINITIALISED "Cannot open a Secure Store session when the token is uninitialized." - 9255: G2ConfigurationError, # EAS_ERR_G2SS_USER_PIN_UNINITIALISED "Secure Store credential is uninitialized." - 9256: G2ConfigurationError, # EAS_ERR_G2SS_SESSION_OPEN "Cannot open a Secure Store session when one is already open." - 9257: G2ConfigurationError, # EAS_ERR_G2SS_NO_SESSION "Cannot use Secure Store without a session." - 9258: G2ConfigurationError, # EAS_ERR_G2SS_SESSION_OPEN_FAILED "Secure Store session could not be opened: {0}." - 9259: G2ConfigurationError, # EAS_ERR_G2SS_ADMIN_LOGIN_FAILED "Secure Store admin login failed: {0}." - 9260: G2ConfigurationError, # EAS_ERR_G2SS_USER_LOGIN_FAILED "Secure Store user login failed: {0}." - 9261: G2ConfigurationError, # EAS_ERR_G2SS_PKCS11_ERROR "Secure Store function failed: {0}" - 9264: G2ConfigurationError, # EAS_ERR_G2SS_LOGOUT_FAILED "Secure Store logout failed: {0}." - 9265: G2ConfigurationError, # EAS_ERR_G2SS_NEED_RW_SESSION "Secure Store session must be read/write." - 9266: G2ConfigurationError, # EAS_ERR_G2SS_UNABLE_TO_VERIFY_KEY "Secure Store key does not meet requirements." - 9267: G2Exception, # EAS_ERR_G2SS_UNABLE_TO_CREATE_KEY "Secure Store key creation failed." - 9268: G2Exception, # EAS_ERR_G2SS_UNABLE_TO_CHANGE_PIN "Secure Store password change failed: {0}." - 9269: G2ConfigurationError, # EAS_ERR_G2SS_INVALID_OLD_CREDENTIAL "Secure Store old credential is invalid." - 9270: G2ConfigurationError, # EAS_ERR_G2SS_INVALID_NEW_CREDENTIAL "Secure Store new credential is invalid." - 9271: G2Exception, # EAS_ERR_G2SS_OUT_OF_MEMORY "Secure Store out of memory." - 9272: G2Exception, # EAS_ERR_G2SS_FIND_INIT_FAILED "Secure Store object locating failed: {0}." - 9273: G2Exception, # EAS_ERR_G2SS_FIND_FAILED "Secure Store object find failed: {0}." - 9274: G2Exception, # EAS_ERR_G2SS_CRYPTO_SETUP_FAILED "Secure Store setup of encryption failed: {0}." - 9275: G2Exception, # EAS_ERR_G2SS_ENCRYPT_START_FAILED "Secure Store unable to start encryption: {0}." - 9276: G2Exception, # EAS_ERR_G2SS_ENCRYPT_SIZE_FAILED "Secure Store unable to get the size of encrypted data: {0}." - 9277: G2Exception, # EAS_ERR_G2SS_ENCRYPT_FAILED "Secure Store encryption failed: {0}." - 9278: G2Exception, # EAS_ERR_G2SS_DECRYPT_START_FAILED "Secure Store unable to start decryption: {0}." - 9279: G2Exception, # EAS_ERR_G2SS_DECRYPT_FAILED "Secure Store decryption failed: {0}." - 9280: G2Exception, # EAS_ERR_G2SS_OBJECT_SAVE_FAILED "Secure Store unable to save object: {0}." - 9281: G2Exception, # EAS_ERR_G2SS_OBJECT_DELETE_FAILED "Secure Store unable to delete object: {0}." - 9282: G2Exception, # EAS_ERR_G2SS_OBJECT_CHANGE_FAILED "Secure Store unable to modify object: {0}." - 9283: G2Exception, # EAS_ERR_G2SS_UNINITIALISED "Secure Store has not been initialized" - # EAS_ERR_G2SS_INVALID_SLOT_ID "Can not obtain info on specified slot. Possibly invalid slot ID specified in Secure Store URL: {0}" - 9284: G2Exception, - # EAS_ERR_G2SS_NO_TOKEN_IN_SLOT "No security token present in slot specified by Secure Store URL: slot ID = {0}" - 9285: G2ConfigurationError, - # EAS_ERR_G2SS_TOKEN_NOT_FOUND "Can not obtain info for security token. Possibly invalid token label and/or slot ID specified in Secure Store URL: {0}" - 9286: G2ConfigurationError, - # EAS_ERR_G2SS_TOKEN_IMPL_ERROR "An internal error occurred in the security token implementation library: Return Code = {0}" - 9287: G2Exception, - 9288: G2Exception, # EAS_ERR_G2SS_USER_PIN_PROMPT_FAILED "Was unable to prompt user for security token authentication." - 9289: G2Exception, # EAS_ERR_G2SS_LABEL_CHANGED_SINCE_CONFIG_INIT "Secure Store has been reconfigured since loading." - 9290: G2Exception, # EAS_ERR_G2SS_OBJECT_NOT_FOUND "Secure Store does not have an object called {0}." - 9292: G2ConfigurationError, # EAS_ERR_G2SS_NO_PASSWORD "No password supplied" - # EAS_ERR_G2SS_NO_SEC_STORE_PREFIX "Secure Store expects a different format (starting with {0}) when a password is supplied" - 9293: G2ConfigurationError, - 9295: G2ConfigurationError, # EAS_ERR_G2SS_NO_DATA_OBJECTS "There are no Secure Store objects stored on the token" - 9296: G2ConfigurationError, # EAS_ERR_G2SS_SEC_STORE_ARCHIVE_BAD "The exported archive appears to be corrupted around object {0}" - 9297: G2ConfigurationError, # EAS_ERR_G2SS_FILE_NOT_FOUND "Secure Store failed to open {0}" - 9298: G2ConfigurationError, # EAS_ERR_G2SS_FILE_CONTENTS_BAD "Secure Store contents of {0} not usable." - 9299: G2Exception, # EAS_ERR_G2SS_CLASS_NOT_INIT "Secure Store internal error." - 9300: G2ConfigurationError, # EAS_ERR_G2SS_PASSWORD_CHECK_ERROR "Secure Store internal error ({0}) checking password." - 9301: G2ConfigurationError, # EAS_ERR_MISSING_SEQUENCE_ENTRY "Missing Sequence Entry[{0}] in the SYS_SEQUENCE table!" - # EAS_ERR_SEQUENCE_RETRIES_FAILED "Retries failed to retrieve Sequence Entry[{0}] in the SYS_SEQUENCE table! This may mean the CACHE_SIZE is too small." - 9305: G2Exception, - 9308: G2ConfigurationError, # EAS_ERR_MISSING_STATUS_ENTRY "Could not retrieve status entry[{0}] in the SYS_STATUS table!" - 9309: G2ConfigurationError, # EAS_ERR_SEQUENCE_HAS_BEEN_RESET "Sequence entry[{0}] has been reset." - 9310: G2ConfigurationError, # EAS_ERR_INVALID_STATUS_ENTRY_VALUE "Invalid value for status entry[{0}] in the SYS_STATUS table!" - 9311: G2Exception, # EAS_ERR_COULD_NOT_RECORD_USAGE_TYPE "Could not record usage type [{0}] in the LIB_UTYPE table!" - 9406: G2Exception, # EAS_ERR_G2SS_SESSION_MUST_NOT_BE_OPEN "Secure Store cannot fetch a value with sync if a session is already open." - 9408: G2ConfigurationError, # EAS_ERR_G2SS_PASSWORD_INADEQUATE "The provided password is not strong enough: {0}" - 9409: G2ConfigurationError, # EAS_ERR_G2SS_FUNCTION_LIST_NOT_SET "The security token interface is not yet set" - 9410: G2Exception, # EAS_ERR_G2SS_PKCS_INIT_FAILED "Initializing token driver failed {0}" - 9411: G2Exception, # EAS_ERR_G2SS_PKCS_FINAL_FAILED "Finalizing token driver failed {0}" - 9413: G2ConfigurationError, # EAS_ERR_G2SS_INCORRECT_PASSWORD "The export file password appears to be incorrect." - 9414: G2BadInputError, # EAS_ERR_STRING_IS_INVALID_UTF8 "Invalid data string. Data must be in UTF-8." - # EAS_ERR_TOKEN_LIBRARY_CHECKSUM_MISMATCH "Cannot load token library. The checksum does not match the configuration of this node. Found: [{0}] Expected: [{1}]" - 9500: G2ConfigurationError, - # EAS_ERR_CANT_RETRIEVE_INDEX_FROM_MEMORY_ROW "Cannot retrieve index[{0}] from memory row of key[{1}], out of range!" - 9701: G2Exception, - 9703: G2Exception, # EAS_ERR_MEMTBL_COL_INDEX_TOO_BIG "Current field in memory row is passed end of row" - # EAS_ERR_INBOUND_OBS_CONFIG_CHECKSUM_MISMATCH "Configuration checksum on inbound observation [{0}] does not match this nodes configuration checksum [{1}]. Cannot process." - 9802: G2ConfigurationError, - # EAS_ERR_CALC_CONFIGCHKSUM_AND_PARAMSTORE_CONFIGCHKSUM_DONT_MATCH "The calculated configuration checksum [{0}] does not match the CONFIGURATION_CHECKSUM value in the parameter store [{1}]." - 9803: G2ConfigurationError, - 9999: Exception, - 30011: G2Exception, # EAS_ERR_DELETE_WITH_RESOLVE_ONLY "Cannot delete an entity with type RESOLVE_ONLY" - 30101: G2Exception, # EAS_ERR_INVALID_SESSION_HANDLE "Invalid Session Handle [{0}]" - 30102: G2Exception, # EAS_ERR_INVALID_REPORT_HANDLE "Invalid Report Handle [{0}]" - 30103: G2Exception, # EAS_ERR_INVALID_EXPORT_HANDLE "Invalid Export Handle [{0}]" - 30110: G2Exception, # EAS_ERR_RESPONSE_MESSAGE_SIZE_LARGER_THAN_BUFFER_SIZE "Response message size [{0}] is larger than buffer size [{1}]" - 30111: G2Exception, # EAS_ERR_RESPONSE_RESIZE_FUNCTION_IS_NOT_PROVIDED "Resize function is not provided" - 30112: G2Exception, # EAS_ERR_RESPONSE_RESIZE_FUNCTION_GAVE_INVALID_RESULT "Resize function returned an invalid result" - 30121: G2BadInputError, # EAS_ERR_JSON_PARSING_FAILURE "JSON Parsing Failure [code={0},offset={1}]" - 30122: G2BadInputError, # EAS_ERR_JSON_PARSING_FAILURE_MUST_BE_OBJECT_OR_ARRAY "JSON Parsing Failure. JSON must be object or array." - 30123: G2BadInputError, # EAS_ERR_JSON_PARSING_FAILURE_OBJECT_HAS_DUPLICATE_KEYS "Json object has duplicate keys." - 30131: G2BadInputError, # EAS_ERR_UNKNOWN_COLUMN_REQUESTED_FOR_CSV_EXPORT "Invalid column [{0}] requested for CSV export." -} diff --git a/src/senzing_abstract/g2helpers.py b/src/senzing_abstract/g2helpers.py deleted file mode 100644 index fff9592..0000000 --- a/src/senzing_abstract/g2helpers.py +++ /dev/null @@ -1,44 +0,0 @@ -""" -TODO: g2helpers.py -""" - -import inspect -from typing import Any - -# ----------------------------------------------------------------------------- -# Help -# ----------------------------------------------------------------------------- - - -def construct_help(self: Any, method_name: str = "") -> str: - """ - Construct help text. - - Args: - method_name (str, optional): The name of the method. Defaults to "". - - Returns: - str: if method_name is empty, a list of methods and their description is returned. If not empty, the description of the method is returned. - """ - result: str = "" - if method_name == "": - class_name = self.__class__.__name__ - methods = inspect.getmembers(self, predicate=inspect.ismethod) - for method in methods: - method_name = method[0] - if not method_name.startswith(("_")): - method_comment = inspect.getdoc(getattr(self, method_name)) - if method_comment is not None: - lines = method_comment.split("\n") - method_overview = lines[0].strip() - result = f"{result}\n{method_name} - {method_overview}" - result = f"{result}\n\nFor method details, use <{class_name}-variable>.help('method_name')" - else: - method_comment = inspect.getdoc(getattr(self, method_name)) - if method_comment is not None: - lines = method_comment.split("\n") - for line in lines: - line_stripped = line.strip() - if not line_stripped.startswith(("..", ":", "**")): - result = f"{result}\n{line}" - return result diff --git a/src/senzing_abstract/g2product_abstract.py b/src/senzing_abstract/g2product_abstract.py deleted file mode 100644 index e6b7771..0000000 --- a/src/senzing_abstract/g2product_abstract.py +++ /dev/null @@ -1,200 +0,0 @@ -#! /usr/bin/env python3 - -""" -g2product_abstract.py is the abstract class for all implementaions of g2product. -""" - -# TODO: Determine specific G2Exceptions, Errors for "Raises:" documentation. - -import json -from abc import ABC, abstractmethod -from typing import Any, Dict, Union, cast - -from .g2helpers import construct_help - -# Metadata - -__all__ = ["G2ProductAbstract"] -__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ -__date__ = "2023-12-14" -__updated__ = "2023-12-14" - -# ----------------------------------------------------------------------------- -# G2ProductAbstract -# ----------------------------------------------------------------------------- - - -class G2ProductAbstract(ABC): - """ - G2ProductAbstract is the definition of the Senzing Python API that is - implemented by packages such as g2product.py. - """ - - # ------------------------------------------------------------------------- - # Messages - # ------------------------------------------------------------------------- - - PREFIX = "g2product." - ID_MESSAGES = { - 4001: PREFIX + "G2Product_destroy() failed. Return code: {0}", - 4002: PREFIX + "G2Product_init({0}, {1}, {2}) failed. Return code: {3}", - 4003: PREFIX - + "G2Product({0}, {1}) failed. module_name and ini_params must both be set or both be empty", - } - - # ------------------------------------------------------------------------- - # Interface definition - # ------------------------------------------------------------------------- - - @abstractmethod - def destroy(self, *args: Any, **kwargs: Any) -> None: - """ - The `destroy` method will destroy and perform cleanup for the Senzing G2Product object. - It should be called after all other calls are complete. - - **Note:** If the `G2Product` constructor was called with parameters, - the destructor will automatically call the destroy() method. - In this case, a separate call to `destroy()` is not needed. - - Example: - - .. code-block:: python - - g2_product = g2product.G2Product(module_name, ini_params) - - Raises: - g2exception.G2Exception: - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2product/g2product_init_and_destroy.py - :linenos: - :language: python - """ - - @abstractmethod - def init( - self, - module_name: str, - ini_params: Union[str, Dict[Any, Any]], - verbose_logging: int = 0, - **kwargs: Any - ) -> None: - """ - The `init` method initializes the Senzing G2Product object. - It must be called prior to any other calls. - - **Note:** If the G2Product constructor is called with parameters, - the constructor will automatically call the `init()` method. - In this case, a separate call to `init()` is not needed. - - Example: - - .. code-block:: python - - g2_product = g2product.G2Product(module_name, ini_params) - - Args: - module_name (str): A short name given to this instance of the G2Product object, to help identify it within system logs. - ini_params (str): A JSON string containing configuration parameters. - verbose_logging (int): `Optional:` A flag to enable deeper logging of the G2 processing. 0 for no Senzing logging; 1 for logging. Default: 0 - - Raises: - TypeError: Incorrect datatype of input parameter. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2product/g2product_init_and_destroy.py - :linenos: - :language: python - """ - - @abstractmethod - def license(self, *args: Any, **kwargs: Any) -> str: - """ - .. _license: - - The `license` method retrieves information about the currently used license by the Senzing API. - - Returns: - str: A JSON document containing Senzing license metadata. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2product/license.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2product/license.txt - :linenos: - :language: json - """ - - @abstractmethod - def version(self, *args: Any, **kwargs: Any) -> str: - """ - .. _version: - - The `version` method returns the version of the Senzing API. - - Returns: - str: A JSON document containing metadata about the Senzing Engine version being used. - - .. collapse:: Example: - - .. literalinclude:: ../../examples/g2product/version.py - :linenos: - :language: python - - **Output:** - - .. literalinclude:: ../../examples/g2product/version.txt - :linenos: - :language: json - """ - - # ------------------------------------------------------------------------- - # Convenience methods - # ------------------------------------------------------------------------- - - def help(self, method_name: str = "") -> str: - """ - Return the help for a particular message. - - Args: - method_name (str): The name of the method. (e.g. "init"). If empty, a list of methods and descriptions is returned. - - Returns: - str: The Help information about the requested method - """ - return construct_help(self, method_name=method_name) - - def license_as_dict(self, *args: Any, **kwargs: Any) -> Dict[str, Any]: - """ - A convenience method for - :ref:`license`. - - Returns: - Dict[str, Any]: A dictionary containing Senzing license metadata. - - """ - return cast( - Dict[str, Any], - json.loads(self.license(args, kwargs)), - ) - - def version_as_dict(self, *args: Any, **kwargs: Any) -> Dict[str, Any]: - """ - A convenience method for - :ref:`version`. - - Returns: - Dict[str, Any]: A dictionary containing metadata about the Senzing Engine version being used. - - """ - return cast( - Dict[str, Any], - json.loads(self.version(args, kwargs)), - ) diff --git a/src/senzing_abstract/observer_abstract.py b/src/senzing_abstract/observer_abstract.py new file mode 100644 index 0000000..e8c4a6f --- /dev/null +++ b/src/senzing_abstract/observer_abstract.py @@ -0,0 +1,39 @@ +#! /usr/bin/env python3 + +""" +observer_abstract.py is the abstract class for implementations of a Senzing Observer. +in the Observer pattern. + +Reference: + https://en.wikipedia.org/wiki/Observer_pattern +""" + +# pylint: disable=R0903 + +from abc import ABC, abstractmethod + +__all__ = ["ObserverAbstract"] + +# ----------------------------------------------------------------------------- +# ObserverAbstract +# ----------------------------------------------------------------------------- + + +class ObserverAbstract(ABC): + """ + ObserverAbstract is the abstract class used as a type for returning + in process information. + """ + + # ------------------------------------------------------------------------- + # Interface definition + # ------------------------------------------------------------------------- + + @abstractmethod + def update(self, message: str) -> None: + """ + The `update` method of the Observer pattern. + + Args: + message (str): A observed message. + """ diff --git a/src/senzing_abstract/szconfig_abstract.py b/src/senzing_abstract/szconfig_abstract.py new file mode 100644 index 0000000..af0e20a --- /dev/null +++ b/src/senzing_abstract/szconfig_abstract.py @@ -0,0 +1,297 @@ +#! /usr/bin/env python3 + +""" +szconfig_abstract.py is the abstract class for all implementations of szconfig. +""" + +# TODO: Determine specific SzErrors, Errors for "Raises:" documentation. + +from abc import ABC, abstractmethod +from typing import Any, Dict, Optional, Union + +# Metadata + +__all__ = ["SzConfigAbstract"] +__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ +__date__ = "2023-10-30" +__updated__ = "2023-11-08" + +# ----------------------------------------------------------------------------- +# SzConfigAbstract +# ----------------------------------------------------------------------------- + + +class SzConfigAbstract(ABC): + """ + SzConfigAbstract is the definition of the Senzing Python API that is + implemented by packages such as szconfig.py. + """ + + # ------------------------------------------------------------------------- + # Messages + # ------------------------------------------------------------------------- + + PREFIX = "szconfig." + ID_MESSAGES = { + 4001: PREFIX + "add_data_source({0}) failed. Return code: {1}", + 4002: PREFIX + "close_config() failed. Return code: {0}", + 4003: PREFIX + "create_config() failed. Return code: {0}", + 4004: PREFIX + "delete_data_source({0}) failed. Return code: {1}", + 4005: PREFIX + "destroy() failed. Return code: {0}", + 4006: PREFIX + "export_config() failed. Return code: {0}", + 4007: PREFIX + "get_data_sources() failed. Return code: {0}", + 4008: PREFIX + "initialize({0}, {1}, {2}) failed. Return code: {3}", + 4009: PREFIX + "import_config({0}) failed. Return code: {1}", + 4010: PREFIX + + "SzConfig({0}, {1}) failed. instance_name and settings must both be set or both be empty", + } + + # ------------------------------------------------------------------------- + # Interface definition + # ------------------------------------------------------------------------- + + @abstractmethod + def add_data_source( + self, + config_handle: int, + # data_source_code: Union[str, Dict[Any, Any]], + data_source_code: str, + **kwargs: Any + ) -> str: + """ + The `add_data_source` method adds a data source to an existing in-memory configuration. + + Args: + config_handle (int): An identifier of an in-memory configuration. Usually created by the `create` or `load` methods. + data_source_code (str): Name of data source code to add. + + Returns: + str: A string containing a JSON document listing the newly created data source. + + Raises: + TypeError: Incorrect datatype of input parameter. + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szconfig/add_data_source.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szconfig/add_data_source.txt + :linenos: + :language: json + """ + + @abstractmethod + def close_config(self, config_handle: int, **kwargs: Any) -> None: + """ + The `close_config` method cleans up the Senzing SzConfig object pointed to by the `config_handle`. + + Args: + config_handle (int): An identifier of an in-memory configuration. Usually created by the `create_config` or `import_config` methods. + + Raises: + TypeError: Incorrect datatype of input parameter. + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szconfig/create_and_close.py + :linenos: + :language: python + """ + + @abstractmethod + def create_config(self, **kwargs: Any) -> int: + """ + The `create_config` method creates an in-memory Senzing configuration + from the `g2config.json` template configuration file located + in the PIPELINE.RESOURCEPATH path. + A handle is returned to identify the in-memory configuration. + The handle is used by the `add_data_source`, `list_data_sources`, + `delete_data_source`, and `export_config` methods. + The handle is terminated by the `close_config` method. + + Returns: + int: A pointer to an in-memory Senzing configuration. + + Raises: + TypeError: Incorrect datatype of input parameter. + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szconfig/create_and_close.py + :linenos: + :language: python + """ + + @abstractmethod + def delete_data_source( + self, config_handle: int, data_source_code: str, **kwargs: Any + ) -> None: + """ + The `delete_data_source` method removes a data source from an existing in-memory configuration. + + Args: + config_handle (int): An identifier of an in-memory configuration. Usually created by the `create` or `load` methods + data_source_code (str): Name of data source code to delete. + + Raises: + TypeError: Incorrect datatype of input parameter. + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szconfig/delete_data_source.py + :linenos: + :language: python + """ + + @abstractmethod + def destroy(self, **kwargs: Any) -> None: + """ + The `destroy` method will destroy and perform cleanup for the Senzing SzConfig object. + It should be called after all other calls are complete. + + **Note:** If the `SzConfig` constructor was called with parameters, + the destructor will automatically call the destroy() method. + In this case, a separate call to `destroy()` is not needed. + + Raises: + szerror.SzError: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szconfig/szconfig_initialize_and_destroy.py + :linenos: + :language: python + """ + + @abstractmethod + def export_config(self, config_handle: int, **kwargs: Any) -> str: + """ + The `export_config` method creates a JSON string representation of the Senzing SzConfig object. + + Args: + config_handle (int): An identifier of an in-memory configuration. Usually created by the `create` or `load` methods + + Returns: + str: A string containing a JSON Document representation of the Senzing SzConfig object. + + Raises: + TypeError: Incorrect datatype of input parameter. + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szconfig/export_config.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szconfig/export_config.txt + :linenos: + :language: json + + **Create, export, import, and close example** + + .. literalinclude:: ../../examples/szconfig/create_export_import_close.py + :linenos: + :language: python + """ + + @abstractmethod + def get_data_sources(self, config_handle: int, **kwargs: Any) -> str: + """ + The `get_data_sources` method returns a JSON document of data sources + contained in an in-memory configuration. + + Args: + config_handle (int): An identifier of an in-memory configuration. Usually created by the `create` or `load` methods + + Returns: + str: A string containing a JSON document listing all of the data sources. + + Raises: + TypeError: Incorrect datatype of input parameter. + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szconfig/get_data_sources.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szconfig/get_data_sources.txt + :linenos: + :language: json + """ + + @abstractmethod + def initialize( + self, + instance_name: str, + settings: Union[str, Dict[Any, Any]], + verbose_logging: Optional[int] = 0, + **kwargs: Any + ) -> None: + """ + The `initialize` method initializes the Senzing SzConfig object. + It must be called prior to any other calls. + + **Note:** If the SzConfig constructor is called with parameters, + the constructor will automatically call the `initialize()` method. + In this case, a separate call to `initialize()` is not needed. + + Args: + instance_name (str): A short name given to this instance of the SzConfig object, to help identify it within system logs. + settings (Union[str, Dict[Any, Any]]): A JSON string containing configuration parameters. + verbose_logging (int): `Optional:` A flag to enable deeper logging of the Senzing processing. 0 for no Senzing logging; 1 for logging. Default: 0 + + Raises: + TypeError: Incorrect datatype of input parameter. + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szconfig/szconfig_initialize_and_destroy.py + :linenos: + :language: python + """ + + @abstractmethod + def import_config( + self, config_definition: Union[str, Dict[Any, Any]], **kwargs: Any + ) -> int: + """ + The `import_config` method initializes an in-memory Senzing SzConfig object from a JSON string. + A handle is returned to identify the in-memory configuration. + The handle is used by the `add_data_source`, `get_data_sources`, + `delete_data_source`, and `save` methods. + The handle is terminated by the `close` method. + + Args: + config_definition (Union[str, Dict[Any, Any]]): A JSON document containing the Senzing configuration. + + Returns: + int: An identifier (config_handle) of an in-memory configuration. + + Raises: + TypeError: Incorrect datatype of input parameter. + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szconfig/import_config.py + :linenos: + :language: python + + **Create, save, load, and close** + + .. literalinclude:: ../../examples/szconfig/create_export_import_close.py + :linenos: + :language: python + """ + + # ------------------------------------------------------------------------- + # Convenience methods + # ------------------------------------------------------------------------- diff --git a/src/senzing_abstract/g2configmgr_abstract.py b/src/senzing_abstract/szconfigmanager_abstract.py similarity index 51% rename from src/senzing_abstract/g2configmgr_abstract.py rename to src/senzing_abstract/szconfigmanager_abstract.py index b9210a5..4c374c3 100644 --- a/src/senzing_abstract/g2configmgr_abstract.py +++ b/src/senzing_abstract/szconfigmanager_abstract.py @@ -1,53 +1,48 @@ #! /usr/bin/env python3 """ -g2configmgr_abstract.py is the abstract class for all implementaions of g2configmgr. +szconfigmanager_abstract.py is the abstract class for all implementations of szconfigmanager. """ -# TODO: Determine specific G2Exceptions, Errors for "Raises:" documentation. +# TODO: Determine specific SzErrors, Errors for "Raises:" documentation. from abc import ABC, abstractmethod -from typing import Any, Dict, Union - -from .g2helpers import construct_help +from typing import Any, Dict, Optional, Union # Metadata -__all__ = ["G2ConfigMgrAbstract"] +__all__ = ["SzConfigManagerAbstract"] __version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ -__date__ = "2023-12-14" -__updated__ = "2023-12-14" +__date__ = "2023-10-30" +__updated__ = "2023-11-08" # ----------------------------------------------------------------------------- -# G2ConfigMgrAbstract +# SzConfigManagerAbstract # ----------------------------------------------------------------------------- -class G2ConfigMgrAbstract(ABC): +class SzConfigManagerAbstract(ABC): """ - G2ConfigMgrAbstract is the definition of the Senzing Python API that is - implemented by packages such as g2configmgr.py. + SzConfigManagerAbstract is the definition of the Senzing Python API that is + implemented by packages such as szconfigmanager.py. """ # ------------------------------------------------------------------------- # Messages # ------------------------------------------------------------------------- - PREFIX = "g2configmgr." - # TODO: remove + concats for f-strings + PREFIX = "szconfigmanager." ID_MESSAGES = { - 4001: PREFIX + "G2ConfigMgr_addConfig({0}, {1}) failed. Return code: {2}", - 4002: PREFIX + "G2ConfigMgr_destroy() failed. Return code: {0}", - 4003: PREFIX + "G2ConfigMgr_getConfig({0}) failed. Return code: {1}", - 4004: PREFIX + "G2ConfigMgr_getConfigList() failed. Return code: {0}", - 4005: PREFIX + "G2ConfigMgr_getDefaultConfigID() failed. Return code: {0}", - 4006: PREFIX + "G2ConfigMgr_getLastException() failed. Return code: {0}", - 4007: PREFIX + "G2ConfigMgr_init({0}, {1}, {2}) failed. Return code: {3}", - 4008: PREFIX - + "G2ConfigMgr_replaceDefaultConfigID({0}, {1}) failed. Return code: {2}", - 4009: PREFIX + "G2ConfigMgr_setDefaultConfigID({0}) failed. Return code: {1}", - 4020: PREFIX - + "G2ConfigMgr({0}, {1}) must have both module_name and ini_params nor neither.", + 4001: PREFIX + "add_config({0}, {1}) failed. Return code: {2}", + 4002: PREFIX + "destroy() failed. Return code: {0}", + 4003: PREFIX + "get_config({0}) failed. Return code: {1}", + 4004: PREFIX + "get_config_list() failed. Return code: {0}", + 4005: PREFIX + "get_default_config_id() failed. Return code: {0}", + 4006: PREFIX + "initialize({0}, {1}, {2}) failed. Return code: {3}", + 4007: PREFIX + "replace_default_config_id({0}, {1}) failed. Return code: {2}", + 4008: PREFIX + "set_default_config_id({0}) failed. Return code: {1}", + 4009: PREFIX + + "SzConfigManager({0}, {1}) failed. instance_name and settings must both be set or both be empty", } # ------------------------------------------------------------------------- @@ -57,17 +52,16 @@ class G2ConfigMgrAbstract(ABC): @abstractmethod def add_config( self, - config_str: Union[str, Dict[Any, Any]], - config_comments: str, - *args: Any, + config_definition: Union[str, Dict[Any, Any]], + config_comment: str, **kwargs: Any ) -> int: """ The `add_config` method adds a Senzing configuration JSON document to the Senzing database. Args: - config_str (Union[str, Dict[Any, Any]]): The Senzing configuration JSON document. - config_comments (str): free-form string of comments describing the configuration document. + config_definition (Union[str, Dict[Any, Any]]): The Senzing configuration JSON document. + config_comment (str): free-form string of comments describing the configuration document. Returns: int: A configuration identifier. @@ -77,39 +71,33 @@ def add_config( .. collapse:: Example: - .. literalinclude:: ../../examples/g2configmgr/add_config.py + .. literalinclude:: ../../examples/szconfigmanager/add_config.py :linenos: :language: python """ @abstractmethod - def destroy(self, *args: Any, **kwargs: Any) -> None: + def destroy(self, **kwargs: Any) -> None: """ - The `destroy` method will destroy and perform cleanup for the Senzing G2ConfigMgr object. + The `destroy` method will destroy and perform cleanup for the Senzing SzConfigManager object. It should be called after all other calls are complete. - **Note:** If the `G2ConfigMgr` constructor was called with parameters, + **Note:** If the `SzConfigManager` constructor was called with parameters, the destructor will automatically call the destroy() method. In this case, a separate call to `destroy()` is not needed. - Example: - - .. code-block:: python - - g2_configmgr = g2configmgr.G2ConfigMgr(module_name, ini_params) - Raises: TypeError: Incorrect datatype of input parameter. .. collapse:: Example: - .. literalinclude:: ../../examples/g2configmgr/g2configmgr_init_and_destroy.py + .. literalinclude:: ../../examples/szconfigmanager/szconfigmanager_initialize_and_destroy.py :linenos: :language: python """ @abstractmethod - def get_config(self, config_id: int, *args: Any, **kwargs: Any) -> str: + def get_config(self, config_id: int, **kwargs: Any) -> str: """ The `get_config` method retrieves a specific Senzing configuration JSON document from the Senzing database. @@ -124,19 +112,19 @@ def get_config(self, config_id: int, *args: Any, **kwargs: Any) -> str: .. collapse:: Example: - .. literalinclude:: ../../examples/g2configmgr/get_config.py + .. literalinclude:: ../../examples/szconfigmanager/get_config.py :linenos: :language: python **Output:** - .. literalinclude:: ../../examples/g2configmgr/get_config.txt + .. literalinclude:: ../../examples/szconfigmanager/get_config.txt :linenos: :language: json """ @abstractmethod - def get_config_list(self, *args: Any, **kwargs: Any) -> str: + def get_config_list(self, **kwargs: Any) -> str: """ The `get_config_list` method retrieves a list of Senzing configurations from the Senzing database. @@ -148,19 +136,19 @@ def get_config_list(self, *args: Any, **kwargs: Any) -> str: .. collapse:: Example: - .. literalinclude:: ../../examples/g2configmgr/get_config_list.py + .. literalinclude:: ../../examples/szconfigmanager/get_config_list.py :linenos: :language: python **Output:** - .. literalinclude:: ../../examples/g2configmgr/get_config_list.txt + .. literalinclude:: ../../examples/szconfigmanager/get_config_list.txt :linenos: :language: json """ @abstractmethod - def get_default_config_id(self, *args: Any, **kwargs: Any) -> int: + def get_default_config_id(self, **kwargs: Any) -> int: """ The `get_default_config_id` method retrieves from the Senzing database the configuration identifier of the default Senzing configuration. @@ -172,74 +160,68 @@ def get_default_config_id(self, *args: Any, **kwargs: Any) -> int: .. collapse:: Example: - .. literalinclude:: ../../examples/g2configmgr/get_default_config_id.py + .. literalinclude:: ../../examples/szconfigmanager/get_default_config_id.py :linenos: :language: python """ @abstractmethod - def init( + def initialize( self, - module_name: str, - ini_params: Union[str, Dict[Any, Any]], - verbose_logging: int = 0, + instance_name: str, + settings: Union[str, Dict[Any, Any]], + verbose_logging: Optional[int] = 0, **kwargs: Any ) -> None: """ - The `init` method initializes the Senzing G2ConfigMgr object. + The `initialize` method initializes the Senzing SzConfigManager object. It must be called prior to any other calls. - **Note:** If the G2ConfigMgr constructor is called with parameters, - the constructor will automatically call the `init()` method. - In this case, a separate call to `init()` is not needed. - - Example: - - .. code-block:: python - - g2_configmgr = g2configmgr.G2ConfigMgr(module_name, ini_params) + **Note:** If the SzConfigManager constructor is called with parameters, + the constructor will automatically call the `initialize()` method. + In this case, a separate call to `initialize()` is not needed. Args: - module_name (str): A short name given to this instance of the G2Product object, to help identify it within system logs. - ini_params (Union[str, Dict[Any, Any]]): A JSON string containing configuration parameters. - verbose_logging (int): `Optional:` A flag to enable deeper logging of the G2 processing. 0 for no Senzing logging; 1 for logging. Default: 0 + instance_name (str): A short name given to this instance of the SzProduct object, to help identify it within system logs. + settings (Union[str, Dict[Any, Any]]): A JSON string containing configuration parameters. + verbose_logging (int): `Optional:` A flag to enable deeper logging of the Senzing processing. 0 for no Senzing logging; 1 for logging. Default: 0 Raises: TypeError: Incorrect datatype of input parameter. .. collapse:: Example: - .. literalinclude:: ../../examples/g2configmgr/g2configmgr_init_and_destroy.py + .. literalinclude:: ../../examples/szconfigmanager/szconfigmanager_initialize_and_destroy.py :linenos: :language: python """ @abstractmethod def replace_default_config_id( - self, old_config_id: int, new_config_id: int, *args: Any, **kwargs: Any + self, current_default_config_id: int, new_default_config_id: int, **kwargs: Any ) -> None: """ 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 `old_config_id` is no longer the "old configuration identifier", the operation will fail. + 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`. Args: - old_config_id (int): The configuration identifier to replace. - new_config_id (int): The configuration identifier to use as the default. + 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. .. collapse:: Example: - .. literalinclude:: ../../examples/g2configmgr/replace_default_config_id.py + .. literalinclude:: ../../examples/szconfigmanager/replace_default_config_id.py :linenos: :language: python """ @abstractmethod - def set_default_config_id(self, config_id: int, *args: Any, **kwargs: Any) -> None: + def set_default_config_id(self, config_id: int, **kwargs: Any) -> None: """ The `set_default_config_id` method replaces the sets a new configuration identifier in the Senzing database. To serialize modifying of the configuration identifier, see `replace_default_config_id`. @@ -252,7 +234,7 @@ def set_default_config_id(self, config_id: int, *args: Any, **kwargs: Any) -> No .. collapse:: Example: - .. literalinclude:: ../../examples/g2configmgr/set_default_config_id.py + .. literalinclude:: ../../examples/szconfigmanager/set_default_config_id.py :linenos: :language: python """ @@ -260,15 +242,3 @@ def set_default_config_id(self, config_id: int, *args: Any, **kwargs: Any) -> No # ------------------------------------------------------------------------- # Convenience methods # ------------------------------------------------------------------------- - - def help(self, method_name: str = "") -> str: - """ - Return the help for a particular message. - - Args: - method_name (str): The name of the method. (e.g. "init"). If empty, a list of methods and descriptions is returned. - - Returns: - str: The Help information about the requested method - """ - return construct_help(self, method_name=method_name) diff --git a/src/senzing_abstract/szdiagnostic_abstract.py b/src/senzing_abstract/szdiagnostic_abstract.py new file mode 100644 index 0000000..b03f061 --- /dev/null +++ b/src/senzing_abstract/szdiagnostic_abstract.py @@ -0,0 +1,192 @@ +#! /usr/bin/env python3 + +""" +TODO: szdiagnostic_abstract.py +""" + +from abc import ABC, abstractmethod +from typing import Any, Dict, Optional, Union + +# Metadata + +__all__ = ["SzDiagnosticAbstract"] +__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ +__date__ = "2023-10-30" +__updated__ = "2023-10-30" + +# ----------------------------------------------------------------------------- +# SzDiagnosticAbstract +# ----------------------------------------------------------------------------- + + +class SzDiagnosticAbstract(ABC): + """ + Senzing diagnostic module access library + """ + + # ------------------------------------------------------------------------- + # Messages + # ------------------------------------------------------------------------- + + PREFIX = "szdiagnostic." + ID_MESSAGES = { + 4001: PREFIX + "check_datastore_performance({0}) failed. Return code: {1}", + 4002: PREFIX + "destroy() failed. Return code: {0}", + 4003: PREFIX + "get_datastore_info() failed. Return code: {0}", + 4004: PREFIX + "get_feature({0}) failed. Return code: {1}", + 4005: PREFIX + "initialize({0}, {1}, {2}, {3}) failed. Return code: {4}", + 4006: PREFIX + "purge_repository() failed. Return code: {0}", + 4007: PREFIX + "reinitialize({0}) failed. Return Code: {1}", + 4008: PREFIX + + "SzDiagnostic({0}, {1}) failed. instance_name and settings must both be set or both be empty", + } + + # ------------------------------------------------------------------------- + # Interface definition + # ------------------------------------------------------------------------- + + @abstractmethod + def check_datastore_performance(self, seconds_to_run: int, **kwargs: Any) -> str: + """ + The `check_datastore_performance` method performs inserts to determine rate of insertion. + + Args: + seconds_to_run (int): Duration of the test in seconds. + + Returns: + str: A string containing a JSON document. + + Raises: + TypeError: Incorrect datatype of input parameter. + szexception.SzError: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szdiagnostic/check_datastore_performance.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szdiagnostic/check_datastore_performance.txt + :linenos: + :language: json + """ + + @abstractmethod + def destroy(self, **kwargs: Any) -> None: + """ + The `destroy` method will destroy and perform cleanup for the Senzing SzDiagnostic object. + It should be called after all other calls are complete. + + **Note:** If the `SzDiagnostic` constructor was called with parameters, + the destructor will automatically call the destroy() method. + In this case, a separate call to `destroy()` is not needed. + + Raises: + szexception.SzError: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szdiagnostic/szdiagnostic_initialize_and_destroy.py + :linenos: + :language: python + """ + + @abstractmethod + def get_datastore_info(self, **kwargs: Any) -> str: + """ + TODO: Document get_datastore_info() + The `get_datastore_info` method will... + + Raises: + szexception.SzError: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szdiagnostic/get_datastore_info.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szdiagnostic/get_datastore_info.txt + :linenos: + :language: json + """ + + # NOTE This is included but not to be documented + @abstractmethod + def get_feature(self, feature_id: int, **kwargs: Any) -> str: + """TODO: Document get_feature()""" + + @abstractmethod + def initialize( + self, + instance_name: str, + settings: Union[str, Dict[Any, Any]], + config_id: Optional[int] = 0, + verbose_logging: Optional[int] = 0, + **kwargs: Any + ) -> None: + """ + The `initialize` method initializes the Senzing SzDiagnosis object. + It must be called prior to any other calls. + + **Note:** If the Sz Diagnosis constructor is called with parameters, + the constructor will automatically call the `initialize()` method. + In this case, a separate call to `initialize()` is not needed. + + Args: + instance_name (str): A name for the auditing node, to help identify it within system logs. + settings (Union[str, Dict[Any, Any]]): A JSON string containing configuration parameters. + config_id (int): `Optional:` Initialize with a specific configuration ID and not the current default. + verbose_logging (int): `Optional:` A flag to enable deeper logging of the Senzing processing. 0 for no Senzing logging; 1 for logging. Default: 0 + + Raises: + TypeError: Incorrect datatype of input parameter. + szexception.SzError: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szdiagnostic/szdiagnostic_initialize_and_destroy.py + :linenos: + :language: python + """ + + @abstractmethod + def purge_repository(self, **kwargs: Any) -> None: + """ + **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: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szdiagnostic/purge_repository.py + :linenos: + :language: python + """ + + @abstractmethod + def reinitialize(self, config_id: int, **kwargs: Any) -> None: + """ + The `reinitialize` method re-initializes the Senzing SzDiagnostic object. + + Args: + config_id (int): The configuration ID used for the initialization + + Raises: + TypeError: Incorrect datatype of input parameter. + szexception.SzError: config_id does not exist. + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szdiagnostic/szdiagnostic_reinitialize.py + :linenos: + :language: python + """ diff --git a/src/senzing_abstract/szengine_abstract.py b/src/senzing_abstract/szengine_abstract.py new file mode 100644 index 0000000..6927d21 --- /dev/null +++ b/src/senzing_abstract/szengine_abstract.py @@ -0,0 +1,1398 @@ +#! /usr/bin/env python3 + +""" +TODO: szengine_abstract.py +""" + +# pylint: disable=C0302 +# AC - Temp disables to get changes in for move to senzing garage +# pylint: disable=W0511,W1113 + + +# Import from standard library. https://docs.python.org/3/library/ + +import json +from abc import ABC, abstractmethod +from typing import Any, Dict, List, Optional, Union, cast + +from .szengineflags import SzEngineFlags + +# Metadata + +# __all__ = ["SzEngineAbstract", "WithInfoResponsesAbstract"] +__all__ = ["SzEngineAbstract"] +__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ +__date__ = "2023-10-30" +__updated__ = "2023-10-30" + + +# ------------------------------------------------------------------------- +# Classes +# ------------------------------------------------------------------------- + + +class SzEngineAbstract(ABC): + """ + Senzing engine module access library + """ + + # ------------------------------------------------------------------------- + # Messages + # ------------------------------------------------------------------------- + + PREFIX = "szengine." + """ :meta private: """ + + ID_MESSAGES = { + 4001: PREFIX + "add_record({0}, {1}, {2}, {3}) failed. Return code: {4}", + 4002: PREFIX + "close_export() failed. Return code: {0}", + 4003: PREFIX + "count_redo_records() failed. Return code: {0}", + 4004: PREFIX + "delete_record({0}, {1}, {2}) failed. Return code: {3}", + 4005: PREFIX + "destroy() failed. Return code: {0}", + 4006: PREFIX + "export_csv_entity_report({0}, {1}) failed. Return code: {2}", + 4007: PREFIX + "export_json_entity_report({0}) failed. Return code: {1}", + 4008: PREFIX + "fetch_next({0}) failed. Return code: {1}", + # NOTE Included but not documented or examples, early adaptor feature, needs manual additions to config + 4009: PREFIX + + "find_interesting_entities_by_entity_id({0}, {1}) failed. Return code: {2}", + # NOTE Included but not documented or examples, early adaptor feature, needs manual additions to config + 4010: ( + PREFIX + + "find_interesting_entities_by_record_id({0}, {1}, {2}) failed. Return" + " code: {3}" + ), + 4011: ( + PREFIX + + "find_network_by_entity_id({0}, {1}, {2}, {3}, {4}) failed. Return code: {5}" + ), + 4012: ( + PREFIX + + "find_network_by_record_id({0}, {1}, {2}, {3}, {4}) failed. Return code: {5}" + ), + 4013: PREFIX + + "find_path_by_entity_id({0}, {1}, {2}, {3}, {4}, {5}) failed. Return code: {6}", + 4014: PREFIX + + "find_path_by_record_id({0}, {1}, {2}, {3}, {4}, {5}, {6}, {7}) failed. Return code: {8}", + 4015: PREFIX + "get_active_config_id() failed. Return code: {0}", + 4016: PREFIX + "get_entity_by_entity_id({0}, {1}) failed. Return code: {2}", + 4017: PREFIX + + "get_entity_by_record_id({0}, {1}, {2}) failed. Return code: {3}", + 4018: PREFIX + "get_record({0}, {1}, {2}) failed. Return code: {3}", + 4019: PREFIX + "get_redo_record() failed. Return code: {0}", + 4021: PREFIX + "get_stats() failed. Return code: {0}", + 4022: PREFIX + "get_virtual_entity_by_record_id({0}) failed. Return code: {1}", + 4023: PREFIX + "how_entity_by_entity_id({0}) failed. Return code: {1}", + 4024: PREFIX + "initialize({0}, {1}, {2}, {3}) failed. Return code: {4}", + 4025: PREFIX + "prime_engine() failed. Return code: {0}", + 4026: PREFIX + "process_redo_record({0}, {1}) failed. Return code: {2}", + 4027: PREFIX + "reevaluate_entity({0}, {1}) failed. Return code: {2}", + 4028: PREFIX + "reevaluate_record({0}, {1}, {2}) failed. Return code: {3}", + 4029: PREFIX + "reinitialize({0}) failed. Return code: {1}", + 4030: PREFIX + "search_by_attributes({0}) failed. Return code: {1}", + 4031: PREFIX + "why_entities({0}, {1}) failed. Return code: {2}", + 4032: PREFIX + "why_records({0}, {1}, {2}, {3}, {4}) failed. Return code: {5}", + 4033: PREFIX + "why_record_in_entity{0}, {1}, {2}) failed. Return code: {3}", + 4034: ( + PREFIX + + "SzEngine({0}, {1}) failed. instance_name and settings must both be set or" + " both be empty" + ), + } + """ :meta private: """ + + # ------------------------------------------------------------------------- + # Interface definition + # ------------------------------------------------------------------------- + + @abstractmethod + def add_record( + self, + data_source_code: str, + record_id: str, + record_definition: Union[str, Dict[Any, Any]], + flags: int = 0, + **kwargs: Any, + ) -> str: + """ + 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. + + Args: + 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 | Dict): 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: + str: If flags are set to return the WITH_INFO response a JSON document containing the details, otherwise an empty JSON document. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/add_record.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/add_record.txt + :linenos: + :language: json + """ + + @abstractmethod + def close_export(self, export_handle: int, **kwargs: Any) -> None: + """ + 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. + + Args: + export_handle (int): A handle created by `export_json_entity_report` or `export_csv_entity_report`. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/export_json_fetch_close.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/export_json_fetch_close.txt + :linenos: + :language: json + """ + + @abstractmethod + def count_redo_records(self, **kwargs: Any) -> int: + """ + The `count_redo_records` method returns the number of records in need of redo-ing. + + Returns: + int: The number of redo records in Senzing's redo queue. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/count_redo_records.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/count_redo_records.txt + :linenos: + :language: guess + """ + + @abstractmethod + def delete_record( + self, + data_source_code: str, + record_id: str, + flags: int = 0, + **kwargs: Any, + ) -> str: + """ + 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. + + Args: + 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: + str: If flags are set to return the WITH_INFO response a JSON document containing the details, otherwise an empty JSON document. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/delete_record.py + :linenos: + + **Output:** + + .. literalinclude:: ../../examples/szengine/delete_record.txt + :linenos: + :language: json + """ + + @abstractmethod + def destroy(self, **kwargs: Any) -> None: + """ + The `destroy` method releases resources and performs cleanup for the SzEngine object and any in-memory configurations. + It should be called after all other calls are complete. + + **Note:** If the `SzEngine` constructor was called with parameters, + the destructor will automatically call the destroy() method. + In this case, a separate call to `destroy()` is not needed. + + Raises: + szexception.SzError: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/szengine_initialize_and_destroy.py + :linenos: + :language: python + """ + + @abstractmethod + def export_csv_entity_report( + self, + csv_column_list: str, + flags: int = SzEngineFlags.SZ_EXPORT_DEFAULT_FLAGS, + **kwargs: Any, + ) -> int: + # TODO: Add into docstring a good default csv_column_list example + """ + **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. + + Args: + 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: + int: A handle that identifies the document to be scrolled through using `fetch_next`. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/export_csv_fetch_close.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/export_csv_fetch_close.txt + :linenos: + :language: guess + """ + + @abstractmethod + def export_json_entity_report( + self, flags: int = SzEngineFlags.SZ_EXPORT_DEFAULT_FLAGS, **kwargs: Any + ) -> int: + """ + **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. + + Args: + flags (int, optional): Flags used to control information returned. Defaults to SzEngineFlags.SZ_EXPORT_DEFAULT_FLAGS. + + Returns: + int: A handle that identifies the document to be scrolled through using `fetch_next`. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/export_json_fetch_close.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/export_json_fetch_close.txt + :linenos: + :language: json + """ + + @abstractmethod + def fetch_next(self, export_handle: int, **kwargs: Any) -> str: + """ + 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. + + Args: + export_handle (int): A handle created by `export_json_entity_report` or `export_json_entity_report`. + + Returns: + str: TODO: + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/export_json_fetch_close.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/export_json_fetch_close.txt + :linenos: + :language: json + """ + + # NOTE Included but not to be documented or examples, early adaptor feature, needs manual additions to config + @abstractmethod + def find_interesting_entities_by_entity_id( + self, entity_id: int, flags: int = 0, **kwargs: Any + ) -> str: + """TODO: Document find_interesting_entities_by_entity_id()""" + + # NOTE Included but not to be documented or examples, early adaptor feature, needs manual additions to config + @abstractmethod + def find_interesting_entities_by_record_id( + self, data_source_code: str, record_id: str, flags: int = 0, **kwargs: Any + ) -> str: + """TODO: Document find_interesting_entities_by_record_id()""" + + @abstractmethod + def find_network_by_entity_id( + self, + entity_list: Union[str, Dict[str, List[Dict[str, int]]]], + max_degrees: int, + build_out_degree: int, + max_entities: int, + flags: int = SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + """ + 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. + + Args: + entity_list (str): A JSON document listing entities. + max_degrees (int): The maximum number of degrees in paths between search entities. + build_out_degree (int): The number of degrees of relationships to show around each search entity. + 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: + str: A JSON document. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/find_network_by_entity_id.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/find_network_by_entity_id.txt + :linenos: + :language: json + """ + + @abstractmethod + def find_network_by_record_id( + self, + record_list: Union[str, Dict[str, List[Dict[str, str]]]], + max_degrees: int, + build_out_degree: int, + max_entities: int, + flags: int = SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + """ + 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. + + Args: + record_list (str): A JSON document listing records. + max_degrees (int): The maximum number of degrees in paths between search entities. + build_out_degree (int): The number of degrees of relationships to show around each search entity. + 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: + str: A JSON document. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/find_network_by_record_id.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/find_network_by_record_id.txt + :linenos: + :language: json + """ + + @abstractmethod + def find_path_by_entity_id( + self, + start_entity_id: int, + end_entity_id: int, + max_degrees: int, + # TODO: Should accept both entity and record IDs in V4, test + exclusions: Union[str, Dict[Any, Any]] = "", + required_data_sources: Union[str, Dict[Any, Any]] = "", + flags: int = SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + """ + 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. + + Args: + 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. + exclusions (str): TODO: + required_data_sources (str): TODO: + flags (int, optional): Flags used to control information returned. Defaults to SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS. + + Returns: + str: A JSON document with an ENTITY_PATHS section that details the path between the entities. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/find_path_by_entity_id.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/find_path_by_entity_id.txt + :linenos: + :language: json + """ + + @abstractmethod + def find_path_by_record_id( + self, + start_data_source_code: str, + start_record_id: str, + end_data_source_code: str, + end_record_id: str, + max_degrees: int, + exclusions: Union[str, Dict[Any, Any]] = "", + required_data_sources: Union[str, Dict[Any, Any]] = "", + flags: int = SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + """ + 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. + + Args: + 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. + exclusions (str): TODO: + required_data_sources (str): TODO: + flags (int, optional): Flags used to control information returned. Defaults to SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS. + + Returns: + str: A JSON document. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/find_path_by_record_id.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/find_path_by_record_id.txt + :linenos: + :language: json + """ + + @abstractmethod + def get_active_config_id(self, **kwargs: Any) -> int: + """ + The `get_active_config_id` method returns the identifier of the currently active Senzing engine configuration. + + Returns: + int: The identifier of the active Senzing Engine configuration. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/get_active_config_id.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/get_active_config_id.txt + :linenos: + :language: json + """ + + @abstractmethod + def get_entity_by_entity_id( + self, + entity_id: int, + flags: int = SzEngineFlags.SZ_ENTITY_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + """ + The `get_entity_by_entity_id` method returns entity data based on the ID of a resolved identity. + + Args: + 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: + str: A JSON document. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/get_entity_by_entity_id.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/get_entity_by_entity_id.txt + :linenos: + :language: json + """ + + @abstractmethod + def get_entity_by_record_id( + self, + data_source_code: str, + record_id: str, + flags: int = SzEngineFlags.SZ_ENTITY_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + """ + The `get_entity_by_record_id` method returns entity data based on the ID of a record which is a member of the entity. + + Args: + 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: + str: A JSON document. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/get_entity_by_record_id.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/get_entity_by_record_id.txt + :linenos: + :language: json + """ + + @abstractmethod + def get_record( + self, + data_source_code: str, + record_id: str, + flags: int = SzEngineFlags.SZ_RECORD_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + """ + 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. + + Args: + 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: + str: A JSON document of a single record. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/get_record.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/get_record.txt + :linenos: + :language: json + """ + + @abstractmethod + def get_redo_record(self, **kwargs: Any) -> str: + """ + The `get_redo_record` method returns the next internally queued redo record from the Senzing repository. + Usually, the `process_redo_record` or `process_redo_record_with_info` method is called to process the redo record + retrieved by `get_redo_record`. + + Returns: + str: A JSON document. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/get_redo_record.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/get_redo_record.txt + :linenos: + :language: json + """ + + @abstractmethod + def get_stats(self, **kwargs: Any) -> str: + """ + The `get_stats` method retrieves workload statistics for the current process. + These statistics will automatically reset after retrieval. + + Returns: + str: A JSON document. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/get_stats.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/get_stats.txt + :linenos: + :language: json + """ + + @abstractmethod + def get_virtual_entity_by_record_id( + self, + record_list: Union[str, Dict[Any, Any]], + flags: int = SzEngineFlags.SZ_VIRTUAL_ENTITY_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + """ + 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. + + Args: + record_list (str): A JSON document of one or more records by DATA_SOURCE and RECORD_ID pairs, formatted as `{"RECORDS":[{"DATA_SOURCE":"DS1","RECORD_ID":"R1"},{"DATA_SOURCE":"DS2","RECORD_ID":"R2"}]}`. + flags (int, optional): Flags used to control information returned. Defaults to SzEngineFlags.SZ_HOW_ENTITY_DEFAULT_FLAGS. + + Returns: + str: A JSON document. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/get_virtual_entity_by_record_id.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/get_virtual_entity_by_record_id.txt + :linenos: + :language: json + """ + + @abstractmethod + def how_entity_by_entity_id( + self, + entity_id: int, + flags: int = SzEngineFlags.SZ_HOW_ENTITY_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + """ + The `how_entity_by_entity_id` method determines and details steps-by-step *how* records resolved to an ENTITY_ID. + + In most cases, *how* provides more detailed information than *why* as the resolution is detailed step-by-step. + + Args: + 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: + str: A JSON document. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/how_entity_by_entity_id.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/how_entity_by_entity_id.txt + :linenos: + :language: json + """ + + @abstractmethod + def initialize( + self, + instance_name: str, + settings: Union[str, Dict[Any, Any]], + config_id: Optional[int] = 0, + verbose_logging: Optional[int] = 0, + **kwargs: Any, + ) -> None: + # TODO: docstring plugin + """ + he ``initialize`` method initializes the Senzing SzEngine object. + It must be called prior to any other calls. + + **Note:** If the SzEngine constructor is called with parameters, + the constructor will automatically call the ``initialize()`` method. + In this case, a separate call to ``initialize()`` is not needed. + + Args: + instance_name (str): A short name given to this instance of the SzEngine object, to help identify it within system logs. + settings (str): A JSON string containing configuration parameters. + config_id (int): + verbose_logging (int): `Optional:` A flag to enable deeper logging of the Senzing processing. 0 for no Senzing logging; 1 for logging. Default: 0 + + Raises: + TypeError: Incorrect datatype of input parameter. + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/szengine_initialize_and_destroy.py + :linenos: + :language: python + """ + + @abstractmethod + def prime_engine(self, **kwargs: Any) -> None: + """ + 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: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/prime_engine.py + :linenos: + :language: python + """ + + @abstractmethod + def process_redo_record(self, redo_record: str, flags: int, **kwargs: Any) -> str: + """ + # TODO: The `process_redo_record` method... + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/process_redo_record.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/process_redo_record.txt + :linenos: + :language: json + """ + + @abstractmethod + def reevaluate_entity(self, entity_id: int, flags: int = 0, **kwargs: Any) -> str: + """ + The `reevaluate_entity` method reevaluates the specified entity. + + Args: + entity_id (int): The unique identifier of an entity. + flags (int, optional): Flags used to control information returned. Defaults to 0. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/reevaluate_entity.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/reevaluate_entity.txt + :linenos: + :language: json + """ + + @abstractmethod + def reevaluate_record( + self, data_source_code: str, record_id: str, flags: int = 0, **kwargs: Any + ) -> str: + """ + The `reevaluate_record` method reevaluates a specific record. + + Args: + 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: + str: If flags are set to return the WITH_INFO response a JSON document containing the details, otherwise an empty JSON document. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/reevaluate_record.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/reevaluate_record.txt + :linenos: + :language: json + """ + + @abstractmethod + def reinitialize(self, config_id: int, **kwargs: Any) -> None: + """ + The `reinitialize` method reinitializes the Senzing SzEngine object using a specific configuration + identifier. A list of available configuration identifiers can be retrieved using + `szconfigmanager.get_config_list`. + + Args: + config_id (int): The configuration ID used for the initialization + + Raises: + TypeError: Incorrect datatype of input parameter. + szexception.SzError: config_id does not exist. + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/szengine_reinitialize.py + :linenos: + :language: python + """ + + @abstractmethod + def search_by_attributes( + self, + attributes: Union[str, Dict[Any, Any]], + search_profile: str = "", + flags: int = SzEngineFlags.SZ_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + """ + The `search_by_attributes` method retrieves entity data based on a user-specified set of entity attributes. + + Args: + attributes (str): A JSON document with the attribute data to search for. + search_profile (str): The name of a configured search profile. Defaults to SEARCH. + flags (int, optional): _description_. Defaults to SzEngineFlags.SZ_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS. + + Returns: + str: A JSON document. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/search_by_attributes.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/search_by_attributes.txt + :linenos: + :language: json + """ + + @abstractmethod + def why_entities( + self, + entity_id_1: int, + entity_id_2: int, + flags: int = SzEngineFlags.SZ_WHY_ENTITIES_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + """ + The `why_entities` method determines why entities did not resolve or why they do relate. + + Args: + 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: + str: A JSON document. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/why_entities.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/why_entities.txt + :linenos: + :language: json + """ + + @abstractmethod + def why_record_in_entity( + self, + data_source_code: str, + record_id: str, + flags: int = SzEngineFlags.SZ_WHY_RECORDS_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + """ + The `why_record_in_entity` ... TODO: + + Args: + 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: + str: A JSON document. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/why_record_in_entity.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/why_record_in_entity.txt + :linenos: + :language: json + """ + + @abstractmethod + def why_records( + self, + data_source_code_1: str, + record_id_1: str, + data_source_code_2: str, + record_id_2: str, + flags: int = SzEngineFlags.SZ_WHY_RECORDS_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + """ + The `why_records` determines if any two records can or cannot resolve together, or if they relate. + + Args: + 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: + str: A JSON document. + + Raises: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szengine/why_records.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szengine/why_records.txt + :linenos: + :language: json + """ + + # ------------------------------------------------------------------------- + # Convenience methods + # ------------------------------------------------------------------------- + + # TODO: doc strings for all return_dict methods it _return_dict methods are staying? + def add_record_return_dict( + self, + data_source_code: str, + record_id: str, + record_definition: Union[str, Dict[Any, Any]], + flags: int = 0, + **kwargs: Any, + ) -> Dict[str, Any]: + """TODO: Document add_record_return_dict()""" + return cast( + Dict[str, Any], + # TODO: orjson? + json.loads( + self.add_record( + data_source_code, record_id, record_definition, flags, **kwargs + ) + ), + ) + + def delete_record_return_dict( + self, + data_source_code: str, + record_id: str, + flags: int = 0, + **kwargs: Any, + ) -> Dict[str, Any]: + """TODO: Document delete_record_return_dict()""" + return cast( + Dict[str, Any], + json.loads( + self.delete_record(data_source_code, record_id, flags, **kwargs) + ), + ) + + def find_interesting_entities_by_entity_id_return_dict( + self, entity_id: int, flags: int = 0, **kwargs: Any + ) -> Dict[str, Any]: + """TODO: Document find_interesting_entities_by_entity_id_return_dict()""" + return cast( + Dict[str, Any], + json.loads( + self.find_interesting_entities_by_entity_id(entity_id, flags, **kwargs) + ), + ) + + def find_interesting_entities_by_record_id_return_dict( + self, data_source_code: str, record_id: str, flags: int = 0, **kwargs: Any + ) -> Dict[str, Any]: + """TODO: Document find_interesting_entities_by_record_id_return_dict()""" + return cast( + Dict[str, Any], + json.loads( + self.find_interesting_entities_by_record_id( + data_source_code, record_id, flags, **kwargs + ) + ), + ) + + def find_network_by_entity_id_return_dict( + self, + entity_list: Union[str, Dict[Any, Any]], + max_degrees: int, + build_out_degree: int, + max_entities: int, + flags: int = SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS, + **kwargs: Any, + ) -> Dict[str, Any]: + """TODO: Document find_network_by_entity_id_return_dict()""" + return cast( + Dict[str, Any], + json.loads( + self.find_network_by_entity_id( + entity_list, + max_degrees, + build_out_degree, + max_entities, + flags, + **kwargs, + ) + ), + ) + + def find_network_by_record_id_return_dict( + self, + record_list: Union[str, Dict[Any, Any]], + max_degrees: int, + build_out_degree: int, + max_entities: int, + flags: int = SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS, + **kwargs: Any, + ) -> Dict[str, Any]: + """TODO: Document find_network_by_record_id_return_dict()""" + return cast( + Dict[str, Any], + json.loads( + self.find_network_by_record_id( + record_list, + max_degrees, + build_out_degree, + max_entities, + flags, + **kwargs, + ) + ), + ) + + def find_path_by_entity_id_return_dict( + self, + start_entity_id: int, + end_entity_id: int, + max_degrees: int, + exclusions: Union[str, Dict[Any, Any]] = "", + required_data_sources: Union[str, Dict[Any, Any]] = "", + flags: int = SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS, + **kwargs: Any, + ) -> Dict[str, Any]: + """TODO: Document find_path_by_entity_id_return_dict()""" + return cast( + Dict[str, Any], + json.loads( + self.find_path_by_entity_id( + start_entity_id, + end_entity_id, + max_degrees, + exclusions, + required_data_sources, + flags, + **kwargs, + ) + ), + ) + + def find_path_by_record_id_return_dict( + self, + start_data_source_code: str, + start_record_id: str, + end_data_source_code: str, + end_record_id: str, + max_degrees: int, + exclusions: Union[str, Dict[Any, Any]] = "", + required_data_sources: Union[str, Dict[Any, Any]] = "", + flags: int = SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS, + **kwargs: Any, + ) -> Dict[str, Any]: + """TODO: Document find_path_by_record_id_return_dict()""" + return cast( + Dict[str, Any], + json.loads( + self.find_path_by_record_id( + start_data_source_code, + start_record_id, + end_data_source_code, + end_record_id, + max_degrees, + exclusions, + required_data_sources, + flags, + **kwargs, + ) + ), + ) + + def get_entity_by_entity_id_return_dict( + self, + entity_id: int, + flags: int = SzEngineFlags.SZ_ENTITY_DEFAULT_FLAGS, + **kwargs: Any, + ) -> Dict[str, Any]: + """TODO: Document get_entity_by_entity_id_return_dict()""" + return cast( + Dict[str, Any], + json.loads(self.get_entity_by_entity_id(entity_id, flags, **kwargs)), + ) + + def get_entity_by_record_id_return_dict( + self, + data_source_code: str, + record_id: str, + flags: int = SzEngineFlags.SZ_ENTITY_DEFAULT_FLAGS, + **kwargs: Any, + ) -> Dict[str, Any]: + """TODO: Document get_entity_by_record_id_return_dict()""" + return cast( + Dict[str, Any], + json.loads( + self.get_entity_by_record_id( + data_source_code, record_id, flags, **kwargs + ) + ), + ) + + def get_record_return_dict( + self, + data_source_code: str, + record_id: str, + flags: int = SzEngineFlags.SZ_RECORD_DEFAULT_FLAGS, + **kwargs: Any, + ) -> Dict[str, Any]: + """TODO: Document get_record_return_dict()""" + return cast( + Dict[str, Any], + json.loads(self.get_record(data_source_code, record_id, flags, **kwargs)), + ) + + def get_stats_return_dict(self, **kwargs: Any) -> Dict[str, Any]: + """TODO: Document get_stats_return_dict()""" + return cast( + Dict[str, Any], + json.loads(self.get_stats(**kwargs)), + ) + + def get_virtual_entity_by_record_id_return_dict( + self, + record_list: Union[str, Dict[Any, Any]], + flags: int = SzEngineFlags.SZ_VIRTUAL_ENTITY_DEFAULT_FLAGS, + **kwargs: Any, + ) -> Dict[str, Any]: + """TODO: Document get_virtual_entity_by_record_id_return_dict()""" + return cast( + Dict[str, Any], + json.loads( + self.get_virtual_entity_by_record_id(record_list, flags, **kwargs) + ), + ) + + def how_entity_by_entity_id_return_dict( + self, + entity_id: int, + flags: int = SzEngineFlags.SZ_HOW_ENTITY_DEFAULT_FLAGS, + **kwargs: Any, + ) -> Dict[str, Any]: + """TODO: Document how_entity_by_entity_id_return_dict()""" + return cast( + Dict[str, Any], + json.loads(self.how_entity_by_entity_id(entity_id, flags, **kwargs)), + ) + + def reevaluate_entity_return_dict( + self, + entity_id: int, + flags: int = 0, + **kwargs: Any, + ) -> Dict[str, Any]: + """TODO: Document reevaluate_entity_return_dict()""" + return cast( + Dict[str, Any], + json.loads(self.reevaluate_entity(entity_id, flags, **kwargs)), + ) + + def reevaluate_record_return_dict( + self, + data_source_code: str, + record_id: str, + flags: int = 0, + **kwargs: Any, + ) -> Dict[str, Any]: + """TODO: Document reevaluate_record_return_dict()""" + return cast( + Dict[str, Any], + json.loads( + self.reevaluate_record(data_source_code, record_id, flags, **kwargs) + ), + ) + + def search_by_attributes_return_dict( + self, + attributes: Union[str, Dict[Any, Any]], + search_profile: str = "SEARCH", + flags: int = SzEngineFlags.SZ_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS, + **kwargs: Any, + ) -> Dict[str, Any]: + """TODO: Document search_by_attributes_return_dict()""" + return cast( + Dict[str, Any], + json.loads( + self.search_by_attributes(attributes, search_profile, flags, **kwargs) + ), + ) + + def why_entities_return_dict( + self, + entity_id_1: int, + entity_id_2: int, + flags: int = SzEngineFlags.SZ_WHY_ENTITIES_DEFAULT_FLAGS, + **kwargs: Any, + ) -> Dict[str, Any]: + """TODO: Document why_entities_return_dict()""" + return cast( + Dict[str, Any], + json.loads(self.why_entities(entity_id_1, entity_id_2, flags, **kwargs)), + ) + + def why_records_return_dict( + self, + data_source_code_1: str, + record_id_1: str, + data_source_code_2: str, + record_id_2: str, + flags: int = SzEngineFlags.SZ_WHY_RECORDS_DEFAULT_FLAGS, + **kwargs: Any, + ) -> Dict[str, Any]: + """TODO: Document why_records_return_dict()""" + return cast( + Dict[str, Any], + json.loads( + self.why_records( + data_source_code_1, + record_id_1, + data_source_code_2, + record_id_2, + flags, + **kwargs, + ) + ), + ) + + def why_record_in_entity_return_dict( + self, + data_source_code: str, + record_id: str, + flags: int = SzEngineFlags.SZ_WHY_RECORDS_DEFAULT_FLAGS, + **kwargs: Any, + ) -> Dict[str, Any]: + """TODO: Document why_record_in_entity_return_dict()""" + # TODO: Is the cast needed? + return cast( + Dict[str, Any], + json.loads( + self.why_record_in_entity(data_source_code, record_id, flags, **kwargs) + ), + ) diff --git a/src/senzing_abstract/szengineflags.py b/src/senzing_abstract/szengineflags.py new file mode 100644 index 0000000..6db6160 --- /dev/null +++ b/src/senzing_abstract/szengineflags.py @@ -0,0 +1,237 @@ +#! /usr/bin/env python3 + +""" +TODO: szengineflags.py +""" + +from enum import IntFlag +from typing import Any, List + +# Metadata + +__all__ = ["SzEngineFlags"] +__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ +__date__ = "2023-10-30" +__updated__ = "2023-10-30" + +# ----------------------------------------------------------------------------- +# SzEngineFlags class +# ----------------------------------------------------------------------------- + + +class SzEngineFlags(IntFlag): + """Engine Flags ...""" + + @classmethod + def combine_flags( + cls, list_of_strings: List[str], *args: Any, **kwargs: Any + ) -> int: + """OR together all strings in list_of_strings""" + # pylint: disable=unused-argument + + result = 0 + for string in list_of_strings: + result = result | SzEngineFlags[string] + return result + + # Flags for exporting entity data. + + SZ_EXPORT_INCLUDE_MULTI_RECORD_ENTITIES = 1 << 0 + SZ_EXPORT_INCLUDE_POSSIBLY_SAME = 1 << 1 + SZ_EXPORT_INCLUDE_POSSIBLY_RELATED = 1 << 2 + SZ_EXPORT_INCLUDE_NAME_ONLY = 1 << 3 + SZ_EXPORT_INCLUDE_DISCLOSED = 1 << 4 + SZ_EXPORT_INCLUDE_SINGLE_RECORD_ENTITIES = 1 << 5 + SZ_EXPORT_INCLUDE_ALL_ENTITIES = ( + SZ_EXPORT_INCLUDE_MULTI_RECORD_ENTITIES + | SZ_EXPORT_INCLUDE_SINGLE_RECORD_ENTITIES + ) + SZ_EXPORT_INCLUDE_ALL_HAVING_RELATIONSHIPS = ( + SZ_EXPORT_INCLUDE_POSSIBLY_SAME + | SZ_EXPORT_INCLUDE_POSSIBLY_RELATED + | SZ_EXPORT_INCLUDE_NAME_ONLY + | SZ_EXPORT_INCLUDE_DISCLOSED + ) + + # Flags for outputting entity relation data. + + SZ_ENTITY_INCLUDE_POSSIBLY_SAME_RELATIONS = 1 << 6 + SZ_ENTITY_INCLUDE_POSSIBLY_RELATED_RELATIONS = 1 << 7 + SZ_ENTITY_INCLUDE_NAME_ONLY_RELATIONS = 1 << 8 + SZ_ENTITY_INCLUDE_DISCLOSED_RELATIONS = 1 << 9 + SZ_ENTITY_INCLUDE_ALL_RELATIONS = ( + SZ_ENTITY_INCLUDE_POSSIBLY_SAME_RELATIONS + | SZ_ENTITY_INCLUDE_POSSIBLY_RELATED_RELATIONS + | SZ_ENTITY_INCLUDE_NAME_ONLY_RELATIONS + | SZ_ENTITY_INCLUDE_DISCLOSED_RELATIONS + ) + + # Flags for outputting entity feature data. + + SZ_ENTITY_INCLUDE_ALL_FEATURES = 1 << 10 + SZ_ENTITY_INCLUDE_REPRESENTATIVE_FEATURES = 1 << 11 + + # Flags for getting extra information about an entity. + + SZ_ENTITY_INCLUDE_ENTITY_NAME = 1 << 12 + SZ_ENTITY_INCLUDE_RECORD_SUMMARY = 1 << 13 + SZ_ENTITY_INCLUDE_RECORD_TYPES = 1 << 28 + SZ_ENTITY_INCLUDE_RECORD_DATA = 1 << 14 + SZ_ENTITY_INCLUDE_RECORD_MATCHING_INFO = 1 << 15 + SZ_ENTITY_INCLUDE_RECORD_JSON_DATA = 1 << 16 + SZ_ENTITY_INCLUDE_RECORD_UNMAPPED_DATA = 1 << 31 + SZ_ENTITY_INCLUDE_RECORD_FEATURE_IDS = 1 << 18 + SZ_ENTITY_INCLUDE_RELATED_ENTITY_NAME = 1 << 19 + SZ_ENTITY_INCLUDE_RELATED_MATCHING_INFO = 1 << 20 + SZ_ENTITY_INCLUDE_RELATED_RECORD_SUMMARY = 1 << 21 + SZ_ENTITY_INCLUDE_RELATED_RECORD_DATA = 1 << 22 + + # Flags for extra feature data. + + SZ_ENTITY_INCLUDE_INTERNAL_FEATURES = 1 << 23 + SZ_ENTITY_INCLUDE_FEATURE_STATS = 1 << 24 + SZ_ENTITY_INCLUDE_FEATURE_ELEMENTS = 1 << 32 + + # Flags for extra matching data. + + SZ_INCLUDE_MATCH_KEY_DETAILS = 1 << 34 + + # Flags for finding entity path & network data. + + SZ_FIND_PATH_PREFER_EXCLUDE = 1 << 25 + SZ_FIND_PATH_INCLUDE_MATCHING_INFO = 1 << 30 + SZ_FIND_NETWORK_INCLUDE_MATCHING_INFO = 1 << 33 + + # Flags for including search result information. + + SZ_INCLUDE_FEATURE_SCORES = 1 << 26 + SZ_SEARCH_INCLUDE_STATS = 1 << 27 + + # Flag for returning with info responses. + SZ_WITH_INFO = 1 << 62 + + # Flags for exporting entity data. + + SZ_SEARCH_INCLUDE_RESOLVED = SZ_EXPORT_INCLUDE_MULTI_RECORD_ENTITIES + SZ_SEARCH_INCLUDE_POSSIBLY_SAME = SZ_EXPORT_INCLUDE_POSSIBLY_SAME + SZ_SEARCH_INCLUDE_POSSIBLY_RELATED = SZ_EXPORT_INCLUDE_POSSIBLY_RELATED + SZ_SEARCH_INCLUDE_NAME_ONLY = SZ_EXPORT_INCLUDE_NAME_ONLY + SZ_SEARCH_INCLUDE_ALL_ENTITIES = ( + SZ_SEARCH_INCLUDE_RESOLVED + | SZ_SEARCH_INCLUDE_POSSIBLY_SAME + | SZ_SEARCH_INCLUDE_POSSIBLY_RELATED + | SZ_SEARCH_INCLUDE_NAME_ONLY + ) + + # Recommended settings. + + SZ_RECORD_DEFAULT_FLAGS = SZ_ENTITY_INCLUDE_RECORD_JSON_DATA + + SZ_ENTITY_DEFAULT_FLAGS = ( + SZ_ENTITY_INCLUDE_ALL_RELATIONS + | SZ_ENTITY_INCLUDE_REPRESENTATIVE_FEATURES + | SZ_ENTITY_INCLUDE_ENTITY_NAME + | SZ_ENTITY_INCLUDE_RECORD_SUMMARY + | SZ_ENTITY_INCLUDE_RECORD_DATA + | SZ_ENTITY_INCLUDE_RECORD_MATCHING_INFO + | SZ_ENTITY_INCLUDE_RELATED_ENTITY_NAME + | SZ_ENTITY_INCLUDE_RELATED_RECORD_SUMMARY + | SZ_ENTITY_INCLUDE_RELATED_MATCHING_INFO + ) + + SZ_ENTITY_BRIEF_DEFAULT_FLAGS = ( + SZ_ENTITY_INCLUDE_RECORD_MATCHING_INFO + | SZ_ENTITY_INCLUDE_ALL_RELATIONS + | SZ_ENTITY_INCLUDE_RELATED_MATCHING_INFO + ) + + SZ_EXPORT_DEFAULT_FLAGS = ( + SZ_EXPORT_INCLUDE_ALL_ENTITIES + # NOTE Check, was removed in 4.0.0.24095 - 2024_04_04__00_00 + # NOTE There are changes in V4 to output messages and Jae is likely still working on them + # | SZ_EXPORT_INCLUDE_ALL_HAVING_RELATIONSHIPS + | SZ_ENTITY_DEFAULT_FLAGS + ) + + SZ_FIND_PATH_DEFAULT_FLAGS = ( + SZ_FIND_PATH_INCLUDE_MATCHING_INFO + | SZ_ENTITY_INCLUDE_ENTITY_NAME + | SZ_ENTITY_INCLUDE_RECORD_SUMMARY + ) + + SZ_FIND_NETWORK_DEFAULT_FLAGS = ( + SZ_FIND_NETWORK_INCLUDE_MATCHING_INFO + | SZ_ENTITY_INCLUDE_ENTITY_NAME + | SZ_ENTITY_INCLUDE_RECORD_SUMMARY + ) + + SZ_WHY_ENTITIES_DEFAULT_FLAGS = ( + SZ_ENTITY_DEFAULT_FLAGS + | SZ_ENTITY_INCLUDE_INTERNAL_FEATURES + | SZ_ENTITY_INCLUDE_FEATURE_STATS + | SZ_INCLUDE_FEATURE_SCORES + ) + + SZ_WHY_RECORDS_DEFAULT_FLAGS = ( + SZ_ENTITY_DEFAULT_FLAGS + | SZ_ENTITY_INCLUDE_INTERNAL_FEATURES + | SZ_ENTITY_INCLUDE_FEATURE_STATS + | SZ_INCLUDE_FEATURE_SCORES + ) + + SZ_WHY_RECORD_IN_ENTITY_DEFAULT_FLAGS = ( + SZ_ENTITY_DEFAULT_FLAGS + | SZ_ENTITY_INCLUDE_INTERNAL_FEATURES + | SZ_ENTITY_INCLUDE_FEATURE_STATS + | SZ_INCLUDE_FEATURE_SCORES + ) + + SZ_HOW_ENTITY_DEFAULT_FLAGS = SZ_INCLUDE_FEATURE_SCORES + + SZ_VIRTUAL_ENTITY_DEFAULT_FLAGS = SZ_ENTITY_DEFAULT_FLAGS + + SZ_SEARCH_BY_ATTRIBUTES_ALL = ( + SZ_SEARCH_INCLUDE_ALL_ENTITIES + | SZ_ENTITY_INCLUDE_REPRESENTATIVE_FEATURES + | SZ_ENTITY_INCLUDE_ENTITY_NAME + | SZ_ENTITY_INCLUDE_RECORD_SUMMARY + | SZ_INCLUDE_FEATURE_SCORES + ) + + SZ_SEARCH_BY_ATTRIBUTES_STRONG = ( + SZ_SEARCH_INCLUDE_RESOLVED + | SZ_SEARCH_INCLUDE_POSSIBLY_SAME + | SZ_ENTITY_INCLUDE_REPRESENTATIVE_FEATURES + | SZ_ENTITY_INCLUDE_ENTITY_NAME + | SZ_ENTITY_INCLUDE_RECORD_SUMMARY + | SZ_INCLUDE_FEATURE_SCORES + ) + + SZ_SEARCH_BY_ATTRIBUTES_MINIMAL_ALL = SZ_SEARCH_INCLUDE_ALL_ENTITIES + + SZ_SEARCH_BY_ATTRIBUTES_MINIMAL_STRONG = ( + SZ_SEARCH_INCLUDE_RESOLVED | SZ_SEARCH_INCLUDE_POSSIBLY_SAME + ) + + SZ_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS = SZ_SEARCH_BY_ATTRIBUTES_ALL + + # ----------------------------------------------------------------------------- + # non-SzEngineFlags flags + # ----------------------------------------------------------------------------- + + SZ_INITIALIZE_WITH_DEFAULT_CONFIGURATION = 0 + SZ_NO_FLAGS = 0 + SZ_NO_LOGGING = 0 + SZ_VERBOSE_LOGGING = 1 + SZ_WITHOUT_INFO = 0 + + +# ----------------------------------------------------------------------------- +# Additional default values +# TODO: Not sure if these values belong in this file. +# ----------------------------------------------------------------------------- + +SZ_NO_ATTRIBUTES = "" +SZ_NO_EXCLUSIONS = "" +SZ_NO_REQUIRED_DATASOURCES = "" +SZ_NO_SEARCH_PROFILE = "" diff --git a/src/senzing_abstract/szerror.py b/src/senzing_abstract/szerror.py new file mode 100644 index 0000000..ade39a3 --- /dev/null +++ b/src/senzing_abstract/szerror.py @@ -0,0 +1,697 @@ +#! /usr/bin/env python3 +""" +DO NOT EDIT. This code is generated. +Generated by: sz-sdk-errors/bin/generate_python.py +Generated for: sz-sdk-python-abstract/src/senzing_abstract/szerror.py +Generated date: 2024-05-02T19:46:40.745960+00:00 +""" + +import datetime +import json +import threading +import traceback +from ctypes import c_char, create_string_buffer, sizeof +from typing import Any, Callable, Dict + +# Metadata + +__all__ = [ + "SzBadInputError", + "SzConfigurationError", + "SzDatabaseConnectionLostError", + "SzDatabaseError", + "SzError", + "SzLicenseError", + "SzNotFoundError", + "SzNotInitializedError", + "SzRetryableError", + "SzRetryTimeoutExceededError", + "SzUnhandledError", + "SzUnknownDataSourceError", + "SzUnrecoverableError", + "new_szexception", +] +__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ +__date__ = "2023-10-30" +__updated__ = "2024-05-02" + + +# ----------------------------------------------------------------------------- +# Base SzError +# ----------------------------------------------------------------------------- + + +class SzError(Exception): + """Base exception for Sz related python code.""" + + +# ----------------------------------------------------------------------------- +# Category exceptions +# - These exceptions represent categories of actions that can be taken by +# the calling program. +# ----------------------------------------------------------------------------- + + +class SzBadInputError(SzError): + """The user-supplied input contained an error.""" + + +class SzConfigurationError(SzError): + """The program can provide a remedy and continue.""" + + +class SzRetryableError(SzError): + """The program can provide a remedy and continue.""" + + +class SzUnrecoverableError(SzError): + """System failure, can't continue.""" + + +# ----------------------------------------------------------------------------- +# Detail exceptions for SzBadInputException +# - Processing did not complete. +# - These exceptions are "per record" exceptions. +# - The record should be recorded as "bad". (logged, queued as failure) +# - Processing may continue. +# ----------------------------------------------------------------------------- + + +class SzNotFoundError(SzBadInputError): + """Not found""" + + +class SzUnknownDataSourceError(SzBadInputError): + """Unknown DataSource""" + + +# ----------------------------------------------------------------------------- +# Detail exceptions for SzRetryableException +# - Processing did not complete. +# - These exceptions may be remedied programmatically. +# - The call to the Senzing method should be retried. +# - Processing may continue. +# ----------------------------------------------------------------------------- + + +class SzDatabaseConnectionLostError(SzRetryableError): + """Database connection lost""" + + +class SzRetryTimeoutExceededError(SzRetryableError): + """Retry timeout exceeded time limit""" + + +# ----------------------------------------------------------------------------- +# Detail exceptions for SzUnrecoverableException +# - Processing did not complete. +# - These exceptions cannot be remedied programmatically. +# - Processing cannot continue. +# ----------------------------------------------------------------------------- + + +class SzDatabaseError(SzUnrecoverableError): + """Database exception""" + + +class SzLicenseError(SzUnrecoverableError): + """Licence exception""" + + +class SzNotInitializedError(SzUnrecoverableError): + """Not initialized""" + + +class SzUnhandledError(SzUnrecoverableError): + """Could not handle exception""" + + +# ----------------------------------------------------------------------------- +# Determine Exception based on Senzing reason code. +# Reference: https://senzing.zendesk.com/hc/en-us/articles/360026678133-Engine-Error-codes +# ----------------------------------------------------------------------------- + +# fmt: off +EXCEPTION_MAP = { + 2: SzBadInputError, # EAS_ERR_INVALID_XML "Invalid XML" + 5: SzError, # EAS_ERR_EXCEEDED_MAX_RETRIES "Exceeded the Maximum Number of Retries Allowed" + 7: SzBadInputError, # EAS_ERR_EMPTY_XML_MESSAGE "Empty XML Message" + 10: SzRetryTimeoutExceededError, # EAS_ERR_RETRY_TIMEOUT "Retry timeout exceeded RES_ENT_ID locklist [{0}]" + 14: SzConfigurationError, # EAS_ERR_INVALID_DATASTORE_CONFIGURATION_TYPE "Invalid Datastore Configuration Type" + 19: SzConfigurationError, # EAS_ERR_NO_CONFIGURATION_FOUND "Configuration not found" + 20: SzConfigurationError, # EAS_ERR_CONFIG_CANNOT_BE_NULL_DATABASE "Configuration cannot be loaded from database connection" + 21: SzConfigurationError, # EAS_ERR_CONFIG_CANNOT_BE_NULL_CONFIG_FILE "Configuration cannot be loaded from config file" + 22: SzBadInputError, # EAS_ERR_INVALID_DOCTYPE "Invalid DocType {0}" + 23: SzBadInputError, # EAS_ERR_CONFLICTING_DATA_SOURCE_VALUES "Conflicting DATA_SOURCE values '{0}' and '{1}'" + 24: SzBadInputError, # EAS_ERR_CONFLICTING_RECORD_ID_VALUES "Conflicting RECORD_ID values '{0}' and '{1}'" + 26: SzBadInputError, # EAS_ERR_RESERVED_WORD_USED_IN_DOCUMENT "Inbound data contains a reserved keyword '{0}'" + 27: SzUnknownDataSourceError, # EAS_ERR_UNKNOWN_DSRC_CODE_VALUE "Unknown DATA_SOURCE value '{0}'" + 28: SzConfigurationError, # EAS_ERR_INVALID_JSON_CONFIG_DOCUMENT "Invalid JSON config document" + 29: SzError, # EAS_ERR_INVALID_HANDLE "Invalid Handle" + 30: SzConfigurationError, # EAS_ERR_INVALID_MATCH_LEVEL "Invalid match level '{0}'" + 33: SzNotFoundError, # EAS_ERR_UNKNOWN_DSRC_RECORD_ID "Unknown record: dsrc[{0}], record[{1}]" + 34: SzConfigurationError, # EAS_ERR_AMBIGUOUS_ENTITY_FTYPE_MISSING "AMBIGUOUS_ENTITY Feature Type is not configured" + 35: SzConfigurationError, # EAS_ERR_AMBIGUOUS_TIER_FELEM_MISSING "AMBIGUOUS_TIER Feature Element is not configured" + 36: SzConfigurationError, # EAS_ERR_AMBIGUOUS_FTYPE_ID_FELEM_MISSING "AMBIGUOUS_FTYPE_ID Feature Element is not configured" + 37: SzNotFoundError, # EAS_ERR_UNKNOWN_RESOLVED_ENTITY_VALUE "Unknown resolved entity value '{0}'" + 38: SzError, # EAS_ERR_RECORD_HAS_NO_RESOLVED_ENTITY "Data source record has no resolved entity: dsrc[{0}], recordID[{1}]" + 39: SzError, # EAS_ERR_NO_OBSERVED_ENTITY_FOR_DSRC_ENTITY_KEY "No observed entity for entity key: dsrc[{0}], record_id[{1}], key[{2}]" + 40: SzConfigurationError, # EAS_ERR_CONFIG_COMPATIBILITY_MISMATCH "The engine configuration compatibility version [{0}] does not match the version of the provided config[{1}]." + 41: SzError, # EAS_ERR_DOCUMENT_PREPROCESSING_FAILED "Document preprocessing failed" + 42: SzError, # EAS_ERR_DOCUMENT_LOAD_PROCESSING_FAILED "Document load processing failed" + 43: SzError, # EAS_ERR_DOCUMENT_ER_PROCESSING_FAILED "Document ER processing failed" + 44: SzError, # EAS_ERR_CHECK_ENTITY_PROCESSING_FAILED "Check entity processing failed" + 45: SzError, # EAS_ERR_INPUT_PROCEDURE_PROCESSING_FAILED "Input procedure processing failed" + 46: SzError, # EAS_ERR_DOCUMENT_HASHING_PROCESSING_FAILED "Document hashing-processing failed" + 47: SzError, # EAS_ERR_SESSION_IS_INVALID "Session is invalid" + 48: SzNotInitializedError, # EAS_ERR_G2_NOT_INITIALIZED "G2 is not initialized" + 49: SzNotInitializedError, # EAS_ERR_G2AUDIT_NOT_INITIALIZED "G2Audit is not initialized" + 50: SzNotInitializedError, # EAS_ERR_G2HASHER_NOT_INITIALIZED "G2Hasher is not initialized" + 51: SzBadInputError, # EAS_ERR_BOTH_RECORD_ID_AND_ENT_SRC_KEY_SPECIFIED "Cannot use both Record ID and Entity Source Key in record" + 52: SzError, # EAS_ERR_UNKNOWN_RELATIONSHIP_ID_VALUE "Unknown relationship ID value '{0}'" + 53: SzBadInputError, # EAS_ERR_G2DIAGNOSTIC_NOT_INITIALIZED "G2Diagnostic is not initialized" + 54: SzDatabaseError, # EAS_ERR_G2_DATA_REPOSITORY_WAS_PURGED "Data repository was purged" + 55: SzError, # EAS_ERR_NO_RESOLVED_ENTITY_FOR_DSRC_ENTITY_KEY "No resolved entity for entity key: dsrc[{0}], record_id[{1}], key[{2}]" + 56: SzError, # EAS_ERR_NO_RECORDS_EXIST_FOR_RESOLVED_ENTITY "No data source records exist for entity ID: entityID[{0}]" + 57: SzError, # EAS_ERR_UNKNOWN_FEATURE_ID_VALUE "Unknown feature ID value '{0}'" + 58: SzError, # EAS_ERR_G2_INITIALIZATION_FAILURE "G2 initialization process has failed" + 60: SzConfigurationError, # EAS_ERR_CONFIG_DATABASE_MISMATCH "The engine configuration does not match the records loaded into the repository: errors[{0}]." + 61: SzConfigurationError, # EAS_ERR_AMBIGUOUS_SUPPRESSED_LIBFEAT_FELEM_MISSING "AMBIGUOUS_SUPRESSED_LIBFEAT Feature Element is not configured" + 62: SzConfigurationError, # EAS_ERR_AMBIGUOUS_TYPE_FELEM_MISSING "AMBIGUOUS_TYPE Feature Element is not configured" + 63: SzNotInitializedError, # EAS_ERR_G2CONFIGMGR_NOT_INITIALIZED "G2ConfigMgr is not initialized" + 64: SzConfigurationError, # EAS_ERR_CONFUSED_ENTITY_FTYPE_MISSING "CONFUSED_ENTITY Feature Type is not configured" + 66: SzBadInputError, # EAS_ERR_UNKNOWN_GENERIC_PLAN_VALUE "Unknown generic plan value '{0}'" + 67: SzConfigurationError, # EAS_ERR_INVALID_GENERIC_PLAN_VALUE "Invalid Generic Plan ID [{0}] configured for the '{1}' retention level.'" + 68: SzError, # EAS_ERR_UNKNOWN_ER_RESULT "Unknown ER-result." + 69: SzError, # EAS_ERR_NO_CANDIDATES "No candidates." + 76: SzError, # EAS_ERR_INBOUND_FEATURE_VERSION_NEWER_THAN_CONFIG "Inbound Feature Version [{0}] is newer than configured version [{1}] for feature type[{2}]." + 77: SzError, # EAS_ERR_ERROR_WHEN_PRIMING_GNR "Error when priming GNR resources '{0}'" + 78: SzError, # EAS_ERR_ERROR_WHEN_ENCRYPTING "Error when encrypting '{0}'" + 79: SzError, # EAS_ERR_ERROR_WHEN_DECRYPTING "Error when decrypting '{0}'" + 80: SzError, # EAS_ERR_ERROR_WHEN_VALIDATING_ENCRYPTION_SIGNATURE_COMPATIBILITY "Error when validating encryption signature compatibility '{0}'" + 81: SzError, # EAS_ERR_ERROR_WHEN_CHECKING_DISTINCT_FEATURE_GENERALIZATION "Error when checking distinct feature generalization '{0}'" + 82: SzError, # EAS_ERR_ERROR_WHEN_RUNNING_DQM "Error when running DQM '{0}'" + 83: SzError, # EAS_ERR_ERROR_WHEN_CREATING_EFEATS "Error when creating EFEATS '{0}'" + 84: SzError, # EAS_ERR_ERROR_WHEN_SIMPLE_SCORING "Error when simple scoring '{0}'" + 85: SzError, # EAS_ERR_ERROR_WHEN_SCORING_PAIR "Error when scoring a pair '{0}'" + 86: SzError, # EAS_ERR_ERROR_WHEN_SCORING_SET "Error when scoring a set '{0}'" + 87: SzUnhandledError, # EAS_ERR_SRD_EXCEPTION "SRD Exception '{0}'" + 88: SzBadInputError, # EAS_ERR_UNKNOWN_SEARCH_PROFILE_VALUE "Unknown search profile value '{0}'" + 89: SzConfigurationError, # EAS_ERR_MISCONFIGURED_SEARCH_PROFILE_VALUE "Misconfigured search profile value '{0}'" + 90: SzConfigurationError, # EAS_ERR_CANNOT_ADD_LIBRARY_FEATURES_TO_DATASTORE "Cannot add library features to datastore: '{0}'" + 91: SzError, # EAS_ERR_TRUSTED_ID_FTYPE_MISSING "TRUSTED_ID Feature Type is not configured" + 92: SzError, # EAS_ERR_RECORD_TYPE_FTYPE_MISSING "RECORD_TYPE Feature Type is not configured" + 999: SzLicenseError, # EAS_ERR_LICENSE_HAS_EXPIRED "License has expired" + 1000: SzDatabaseError, # EAS_ERR_UNHANDLED_DATABASE_ERROR "Unhandled Database Error '{0}'" + 1001: SzDatabaseError, # EAS_ERR_CRITICAL_DATABASE_ERROR "Critical Database Error '{0}'" + 1002: SzDatabaseError, # EAS_ERR_DATABASE_MEMORY_ERROR "Database Memory Error '{0}'" + 1003: SzDatabaseError, # EAS_ERR_TABLE_SPACE_OR_LOG_VIOLATION "Table Space or Log Violation '{0}'" + 1004: SzDatabaseError, # EAS_ERR_RESOURCE_CONTENTION "Resource Contention '{0}'" + 1005: SzDatabaseError, # EAS_ERR_USER_DEFINED_PROC_ERROR "User Defined Procedure or Function Error '{0}'" + 1006: SzDatabaseConnectionLostError, # EAS_ERR_DATABASE_CONNECTION_FAILURE "Database Connection Failure '{0}'" + 1007: SzDatabaseConnectionLostError, # EAS_ERR_DATABASE_CONNECTION_LOST "Database Connection Lost '{0}'" + 1008: SzDatabaseError, # EAS_ERR_DEADLOCK_ERROR "Deadlock Error '{0}'" + 1009: SzDatabaseError, # EAS_ERR_INSUFFICIENT_PERMISSIONS "Insufficient Permissions '{0}'" + 1010: SzDatabaseError, # EAS_ERR_TRANSACTION_ERROR "Transaction Error '{0}'" + 1011: SzDatabaseError, # EAS_ERR_UNIQUE_CONSTRAINT_VIOLATION "Unique Constraint Violation '{0}'" + 1012: SzDatabaseError, # EAS_ERR_CONSTRAINT_VIOLATION "Constraint Violation '{0}'" + 1013: SzDatabaseError, # EAS_ERR_SYNTAX_ERROR "Syntax Error '{0}'" + 1014: SzDatabaseError, # EAS_ERR_CURSOR_ERROR "Cursor Error '{0}'" + 1015: SzDatabaseError, # EAS_ERR_DATATYPE_ERROR "Data Type Error '{0}'" + 1016: SzDatabaseError, # EAS_ERR_TRANSACTION_ABORTED_ERROR "Transaction Aborted '{0}'" + 1017: SzDatabaseError, # EAS_ERR_DATABASE_OPERATOR_NOT_SET "Database operator not set '{0}'" + 1018: SzDatabaseError, # EAS_ERR_DATABASE_EXCEPTION_GENERATOR_NOT_SET "Database exception generator not set '{0}'" + 1019: SzConfigurationError, # EAS_ERR_DATABASE_SCHEMA_TABLES_NOT_FOUND "Datastore schema tables not found. [{0}]" + 2001: SzConfigurationError, # EAS_ERR_FEATURE_HAS_NO_FTYPE_CODE "Cannot process feature with no FTYPE_CODE[{0}]" + 2002: SzError, # EAS_ERR_REQUESTED_CONFIG_FOR_INVALID_FTYPE_CODE "Requested config for invalid FTYPE_CODE[{0}]" + 2003: SzError, # EAS_ERR_NO_FELEM_CODE "Cannot process OBS_FELEM with no FELEM_CODE[{0}]" + 2005: SzError, # EAS_ERR_INVALID_FELEM_CODE "FELEM_CODE[{0}] is not configured for FTYPE_CODE[{1}]" + 2006: SzError, # EAS_ERR_MISSING_ENT_SRC_KEY "OBS_ENT is missing ENT_SRC_KEY" + 2012: SzConfigurationError, # EAS_ERR_ERRULE_CONFIGURED_FOR_RESOLVE_AND_RELATE "ER Rule [{0}] is configured for both resolve and relate." + 2015: SzConfigurationError, # EAS_ERR_INVALID_FTYPE_CODE "Invalid FTYPE_CODE[{0}]" + 2027: SzError, # EAS_ERR_PLUGIN_INIT "Plugin initialization error {0}" + 2029: SzConfigurationError, # EAS_ERR_REQUESTED_CONFIG_FOR_INVALID_PLUGIN "Configuration not found for plugin type: {0}" + 2034: SzConfigurationError, # EAS_ERR_INVALID_CFRTN_VAL "CFRTN_ID[{0}]/FTYPE[{1}] is expecting CFRTN_VAL[{2}] which is not offered by CFUNC_ID[{3}][{4}]. Available scores are [{5}]" + 2036: SzConfigurationError, # EAS_ERR_FTYPE_HAS_NO_BOM "FType configured with no Feature Elements (Bill of Materials) FTYPE_ID[{0}] FTYPE_CODE[{1}]" + 2037: SzConfigurationError, # EAS_ERR_FUNC_CALL_HAS_NO_BOM "Function call ({3}) configured with no Bill of Materials {4}[{0}] FTYPE_ID[{1}] FTYPE_CODE[{2}]" + 2038: SzConfigurationError, # EAS_ERR_DISTINCT_FEATURE_HAS_NO_BOM "Distinct feature call configured with no Bill of Materials DFCALL_ID[{0}]" + 2041: SzConfigurationError, # EAS_ERR_EFCALL_HAS_NO_BOM "EFeature creation call configured with no Bill of Materials EFCALL_ID[{0}]" + 2045: SzConfigurationError, # EAS_ERR_CFRTN_REFERS_BAD_CFUNC_ID "CFG_CFRTN references CFUNC_ID[{0}] which is not configured" + 2047: SzConfigurationError, # EAS_ERR_MISSING_DSRC_CODE "Observation is missing DSRC_CODE tag which is required" + 2048: SzConfigurationError, # EAS_ERR_FEAT_FREQ_INVALID "FEATURE CODE[{0}] FEATURE FREQUENCY[{1}] is an invalid frequency" + 2049: SzConfigurationError, # EAS_ERR_FUNC_INVALID "{2} [{0}] is invalid for {3}[{1}]" + 2050: SzConfigurationError, # EAS_ERR_QUAL_FRAG_NOT_FOUND "Rule[{0}] Qualifier Fragment[{1}]: Fragment not found" + 2051: SzConfigurationError, # EAS_ERR_DISQUAL_FRAG_NOT_FOUND "Rule[{0}] Disqualifier Fragment[{1}]: Fragment not found" + 2057: SzBadInputError, # EAS_ERR_BAD_DSRC_ACTION "Observation has DSRC_ACTION[{0}] which is invalid. Valid values are [A]dd, [C]hange, [D]elete or E[X]tensive Evaluation" + 2061: SzConfigurationError, # EAS_ERR_DUPLICATE_LOOKUP_IDENTIFIER "Duplicate [{0}] with identifier value [{1}]. Only unique values are allowed." + 2062: SzConfigurationError, # EAS_ERR_INVALID_LOOKUP_IDENTIFIER "Requested lookup of [{0}] using unknown value [{1}]. Value not found." + 2065: SzConfigurationError, # EAS_ERR_FTYPE_HAS_MULTIPLE_DEFINITIONS "FType configured with multiple definitions. FTYPE_CODE[{0}] used in FTYPE_ID[{1}] and FTYPE_ID[{2}]" + 2066: SzConfigurationError, # EAS_ERR_FELEM_HAS_MULTIPLE_DEFINITIONS "FElem configured with multiple definitions. FELEM_CODE[{0}] used in FELEM_ID[{1}] and FELEM_ID[{2}]" + 2067: SzConfigurationError, # EAS_ERR_ERFRAG_HAS_MULTIPLE_DEFINITIONS "ER Fragment code configured with multiple definitions. ERFRAG_CODE[{0}] used in ERFRAG_ID[{1}] and ERFRAG_ID[{2}]" + 2069: SzConfigurationError, # EAS_ERR_BOM_CONFIG_INVALID_FOR_SIMPLE_PLUGIN "Configured plugin for CFCALL_ID[{0}] requires exactly one value in BOM" + 2070: SzConfigurationError, # EAS_ERR_EFCALL_HAS_INVALID_FUNCTION "EFeature creation call configured with invalid function ID EFCALL_ID[{0}] EFUNC_ID[{1}]" + 2071: SzConfigurationError, # EAS_ERR_EFBOM_HAS_INVALID_EFCALL "EFeature BOM configured with invalid EFCALL_ID[{0}]" + 2073: SzError, # EAS_ERR_LOADING_LIBRARY "Library loading error {0}" + 2074: SzError, # EAS_ERR_SCORING_MANAGER_PLUGIN "Scoring manager: id {0} and {1} do not match" + 2075: SzConfigurationError, # EAS_ERR_TABLE_CONFIGURED_WITH_INVALID_FTYPE_CODE "Table {0} configured with an invalid type FTYPE_CODE[{1}]" + 2076: SzConfigurationError, # EAS_ERR_TABLE_CONFIGURED_WITH_INVALID_FELEM_CODE "Table {0} configured with an invalid type FELEM_CODE[{1}]" + 2079: SzConfigurationError, # EAS_ERR_EFBOM_CONFIGURED_WITH_INVALID_FTYPE_ID "CFG_EFBOM configured with an invalid type FTYPE_ID[{0}]" + 2080: SzConfigurationError, # EAS_ERR_EFBOM_CONFIGURED_WITH_INVALID_FELEM_ID "CFG_EFBOM configured with an invalid type FELEM_ID[{0}]" + 2081: SzConfigurationError, # EAS_ERR_FUNC_CALL_CONFIGURED_WITH_INVALID_FTYPE_ID "{1} configured with an invalid type FTYPE_ID[{0}]" + 2082: SzConfigurationError, # EAS_ERR_FUNC_CALL_CONFIGURED_WITH_INVALID_FUNC_ID "{1} configured with an invalid type {2}[{0}]" + 2083: SzConfigurationError, # EAS_ERR_FUNC_BOM_CONFIGURED_WITH_INVALID_FTYPE_ID "{1} configured with an invalid type FTYPE_ID[{0}]" + 2084: SzConfigurationError, # EAS_ERR_FUNC_BOM_CONFIGURED_WITH_INVALID_FELEM_ID "{1} configured with an invalid type FELEM_ID[{0}]" + 2088: SzConfigurationError, # EAS_ERR_TABLE_CONFIGURED_WITH_INVALID_RCLASS_ID "Table {0} configured with an invalid RCLASS_ID[{1}]" + 2089: SzConfigurationError, # EAS_ERR_UNKNOWN_FCLASS_ID "UNKNOWN FCLASS ID[{0}]" + 2090: SzConfigurationError, # EAS_ERR_SFCALL_HAS_INVALID_FUNCTION "Feature standardization call configured with invalid function ID SFCALL_ID[{0}] SFUNC_ID[{1}]" + 2091: SzConfigurationError, # EAS_ERR_TABLE_CONFIGURED_WITH_BOTH_FTYPE_ID_AND_FELEM_ID "{0} configured with both an FTYPE_ID[{1}] and FELEM_ID[{2}]" + 2092: SzConfigurationError, # EAS_ERR_TABLE_CONFIGURED_WITH_NEITHER_FTYPE_ID_NOR_FELEM_ID "{0} configured with neither an FTYPE_ID nor an FELEM_ID" + 2093: SzConfigurationError, # EAS_ERR_TABLE_CONFIGURED_WITH_DUPLICATE_EXEC_ORDER_FOR_IDENTIFIER_LIST "Table [{0}] configured with duplicate execution order value [{3}] for identifiers[{1}] with values [{2}]" + 2094: SzConfigurationError, # EAS_ERR_DUPLICATE_VALUE_FOR_FIELD_IN_TABLE "Duplicate value [{2}] of field [{1}] in config [{0}]" + 2095: SzConfigurationError, # EAS_ERR_TABLE_CONFIGURED_WITH_INVALID_FTYPE_CODE_FELEM_CODE_PAIR "Table {0} configured with an invalid FTYPE_CODE[{1}]/FELEM_CODE[{2}] pair" + 2099: SzConfigurationError, # EAS_ERR_COUNTER_CONFIG_INVALID_THRESHOLD "Next Threshold for a counter should be no less than 10, but has NEXT_THRESH{0}" + 2101: SzConfigurationError, # EAS_ERR_XPATH_OP_UNSUPPORTED "XPath operation unsupported [{0}]" + 2102: SzConfigurationError, # EAS_ERR_XPATH_AXIS_UNSUPPORTED "XPath axis unsupported [{0}]" + 2103: SzConfigurationError, # EAS_ERR_XPATH_TEST_UNSUPPORTED "XPath test unsupported [{0}]" + 2104: SzConfigurationError, # EAS_ERR_XPATH_TYPE_UNSUPPORTED "XPath type unsupported [{0}]" + 2105: SzConfigurationError, # EAS_ERR_XPATH_NODE_PREFIX_UNSUPPORTED "XPath node prefix unsupported [{0}]" + 2106: SzConfigurationError, # EAS_ERR_XPATH_NODE_NAME_UNSUPPORTED "XPath node name unsupported position[{0}], name[{1}]" + 2107: SzConfigurationError, # EAS_ERR_XPATH_BEHAVIOR_TYPE_UNSUPPORTED "XPath behavior type unsupported [{0}]" + 2108: SzConfigurationError, # EAS_ERR_XPATH_BUCKET_UNSUPPORTED "XPath bucket type unsupported [{0}]" + 2109: SzConfigurationError, # EAS_ERR_XPATH_VALUE_TYPE_UNSUPPORTED "XPath value type unsupported [{0}]" + 2110: SzConfigurationError, # EAS_ERR_XPATH_PLUS_TYPE_UNSUPPORTED "XPath plus operand type unsupported [{0}]" + 2111: SzConfigurationError, # EAS_ERR_XPATH_FRAGMENT_NOT_EVALUATED "XPath fragment not evaluated[{0}]" + 2112: SzConfigurationError, # EAS_ERR_XPATH_FRAGMENT_NOT_CONFIGURED "XPath fragment not configured[{0}]" + 2113: SzConfigurationError, # EAS_ERR_XPATH_FUNCTION_UNSUPPORTED "XPath function unsupported [{0}]" + 2114: SzConfigurationError, # EAS_ERR_INVALID_FTYPE_SCORESET "Cannot set score for invalid FTYPE_ID [{0}]" + 2116: SzError, # EAS_ERR_UNITIALIZED_AMBIGUOUS_CACHE "Uninitialized Ambiguous Test Cache" + 2117: SzConfigurationError, # EAS_ERR_SCORING_CALL_HAS_NO_BOM "Scoring call configured with no Bill of Materials CFCALL_ID[{0}]." + 2118: SzConfigurationError, # EAS_ERR_BOM_CONFIG_INVALID_FOR_SCORING_PLUGIN "Configured plugin for CFCALL_ID[{0}] has invalid BOM." + 2120: SzConfigurationError, # EAS_ERR_TABLE_CONFIGURED_WITH_INVALID_FTYPE_ID "Table {0} configured with an invalid type FTYPE_ID[{1}]" + 2121: SzConfigurationError, # EAS_ERR_TABLE_CONFIGURED_WITH_INVALID_FELEM_ID "Table {0} configured with an invalid type FELEM_ID[{1}]" + 2123: SzConfigurationError, # EAS_ERR_CFUNC_CONFIGURED_WITH_NO_CFRTN "CFG_CFUNC [{0}] feature type [{1}] configured without any corresponding return values in CFG_CFRTN" + 2131: SzConfigurationError, # EAS_ERR_OBS_ENT_NOT_FOUND "Requested resolution of OBS_ENT_ID that is not loaded OBS_ENT_ID[{0}]" + 2135: SzConfigurationError, # EAS_ERR_INPUT_MAPPING_CONFIG_ERROR "Error in input mapping config[{0}]" + 2136: SzConfigurationError, # EAS_ERR_INPUT_MAPPING_MISSING_REQUIRED_FIELD "Error in input mapping, missing required field[{0}]" + 2137: SzConfigurationError, # EAS_ERR_INPUT_MAPPING_MALFORMED_INPUT "Error in input mapping, input message is malformed[{0}]" + 2138: SzConfigurationError, # EAS_ERR_INVALID_CFRTN_INDEX "CFRTN_ID[{0}] is out of range. Valid range is 0-7" + 2139: SzConfigurationError, # EAS_ERR_DSRC_INTEREST_CONFIGURED_WITH_INVALID_DSRCID "Data Source Interest configured with invalid Data Source ID DSRC_ID[{0}]" + 2207: SzConfigurationError, # EAS_ERR_DATA_SOURCE_CODE_DOES_NOT_EXIST "Data source code [{0}] does not exist." + 2209: SzConfigurationError, # EAS_ERR_DATA_SOURCE_ID_ALREADY_EXISTS "Data source ID [{0}] already exists." + 2210: SzConfigurationError, # EAS_ERR_FELEM_CODE_DOES_NOT_EXIST "Feature element code [{0}] does not exist." + 2211: SzConfigurationError, # EAS_ERR_FELEM_CODE_ALREADY_EXISTS "Feature element code [{0}] already exists." + 2212: SzConfigurationError, # EAS_ERR_FELEM_ID_ALREADY_EXISTS "Feature element ID [{0}] already exists." + 2213: SzConfigurationError, # EAS_ERR_INVALID_FELEM_DATA_TYPE "Invalid feature element datatype [{0}] found. Datatype must be in [{1}]." + 2214: SzConfigurationError, # EAS_ERR_FELEM_IS_CONFIGURED_FOR_USE_IN_FEATURES "Feature element [{0}] is configured for use in feature(s) [{1}]." + 2215: SzConfigurationError, # EAS_ERR_FTYPE_CODE_DOES_NOT_EXIST "Feature type code [{0}] does not exist." + 2216: SzConfigurationError, # EAS_ERR_FTYPE_CODE_ALREADY_EXISTS "Feature type code [{0}] already exists." + 2217: SzConfigurationError, # EAS_ERR_FTYPE_ID_ALREADY_EXISTS "Feature type ID [{0}] already exists." + 2218: SzConfigurationError, # EAS_ERR_FEATURE_FREQUENCY_IS_INVALID "Feature type frequency [{0}] is invalid." + 2219: SzConfigurationError, # EAS_ERR_FEATURE_ELEMENT_LIST_IS_EMPTY "Feature element list is empty." + 2220: SzConfigurationError, # EAS_ERR_STANDARDIZATION_FUNCTION_DOES_NOT_EXIST "Standardization function [{0}] does not exist." + 2221: SzConfigurationError, # EAS_ERR_FUNCTION_USES_BOTH_FTYPE_AND_FELEM_TRIGGER "Function call requested uses both triggering feature type [{0}] and triggering feature element code [{1}]. Cannot use both triggering feature type and triggering feature element code." + 2222: SzConfigurationError, # EAS_ERR_EXPRESSION_FUNCTION_DOES_NOT_EXIST "Expression function [{0}] does not exist." + 2223: SzConfigurationError, # EAS_ERR_EXPRESSION_FUNCTION_FEATURE_ELEMENT_LIST_IS_EMPTY "Expression function feature element list is empty." + 2224: SzConfigurationError, # EAS_ERR_COMPARISON_FUNCTION_DOES_NOT_EXIST "Comparison function [{0}] does not exist." + 2225: SzConfigurationError, # EAS_ERR_COMPARISON_FUNCTION_FEATURE_ELEMENT_LIST_IS_EMPTY "Comparison function feature element list is empty." + 2226: SzConfigurationError, # EAS_ERR_DISTINCT_FUNCTION_DOES_NOT_EXIST "Distinct feature function [{0}] does not exist." + 2227: SzConfigurationError, # EAS_ERR_DISTINCT_FUNCTION_FEATURE_ELEMENT_LIST_IS_EMPTY "Distinct feature function feature element list is empty." + 2228: SzConfigurationError, # EAS_ERR_FELEM_CODE_MUST_BE_UNIQUE_IN_FELEM_LIST "Feature element code [{0}] must be unique in felem list." + 2230: SzConfigurationError, # EAS_ERR_FTYPE_CODE_AND_FELEM_CODE_MUST_BE_UNIQUE_IN_EXPRESSED_FUNCTION_CALL "Feature type [{0}] and feature element [{1}] must be unique in expressed feature function call." + 2231: SzConfigurationError, # EAS_ERR_FTYPE_CODE_AND_FELEM_CODE_IN_EXPRESSED_FUNCTION_CALL_DO_NOT_EXIST_IN_FEATURE "Feature type [{0}] and feature element [{1}] requested for expressed feature function call, but don't exist in feature [{0}]." + 2232: SzConfigurationError, # EAS_ERR_FELEM_CODE_MUST_BE_UNIQUE_IN_COMPARISON_FUNCTION_CALL "Feature element [{0}] must be unique in comparison feature function call." + 2233: SzConfigurationError, # EAS_ERR_FELEM_CODE_IN_COMPARISON_FUNCTION_CALL_DOES_NOT_EXIST_IN_FEATURE "Feature element [{0}] requested for comparison feature function call, but doesn't exist in feature [{1}]." + 2234: SzConfigurationError, # EAS_ERR_FELEM_CODE_MUST_BE_UNIQUE_IN_DISTINCT_FUNCTION_CALL "Feature element [{0}] must be unique in distinct feature function call." + 2235: SzConfigurationError, # EAS_ERR_FELEM_CODE_IN_DISTINCT_FUNCTION_CALL_DOES_NOT_EXIST_IN_FEATURE "Feature element [{0}] requested for distinct feature function call, but doesn't exist in feature [{1}]." + 2236: SzConfigurationError, # EAS_ERR_EXEC_ORDER_IS_NOT_SPECIFIED_FOR_FUNCTION "Exec order not specified for function." + 2237: SzConfigurationError, # EAS_ERR_SFCALL_ID_ALREADY_EXISTS "Standardization function call ID [{0}] already exists." + 2238: SzConfigurationError, # EAS_ERR_EFCALL_ID_ALREADY_EXISTS "Expression function call ID [{0}] already exists." + 2239: SzConfigurationError, # EAS_ERR_CFCALL_ID_ALREADY_EXISTS "Comparison function call ID [{0}] already exists." + 2240: SzConfigurationError, # EAS_ERR_DFCALL_ID_ALREADY_EXISTS "Distinct feature function call ID [{0}] already exists." + 2241: SzConfigurationError, # EAS_ERR_FTYPE_CODE_REQUIRED_BY_SEPARATE_EXPRESSED_FUNCTION_CALL "Feature type [{0}] required for separate expressed feature function call [{1}]." + 2242: SzConfigurationError, # EAS_ERR_SFCALL_ID_DOES_NOT_EXIST "Standardization function call ID [{0}] does not exist." + 2243: SzConfigurationError, # EAS_ERR_EFCALL_ID_DOES_NOT_EXIST "Expression function call ID [{0}] does not exist." + 2244: SzConfigurationError, # EAS_ERR_CFCALL_ID_DOES_NOT_EXIST "Comparison function call ID [{0}] does not exist." + 2245: SzConfigurationError, # EAS_ERR_DFCALL_ID_DOES_NOT_EXIST "Distinct feature function call ID [{0}] does not exist." + 2246: SzConfigurationError, # EAS_ERR_BOM_EXEC_ORDER_ALREADY_EXISTS "BOM exec order value [{0}] already exists." + 2247: SzConfigurationError, # EAS_ERR_COMPARISON_FUNCTION_CALL_DOES_NOT_EXIST_FOR_FEATURE "Comparison function call does not exist for feature [{0}]." + 2248: SzConfigurationError, # EAS_ERR_DISTINCT_FUNCTION_CALL_DOES_NOT_EXIST_FOR_FEATURE "Distinct feature function call does not exist for feature [{0}]." + 2249: SzConfigurationError, # EAS_ERR_CONFLICTING_SPECIFIERS_FOR_FUNCTION_CALL "Conflicting specifiers: Function call ID [{0}] does not match function call ID [{1}] from feature type." + 2250: SzConfigurationError, # EAS_ERR_ATTR_CODE_DOES_NOT_EXIST "Attribute code [{0}] does not exist." + 2251: SzConfigurationError, # EAS_ERR_ATTR_CODE_ALREADY_EXISTS "Attribute code [{0}] already exists." + 2252: SzConfigurationError, # EAS_ERR_ATTR_ID_ALREADY_EXISTS "Attribute ID [{0}] already exists." + 2253: SzConfigurationError, # EAS_ERR_ATTR_CLASS_CODE_DOES_NOT_EXIST "Attribute class code [{0}] does not exist." + 2254: SzConfigurationError, # EAS_ERR_FUNCTION_USES_NEITHER_FTYPE_NOR_FELEM_TRIGGER "Function call requested uses neither triggering feature type [{0}] nor triggering feature element code [{1}]. At least one trigger must be specified." + 2255: SzConfigurationError, # EAS_ERR_FEATURE_CLASS_CODE_DOES_NOT_EXIST "Feature class code [{0}] does not exist." + 2256: SzConfigurationError, # EAS_ERR_RELATIONSHIP_TYPE_CODE_DOES_NOT_EXIST "Relationship type code [{0}] does not exist." + 2257: SzConfigurationError, # EAS_ERR_FELEM_CODE_NOT_IN_FEATURE "Feature element code [{0}] not included in feature[{1}]." + 2258: SzConfigurationError, # EAS_ERR_ER_FRAGMENT_DOES_NOT_EXIST "ER fragment code [{0}] does not exist." + 2259: SzConfigurationError, # EAS_ERR_ER_RULE_DOES_NOT_EXIST "ER rule code [{0}] does not exist." + 2260: SzConfigurationError, # EAS_ERR_ERFRAG_ID_ALREADY_EXISTS "ER fragment ID [{0}] already exists." + 2261: SzConfigurationError, # EAS_ERR_ERRULE_ID_ALREADY_EXISTS "ER rule ID [{0}] already exists." + 2262: SzConfigurationError, # EAS_ERR_ERFRAG_CODE_ALREADY_EXISTS "ER fragment code [{0}] already exists." + 2263: SzConfigurationError, # EAS_ERR_ERRULE_CODE_ALREADY_EXISTS "ER rule code [{0}] already exists." + 2264: SzConfigurationError, # EAS_ERR_ERFRAG_CODE_DOES_NOT_EXIST "ER fragment code [{0}] does not exist." + 2266: SzConfigurationError, # EAS_ERR_ERFRAG_CODE_MUST_BE_UNIQUE_IN_DEPENDENCY_LIST "ER fragment code [{0}] must be unique in dependency list." + 2267: SzConfigurationError, # EAS_ERR_SECTION_NAME_ALREADY_EXISTS "Section name [{0}] already exists." + 2268: SzConfigurationError, # EAS_ERR_SECTION_NAME_DOES_NOT_EXIST "Section name [{0}] does not exist." + 2269: SzConfigurationError, # EAS_ERR_SECTION_FIELD_NAME_ALREADY_EXISTS "Section field name [{0}] already exists." + 2270: SzConfigurationError, # EAS_ERR_SFUNC_ID_ALREADY_EXISTS "Feature standardization function ID [{0}] already exists." + 2271: SzConfigurationError, # EAS_ERR_SFUNC_CODE_ALREADY_EXISTS "Feature standardization function code [{0}] already exists." + 2272: SzConfigurationError, # EAS_ERR_EFUNC_ID_ALREADY_EXISTS "Feature expression function ID [{0}] already exists." + 2273: SzConfigurationError, # EAS_ERR_EFUNC_CODE_ALREADY_EXISTS "Feature expression function code [{0}] already exists." + 2274: SzConfigurationError, # EAS_ERR_CFUNC_ID_ALREADY_EXISTS "Feature comparison function ID [{0}] already exists." + 2275: SzConfigurationError, # EAS_ERR_CFUNC_CODE_ALREADY_EXISTS "Feature comparison function code [{0}] already exists." + 2276: SzConfigurationError, # EAS_ERR_DFUNC_ID_ALREADY_EXISTS "Feature distinct function ID [{0}] already exists." + 2277: SzConfigurationError, # EAS_ERR_DFUNC_CODE_ALREADY_EXISTS "Feature distinct function code [{0}] already exists." + 2278: SzConfigurationError, # EAS_ERR_COMPATIBILITY_VERSION_NOT_FOUND_IN_CONFIG "Compatibility version not found in document." + 2279: SzConfigurationError, # EAS_ERR_CFRTN_ID_ALREADY_EXISTS "Feature comparison function return ID [{0}] already exists." + 2280: SzConfigurationError, # EAS_ERR_CFUNC_CODE_DOES_NOT_EXIST "Feature comparison function code [{0}] does not exist." + 2281: SzConfigurationError, # EAS_ERR_CFRTN_VALUE_ALREADY_EXISTS "Feature comparison function return value [{0}] already exists for comparison function [{1}] ftype [{2}]." + 2282: SzConfigurationError, # EAS_ERR_CFUNC_EXEC_ORDER_ALREADY_EXISTS "Feature comparison function exec order value [{0}] already exists for comparison function [{1}] ftype [{2}]." + 2283: SzConfigurationError, # EAS_ERR_EFUNC_CODE_DOES_NOT_EXIST "Feature expression function code [{0}] does not exist." + 2285: SzError, # EAS_ERR_INVALID_FORMAT_FOR_ENTITIES "Invalid format for ENTITIES." + 2286: SzError, # EAS_ERR_NO_ENTITY_ID_FOUND_FOR_ENTITY "No entity ID found for entity." + 2287: SzError, # EAS_ERR_NO_DATA_SOURCE_FOUND "No data source found." + 2288: SzError, # EAS_ERR_NO_RECORD_ID_FOUND "No record ID found." + 2289: SzConfigurationError, # EAS_ERR_INVALID_FEATURE_CLASS_FOR_FEATURE_TYPE "Invalid feature class [{0}] for feature type [{1}]." + 2290: SzConfigurationError, # EAS_ERR_FRAGMENT_IS_CONFIGURED_FOR_USE_IN_RULES "Rule fragment [{0}] is configured for use in rules(s) [{1}]." + 2291: SzConfigurationError, # EAS_ERR_FRAGMENT_IS_CONFIGURED_FOR_USE_IN_FRAGMENT "Rule fragment [{0}] is configured for use in fragments(s) [{1}]." + 2292: SzError, # EAS_ERR_CANT_RETRIEVE_OBS_FEATURE_DATA_FOR_OBS_ENT "Could not retrieve observed feature data for observed entity [{0}]." + 2293: SzError, # EAS_ERR_NO_RECORDS_SPECIFIED "No records specified." + 2294: SzError, # EAS_ERR_DATA_SOURCE_ID_DOES_NOT_EXIST "Data source ID [{0}] does not exist." + 7209: SzConfigurationError, # EAS_ERR_DB_BAD_BACKEND_TYPE "Invalid [SQL] Backend Parameter. Valid values are SQL or HYBRID" + 7211: SzConfigurationError, # EAS_ERR_DB_BAD_CLUSTER_SIZE "Cluster [{0}] is configured with an invalid size. Size must be equal to 1." + 7212: SzConfigurationError, # EAS_ERR_DB_BAD_CLUSTER_NODE "Cluster [{0}] Node [{1}] is not configured." + 7216: SzConfigurationError, # EAS_ERR_DB_BAD_CLUSTER_DEFINITION "Cluster [{0}] is not properly configured" + 7217: SzConfigurationError, # EAS_ERR_DB_CONFLICTING_DEFAULT_SHARD_CONFIG "Cannot specify both default backend database and default backend cluster" + 7218: SzConfigurationError, # EAS_ERR_DB_CLUSTER_DOES_NOT_EXIST "Cluster [{0}] does not exist" + 7220: SzConfigurationError, # EAS_ERR_NO_CONFIG_REGISTERED_IN_DATASTORE "No engine configuration registered in datastore (see https://senzing.zendesk.com/hc/en-us/articles/360036587313)." + 7221: SzConfigurationError, # EAS_ERR_NO_CONFIG_REGISTERED_FOR_DATA_ID "No engine configuration registered with data ID [{0}]." + 7222: SzError, # EAS_ERR_FAILED_TO_SET_SYS_VAR_IN_DATASTORE "Could not set system variable value in database for Group[{0}],Code[{1}],Value[{2}]." + 7223: SzConfigurationError, # EAS_ERR_INVALID_SCHEMA_VERSION_IN_DATASTORE "Invalid version number for datastore schema [version '{0}']." + 7224: SzConfigurationError, # EAS_ERR_INVALID_SCHEMA_VERSION_IN_ENGINE "Invalid version number for engine schema [version '{0}']." + 7226: SzConfigurationError, # EAS_ERR_INCOMPATIBLE_DATASTORE_SCHEMA_VERSION "Incompatible datastore schema version: [Engine version '{0}'. Datastore version '{1}' is installed, but must be between '{2}' and '{3}'.]" + 7227: SzConfigurationError, # EAS_ERR_CONFLICTING_SCHEMA_VERSIONS_IN_DATASTORE "Conflicting version numbers for datastore schema [{0}]." + 7228: SzConfigurationError, # EAS_ERR_INVALID_SCHEMA_VERSION "Invalid schema version number [version '{0}']." + 7230: SzConfigurationError, # EAS_ERR_ENGINE_CONFIGURATION_FILE_NOT_FOUND "Engine configuration file not found [{0}]." + 7232: SzConfigurationError, # EAS_ERR_ENGINE_CONFIGURATION_NOT_FOUND "No engine configuration found." + 7233: SzConfigurationError, # EAS_ERR_DATASTORE_ENCRYPTION_SIGNATURE_IS_INCOMPATIBLE "Datastore encryption signature is not compatible." + 7234: SzConfigurationError, # EAS_ERR_FAILED_TO_GET_ENCRYPTION_SIGNATURE "Failed to get encryption signature: '{0}'" + 7235: SzConfigurationError, # EAS_ERR_FTYPE_CONFIGURED_AS_REL_BUT_NO_RTYPE "FTYPE_CODE[{0}] IS CONFIGURED AS A RELATIONSHIP FEATURE TYPE BUT RTYPE_ID IS NOT SET." + 7236: SzConfigurationError, # EAS_ERR_DUPLICATE_BEHAVIOR_OVERRIDE_KEY_IN_CFG_FBOVR "Duplicate behavior override keys in CFG_FBOVR -- FTYPE_ID[{0}], UTYPE_CODE[{1}] referenced in CFG_FBOVR." + 7237: SzConfigurationError, # EAS_ERR_UNKNOWN_FTYPE_IN_TABLE "Unknown FTYPE_ID[{0}] referenced in {1}." + 7238: SzError, # EAS_ERR_DATASTORE_ENCRYPTION_CONFIGURATION_DOES_NOT_MATCH_DATASTORE "Datastore encryption configuration does not match data store: '{0}'" + 7239: SzConfigurationError, # EAS_ERR_INVALID_GENERIC_THRESHOLD_CANDIDATE_CAP "Invalid generic threshold {0} cap [{1}] for [GPLAN_ID[{2}], BEHAVIOR[{3}], FTYPE_ID[{4}]]." + 7240: SzConfigurationError, # EAS_ERR_INCORRECT_BEHAVIOR_REFERENCED "Incorrect BEHAVIOR[{0}] referenced in CFG_GENERIC_THRESHOLD for [GPLAN_ID[{1}], FTYPE_ID[{2}]]. FType configured for behavior [{3}]" + 7241: SzConfigurationError, # EAS_ERR_UNKNOWN_GPLAN_IN_TABLE "Unknown GPLAN_ID[{0}] referenced in {1}." + 7242: SzConfigurationError, # EAS_ERR_MULTIPLE_GENERIC_THRESHOLD_DEFINITIONS "Multiple Generic Threshold definitions for [GPLAN_ID[{0}], BEHAVIOR[{1}], FTYPE_ID[{2}]]." + 7243: SzConfigurationError, # EAS_ERR_ER_FRAGMENT_HAS_UNDEFINED_DEPENDENT_FRAGMENTS "ER Fragment [{0}] configured with undefined dependent fragments. Fragment [{1}] undefined." + 7244: SzConfigurationError, # EAS_ERR_ER_RULE_FRAGMENT_LACKS_REQUIRED_FRAGMENT "ER Rule Fragment configuration lacks the required {0} fragment." + 7245: SzConfigurationError, # EAS_ERR_CURRENT_CONFIG_REGISTERED_DOES_NOT_MATCH_DATA_ID "Current configuration ID does not match specified data ID [{0}]." + 7246: SzConfigurationError, # EAS_ERR_INVALID_MAXIMUM_DATASTORE_SCHEMA_VERSION "Invalid maximum datastore version number for engine schema [version '{0}']." + 7247: SzConfigurationError, # EAS_ERR_INVALID_MINIMUM_DATASTORE_SCHEMA_VERSION "Invalid minimum datastore version number for engine schema [version '{0}']." + 7303: SzBadInputError, # EAS_ERR_MANDATORY_SEGMENT_WITH_MISSING_REQUIREMENTS "Mandatory segment with missing requirements:" + 7305: SzBadInputError, # EAS_ERR_MISSING_JSON_ROOT_ELEMENT "No root element name in json TEMPLATE" + 7313: SzBadInputError, # EAS_ERR_REQUIRED_ELEMENT_WITH_EMPTY_FIELD "A non-empty value for [{0}] must be specified." + 7314: SzBadInputError, # EAS_ERR_REQUIRED_ELEMENT_NOT_FOUND "A value for [{0}] must be specified." + 7317: SzConfigurationError, # EAS_ERR_FAILED_TO_OPEN_FILE "Failed to open file: {0}" + 7344: SzConfigurationError, # EAS_ERR_UNKNOWN_MAPPING_DIRECTIVE "Invalid mapping directive [{0}] for attribute [{1}]." + 7426: SzBadInputError, # EAS_ERR_XLITERATOR_FAILED "Transliteration failed" + 7511: SzError, # EAS_ERR_ABORT_ER_AND_RETRY "Detected change in candidate entity[{0}]. Restarting ER evaluation." + 8000: SzBadInputError, # EAS_ERR_GNRNP "GNR NameParser Failure" + 8410: SzError, # EAS_ERR_UNINITIALIZED_AMBIGUOUS_FEATURE "Cannot use uninitialized ambiguous feature." + 8501: SzConfigurationError, # EAS_ERR_SALT_DIGEST_ALGORITHM_NOT_AVAILABLE "Failed to get {0} digest algorithm from ICC." + 8502: SzError, # EAS_ERR_SALT_DIGEST_CONTEXT_CREATE_FAILED "Failed to create a digest context." + 8503: SzError, # EAS_ERR_SALT_DIGEST_CONTEXT_INIT_FAILED "Failed {0} to initialise a digest context." + 8504: SzError, # EAS_ERR_SALT_DIGEST_FAILED "Failed {0} to digest block {1}." + 8505: SzError, # EAS_ERR_SALT_DIGEST_FINAL_FAILED "Failed {0} to complete digest." + 8508: SzError, # EAS_ERR_SALT_DIGEST_UNKNOWN_EXCEPTION "Unrecognized exception thrown generating digest." + 8509: SzError, # EAS_ERR_SALT_DIGEST_ALGORITHM_REQUIRED "Cannot generate a digest without a valid algorithm." + 8514: SzError, # EAS_ERR_SALT_RANDOM_FAILED "Failed {0} to get random content" + 8516: SzConfigurationError, # EAS_ERR_SALT_MUST_BE_SIZE "A salt value must be {0} bytes long but the provided one is {1} bytes." + 8517: SzConfigurationError, # EAS_ERR_SALT_DOES_NOT_MATCH_CHECKSUM "The salt value does not match the recorded checksum." + 8520: SzError, # EAS_ERR_SALT_G2SS_INIT_FAILED "Secure Store initialization failed." + 8521: SzError, # EAS_ERR_SALT_G2SS_TOKEN_MUST_BE_INIT "Hashing with a named salt requires the Secure Store to be initialised." + 8522: SzConfigurationError, # EAS_ERR_SALT_G2SS_SOPIN_NOT_VALID "The Security Officer (SO) PIN is not correct." + 8524: SzError, # EAS_ERR_SALT_G2SS_INIT_UNKNOWN_EXCEPTION "Secure Store initialization failed with an unrecognised exception" + 8525: SzConfigurationError, # EAS_ERR_SALT_G2SS_REQUIRED_FOR_LOAD "Secure Store is required to load salt" + 8526: SzConfigurationError, # EAS_ERR_SALT_G2SS_REQUIRED_FOR_GENERATE "Secure Store is required to generate salt" + 8527: SzConfigurationError, # EAS_ERR_SALT_G2SS_REQUIRED_FOR_IMPORT "Secure Store is required to import salt" + 8528: SzConfigurationError, # EAS_ERR_SALT_G2SS_REQUIRED_FOR_EXPORT "Secure Store is required to export salt" + 8529: SzConfigurationError, # EAS_ERR_SALT_G2SS_REQUIRED_FOR_DELETE "Secure Store is required to delete salt" + 8530: SzError, # EAS_ERR_SALT_CANNOT_OVERWRITE "You cannot overwrite an existing salt called {0}" + 8536: SzConfigurationError, # EAS_ERR_SALT_G2SS_REQUIRED_FOR_LEGACY "Secure Store is required to add a legacy salt" + 8538: SzConfigurationError, # EAS_ERR_SALT_G2SS_REQUIRED_FOR_METHOD "Secure Store is required to change hashing method" + 8539: SzError, # EAS_ERR_SALT_G2SS_ERROR_CHANGING_METHOD "Secure Store error changing hashing method" + 8540: SzConfigurationError, # EAS_ERR_SALT_WRONG_SIZE "The object called {0} is not a salt" + 8541: SzError, # EAS_ERR_SALT_BASE64_DECODE_ERROR "Base64 decoding error in salt {0} at character {1}" + 8542: SzError, # EAS_ERR_SALT_UNINITIALISED "Must load a salt before using it." + 8543: SzConfigurationError, # EAS_ERR_SALT_NOT_FOUND "There is no salt called {0} in the Secure Store." + 8544: SzConfigurationError, # EAS_ERR_SALT_PASSWORD_NOT_STRONG_ENOUGH "The password must be stronger: {0}" + 8545: SzConfigurationError, # EAS_ERR_SALT_ADMIN_NAME_REQUIRED "Specify -name and the name to use for the salt" + 8556: SzConfigurationError, # EAS_ERR_SALT_ADMIN_METHOD_NOT_RECOGNISED "Hashing method {0} not supported." + 8557: SzConfigurationError, # EAS_ERR_SALT_METHOD_DOES_NOT_MATCH "The hashing method in the configuration ({1}) does not match the method ({2}) of the salt {0}" + 8593: SzError, # EAS_ERR_SALT_HMAC_CONTEXT_INIT_FAILED "Failed {0} to initialise an HMAC context." + 8594: SzError, # EAS_ERR_SALT_HMAC_FAILED "Failed {0} to HMAC block {1}." + 8595: SzError, # EAS_ERR_SALT_HMAC_FINAL_FAILED "Failed {0} to complete HMAC." + 8598: SzError, # EAS_ERR_SALT_HMAC_UNKNOWN_EXCEPTION "Unrecognized exception thrown generating HMAC." + 8599: SzConfigurationError, # EAS_ERR_SALT_UNKNOWN_HASHING_METHOD "Unrecognized hashing method ({0}) requested." + 8601: SzConfigurationError, # EAS_ERR_HASHER_REQUIRES_SECURE_STORE "Using a named salt requires the Secure Store configured and running" + 8602: SzConfigurationError, # EAS_ERR_HASHER_CHECKSUM_DOES_NOT_MATCH "The hashing checksum configured ({1}) does not match the checksum ({2}) of the salt named {0}" + 8603: SzError, # EAS_ERR_HASHER_UNABLE_TO_RECORD_SALT "Unable to record the configured salt" + 8604: SzConfigurationError, # EAS_ERR_HASHER_REQUIRES_FUNCTION "Using hashing requires a configured hashing function" + 8605: SzConfigurationError, # EAS_ERR_HASHER_EPHEMERAL_OR_NAMED_SALT "Specify either a named salt or an ephemeral one. Can not have both" + 8606: SzConfigurationError, # EAS_ERR_HASHER_SALT_REQUIRED "Hashing requires a salt to be configured." + 8607: SzConfigurationError, # EAS_ERR_HASHER_INVALID_ARGS "Invalid arguments to hashing function. Either a parameter wasn't provided or a buffer was too small: location={0}, dataPtr={1}, dataLength={2}, outputPtr={3}, outputLength={4}, output={5}" + 8608: SzConfigurationError, # EAS_ERR_NO_SALT_VALUE_CONFIGURED "No salt value is configured. A salt value must be configured if you wish to export the token library." + 8701: SzConfigurationError, # EAS_ERR_PARAMETER_NOT_READABLE "The parameter store does not support a read interface" + 8702: SzConfigurationError, # EAS_ERR_PARAMETER_NOT_WRITABLE "The parameter store does not support a write interface" + 9000: SzLicenseError, # EAS_LIMIT_MAX_OBS_ENT "LIMIT: Maximum number of records ingested: {0}" + 9107: SzConfigurationError, # EAS_ERR_CANT_GET_PARAMETER_FROM_THE_STORE "Cannot get parameter [{0}] from parameter store" + 9110: SzConfigurationError, # EAS_ERR_INSUFFICIENT_CONFIG "Insufficient configuration for the {0} table!" + 9111: SzConfigurationError, # EAS_ERR_PARSE_FRAGMENT "ERROR parsing FragmentID[{0}] FragmentName[{1}] : [{2}] is an invalid RuleID dependency" + 9112: SzConfigurationError, # EAS_ERR_FAILED_TO_OPEN_INI_FILE_FOR_WRITING "Failed to open ini file for writing [{0}]" + 9113: SzConfigurationError, # EAS_ERR_FAILED_TO_OPEN_INI_FILE_FOR_READING "Failed to open ini file for reading [{0}]" + 9115: SzBadInputError, # EAS_ERR_INPUT_NOT_STANDARDIZED "Cannot process Observation that has not been standardized" + 9116: SzConfigurationError, # EAS_ERR_CONFIG_TABLE_NOT_FOUND "CONFIG information for {0} not found!" + 9117: SzConfigurationError, # EAS_ERR_CONFIG_TABLE_COLUMN_NOT_FOUND "CONFIG information for {0} not found in {1}!" + 9118: SzConfigurationError, # EAS_ERR_CONFIG_TABLE_COLUMN_INDEX_NOT_FOUND "Invalid column index {0} queried from {1} container!" + 9119: SzConfigurationError, # EAS_ERR_CONFIG_TABLE_COLUMN_NAME_NOT_FOUND "Invalid column name {0} queried from {1} container!" + 9120: SzConfigurationError, # EAS_ERR_CONFIG_TABLE_MALFORMED "CONFIG information for {0} is malformed!" + 9210: SzConfigurationError, # EAS_ERR_DIGEST_CONTEXT_INIT_FAILED "Unable to initialize Digest Context." + 9220: SzConfigurationError, # EAS_ERR_FTYPE_CANNOT_BE_HASHED "FType configured to be hashed, but cannot be scored. FTYPE_ID[{0}] FTYPE_CODE[{1}]" + 9222: SzConfigurationError, # EAS_ERR_FTYPE_CONFIGURED_TO_BE_HASHED_MISSING_SALT "A Feature Type is marked for hashing, but a valid salt value was not found. FTYPE_ID[{0}] FTYPE_CODE[{1}]" + 9224: SzConfigurationError, # EAS_ERR_FTYPE_CONFIGURED_TO_BE_HASHED "FType configured to be hashed, but no hashable data found. FTYPE_ID[{0}] FTYPE_CODE[{1}]" + 9228: SzConfigurationError, # EAS_ERR_UNEXPECTED_SALT_CHECKUM_LIST "The SALT checksum on the Observation does not match the EXPECTED SALT checksum: EXPECTED=[{0}] Observation=[{1}]" + 9240: SzConfigurationError, # EAS_ERR_CIPHER_CONTEXT_INIT_FAILED "Unable to initialize an ICC Context." + 9241: SzConfigurationError, # EAS_ERR_CIPHER_OP_FAILED "Unable to perform a required ICC operation." + 9250: SzConfigurationError, # EAS_ERR_G2SS_INVALID_LIB "Invalid ({1}) Secure Store plug-in library: {0}" + 9251: SzConfigurationError, # EAS_ERR_G2SS_INVALID_URL "Invalid Secure Store URL: {0}" + 9252: SzConfigurationError, # EAS_ERR_G2SS_INVALID_PIN "Invalid Secure Store credential specification: {0}" + 9253: SzConfigurationError, # EAS_ERR_G2SS_TOKEN_INIT_FAILED "Secure Store token initialization failed: {0}." + 9254: SzConfigurationError, # EAS_ERR_G2SS_TOKEN_UNINITIALISED "Cannot open a Secure Store session when the token is uninitialized." + 9255: SzConfigurationError, # EAS_ERR_G2SS_USER_PIN_UNINITIALISED "Secure Store credential is uninitialized." + 9256: SzConfigurationError, # EAS_ERR_G2SS_SESSION_OPEN "Cannot open a Secure Store session when one is already open." + 9257: SzConfigurationError, # EAS_ERR_G2SS_NO_SESSION "Cannot use Secure Store without a session." + 9258: SzConfigurationError, # EAS_ERR_G2SS_SESSION_OPEN_FAILED "Secure Store session could not be opened: {0}." + 9259: SzConfigurationError, # EAS_ERR_G2SS_ADMIN_LOGIN_FAILED "Secure Store admin login failed: {0}." + 9260: SzConfigurationError, # EAS_ERR_G2SS_USER_LOGIN_FAILED "Secure Store user login failed: {0}." + 9261: SzConfigurationError, # EAS_ERR_G2SS_PKCS11_ERROR "Secure Store function failed: {0}" + 9264: SzConfigurationError, # EAS_ERR_G2SS_LOGOUT_FAILED "Secure Store logout failed: {0}." + 9265: SzConfigurationError, # EAS_ERR_G2SS_NEED_RW_SESSION "Secure Store session must be read/write." + 9266: SzConfigurationError, # EAS_ERR_G2SS_UNABLE_TO_VERIFY_KEY "Secure Store key does not meet requirements." + 9267: SzError, # EAS_ERR_G2SS_UNABLE_TO_CREATE_KEY "Secure Store key creation failed." + 9268: SzError, # EAS_ERR_G2SS_UNABLE_TO_CHANGE_PIN "Secure Store password change failed: {0}." + 9269: SzConfigurationError, # EAS_ERR_G2SS_INVALID_OLD_CREDENTIAL "Secure Store old credential is invalid." + 9270: SzConfigurationError, # EAS_ERR_G2SS_INVALID_NEW_CREDENTIAL "Secure Store new credential is invalid." + 9271: SzError, # EAS_ERR_G2SS_OUT_OF_MEMORY "Secure Store out of memory." + 9272: SzError, # EAS_ERR_G2SS_FIND_INIT_FAILED "Secure Store object locating failed: {0}." + 9273: SzError, # EAS_ERR_G2SS_FIND_FAILED "Secure Store object find failed: {0}." + 9274: SzError, # EAS_ERR_G2SS_CRYPTO_SETUP_FAILED "Secure Store setup of encryption failed: {0}." + 9275: SzError, # EAS_ERR_G2SS_ENCRYPT_START_FAILED "Secure Store unable to start encryption: {0}." + 9276: SzError, # EAS_ERR_G2SS_ENCRYPT_SIZE_FAILED "Secure Store unable to get the size of encrypted data: {0}." + 9277: SzError, # EAS_ERR_G2SS_ENCRYPT_FAILED "Secure Store encryption failed: {0}." + 9278: SzError, # EAS_ERR_G2SS_DECRYPT_START_FAILED "Secure Store unable to start decryption: {0}." + 9279: SzError, # EAS_ERR_G2SS_DECRYPT_FAILED "Secure Store decryption failed: {0}." + 9280: SzError, # EAS_ERR_G2SS_OBJECT_SAVE_FAILED "Secure Store unable to save object: {0}." + 9281: SzError, # EAS_ERR_G2SS_OBJECT_DELETE_FAILED "Secure Store unable to delete object: {0}." + 9282: SzError, # EAS_ERR_G2SS_OBJECT_CHANGE_FAILED "Secure Store unable to modify object: {0}." + 9283: SzError, # EAS_ERR_G2SS_UNINITIALISED "Secure Store has not been initialized" + 9284: SzConfigurationError, # EAS_ERR_G2SS_INVALID_SLOT_ID "Can not obtain info on specified slot. Possibly invalid slot ID specified in Secure Store URL: {0}" + 9285: SzConfigurationError, # EAS_ERR_G2SS_NO_TOKEN_IN_SLOT "No security token present in slot specified by Secure Store URL: slot ID = {0}" + 9286: SzConfigurationError, # EAS_ERR_G2SS_TOKEN_NOT_FOUND "Can not obtain info for security token. Possibly invalid token label and/or slot ID specified in Secure Store URL: {0}" + 9287: SzError, # EAS_ERR_G2SS_TOKEN_IMPL_ERROR "An internal error occurred in the security token implementation library: Return Code = {0}" + 9288: SzError, # EAS_ERR_G2SS_USER_PIN_PROMPT_FAILED "Was unable to prompt user for security token authentication." + 9289: SzError, # EAS_ERR_G2SS_LABEL_CHANGED_SINCE_CONFIG_INIT "Secure Store has been reconfigured since loading." + 9290: SzError, # EAS_ERR_G2SS_OBJECT_NOT_FOUND "Secure Store does not have an object called {0}." + 9292: SzConfigurationError, # EAS_ERR_G2SS_NO_PASSWORD "No password supplied" + 9293: SzConfigurationError, # EAS_ERR_G2SS_NO_SEC_STORE_PREFIX "Secure Store expects a different format (starting with {0}) when a password is supplied" + 9295: SzConfigurationError, # EAS_ERR_G2SS_NO_DATA_OBJECTS "There are no Secure Store objects stored on the token" + 9296: SzConfigurationError, # EAS_ERR_G2SS_SEC_STORE_ARCHIVE_BAD "The exported archive appears to be corrupted around object {0}" + 9297: SzConfigurationError, # EAS_ERR_G2SS_FILE_NOT_FOUND "Secure Store failed to open {0}" + 9298: SzConfigurationError, # EAS_ERR_G2SS_FILE_CONTENTS_BAD "Secure Store contents of {0} not usable." + 9299: SzError, # EAS_ERR_G2SS_CLASS_NOT_INIT "Secure Store internal error." + 9300: SzConfigurationError, # EAS_ERR_G2SS_PASSWORD_CHECK_ERROR "Secure Store internal error ({0}) checking password." + 9301: SzConfigurationError, # EAS_ERR_MISSING_SEQUENCE_ENTRY "Missing Sequence Entry[{0}] in the SYS_SEQUENCE table!" + 9305: SzError, # EAS_ERR_SEQUENCE_RETRIES_FAILED "Retries failed to retrieve Sequence Entry[{0}] in the SYS_SEQUENCE table! This may mean the CACHE_SIZE is too small." + 9308: SzConfigurationError, # EAS_ERR_MISSING_STATUS_ENTRY "Could not retrieve status entry[{0}] in the SYS_STATUS table!" + 9309: SzConfigurationError, # EAS_ERR_SEQUENCE_HAS_BEEN_RESET "Sequence entry[{0}] has been reset." + 9310: SzConfigurationError, # EAS_ERR_INVALID_STATUS_ENTRY_VALUE "Invalid value for status entry[{0}] in the SYS_STATUS table!" + 9311: SzError, # EAS_ERR_COULD_NOT_RECORD_USAGE_TYPE "Could not record usage type [{0}] in the LIB_UTYPE table!" + 9406: SzError, # EAS_ERR_G2SS_SESSION_MUST_NOT_BE_OPEN "Secure Store cannot fetch a value with sync if a session is already open." + 9408: SzConfigurationError, # EAS_ERR_G2SS_PASSWORD_INADEQUATE "The provided password is not strong enough: {0}" + 9409: SzConfigurationError, # EAS_ERR_G2SS_FUNCTION_LIST_NOT_SET "The security token interface is not yet set" + 9410: SzError, # EAS_ERR_G2SS_PKCS_INIT_FAILED "Initializing token driver failed {0}" + 9411: SzError, # EAS_ERR_G2SS_PKCS_FINAL_FAILED "Finalizing token driver failed {0}" + 9413: SzConfigurationError, # EAS_ERR_G2SS_INCORRECT_PASSWORD "The export file password appears to be incorrect." + 9414: SzBadInputError, # EAS_ERR_STRING_IS_INVALID_UTF8 "Invalid data string. Data must be in UTF-8." + 9500: SzConfigurationError, # EAS_ERR_TOKEN_LIBRARY_CHECKSUM_MISMATCH "Cannot load token library. The checksum does not match the configuration of this node. Found: [{0}] Expected: [{1}]" + 9501: SzError, # EAS_TOKEN_LIBRARY_ALREADY_HASHED "Cannot hash token library. The Token Library contains previous hashed data" + 9701: SzError, # EAS_ERR_CANT_RETRIEVE_INDEX_FROM_MEMORY_ROW "Cannot retrieve index[{0}] from memory row of key[{1}], out of range!" + 9802: SzConfigurationError, # EAS_ERR_INBOUND_OBS_CONFIG_CHECKSUM_MISMATCH "Configuration checksum on inbound observation [{0}] does not match this nodes configuration checksum [{1}]. Cannot process." + 9803: SzConfigurationError, # EAS_ERR_CALC_CONFIGCHKSUM_AND_PARAMSTORE_CONFIGCHKSUM_DONT_MATCH "The calculated configuration checksum [{0}] does not match the CONFIGURATION_CHECKSUM value in the parameter store [{1}]." + 30011: SzError, # EAS_ERR_DELETE_WITH_RESOLVE_ONLY "Cannot delete an entity with type RESOLVE_ONLY" + 30101: SzError, # EAS_ERR_INVALID_SESSION_HANDLE "Invalid Session Handle [{0}]" + 30102: SzError, # EAS_ERR_INVALID_REPORT_HANDLE "Invalid Report Handle [{0}]" + 30103: SzError, # EAS_ERR_INVALID_EXPORT_HANDLE "Invalid Export Handle [{0}]" + 30110: SzError, # EAS_ERR_RESPONSE_MESSAGE_SIZE_LARGER_THAN_BUFFER_SIZE "Response message size [{0}] is larger than buffer size [{1}]" + 30111: SzError, # EAS_ERR_RESPONSE_RESIZE_FUNCTION_IS_NOT_PROVIDED "Resize function is not provided" + 30112: SzError, # EAS_ERR_RESPONSE_RESIZE_FUNCTION_GAVE_INVALID_RESULT "Resize function returned an invalid result" + 30121: SzBadInputError, # EAS_ERR_JSON_PARSING_FAILURE "JSON Parsing Failure [code={0},offset={1}]" + 30122: SzBadInputError, # EAS_ERR_JSON_PARSING_FAILURE_MUST_BE_OBJECT_OR_ARRAY "JSON Parsing Failure. JSON must be object or array." + 30123: SzBadInputError, # EAS_ERR_JSON_PARSING_FAILURE_OBJECT_HAS_DUPLICATE_KEYS "Json object has duplicate keys." + 30131: SzBadInputError, # EAS_ERR_UNKNOWN_COLUMN_REQUESTED_FOR_CSV_EXPORT "Invalid column [{0}] requested for CSV export." +} +# fmt: on + + +# ----------------------------------------------------------------------------- +# ErrorBuffer class +# ----------------------------------------------------------------------------- + + +class ErrorBuffer(threading.local): + """Buffer to call C""" + + # pylint: disable=R0903 + + def __init__(self) -> None: + super().__init__() + self.string_buffer = create_string_buffer(65535) + self.string_buffer_size = sizeof(self.string_buffer) + + +ERROR_BUFFER = ErrorBuffer() +ERROR_BUFFER_TYPE = c_char * 65535 + + +# ----------------------------------------------------------------------------- +# Helper functions to create a senzing-specific Exception +# ----------------------------------------------------------------------------- + + +def get_location() -> str: + """ + Determine caller. + + :meta private: + """ + stack = traceback.format_stack() + return stack[0].replace("\n ", "", 1).rstrip() + + +def get_message_level(error_id: int) -> str: + """ + Determine the severity of the error. + + :meta private: + """ + error_levels = { + 6000: "PANIC", + 5000: "FATAL", + 4000: "ERROR", + 3000: "WARN", + 2000: "INFO", + 1000: "DEBUG", + 0: "TRACE", + } + for error_level, error_message in error_levels.items(): + if error_id > error_level: + return error_message + return "PANIC" + + +def get_message_text(error_id: int, id_messages: Dict[int, str], *args: Any) -> str: + """ + Format the message text from a template and variables. + + :meta private: + """ + return id_messages.get(error_id, f"No message for index {error_id}.").format(*args) + + +def get_senzing_error_code(error_text: str) -> int: + """ + Given an exception string, find the exception code. + + :meta private: + """ + if len(error_text) == 0: + return 0 + exception_message_splits = error_text.split("|", 1) + try: + result = int(exception_message_splits[0].strip().rstrip("EIW")) + except ValueError: + print("ERROR: Could not parse error text '{error_text}'") + result = 9999 + return result + + +def get_senzing_error_text( + get_last_exception: Callable[[ERROR_BUFFER_TYPE, int], str], # type: ignore + clear_last_exception: Callable[[], None], +) -> str: + """ + Get the last exception from the Senzing engine. + + :meta private: + """ + get_last_exception( + ERROR_BUFFER.string_buffer, + sizeof(ERROR_BUFFER.string_buffer), + ) + clear_last_exception() + result = ERROR_BUFFER.string_buffer.value.decode() + return result + + +def new_szexception( + get_last_exception: Callable[[ERROR_BUFFER_TYPE, int], str], # type: ignore + clear_last_exception: Callable[[], None], + product_id: str, + error_id: int, + id_messages: Dict[int, str], + *args: Any, +) -> Exception: + """ + Generate a new Senzing Exception based on the error_id. + + :meta private: + """ + senzing_error_text = get_senzing_error_text( + get_last_exception, clear_last_exception + ) + senzing_error_code = get_senzing_error_code(senzing_error_text) + message = { + "time": datetime.datetime.utcnow().isoformat("T"), + "text": get_message_text(error_id, id_messages, *args), + "level": get_message_level(error_id), + "id": f"senzing-{product_id}{error_id:4d}", + "location": get_location(), + "errorCode": senzing_error_code, + "errorText": senzing_error_text, + "details": args, + } + senzing_error_class = EXCEPTION_MAP.get(senzing_error_code, SzError) + return senzing_error_class(json.dumps(message)) diff --git a/src/senzing_abstract/g2hasher_abstract.py b/src/senzing_abstract/szhasher_abstract.py similarity index 82% rename from src/senzing_abstract/g2hasher_abstract.py rename to src/senzing_abstract/szhasher_abstract.py index 487cc3f..21c962c 100644 --- a/src/senzing_abstract/g2hasher_abstract.py +++ b/src/senzing_abstract/szhasher_abstract.py @@ -1,7 +1,7 @@ #! /usr/bin/env python3 """ -TODO: g2hasher_abstract.py +TODO: szhasher_abstract.py """ from abc import ABC, abstractmethod @@ -9,26 +9,26 @@ # Metadata -__all__ = ["G2HasherAbstract"] +__all__ = ["SzHasherAbstract"] __version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ -__date__ = "2023-12-14" -__updated__ = "2023-12-14" +__date__ = "2023-10-30" +__updated__ = "2023-10-30" # ----------------------------------------------------------------------------- -# G2HasherAbstract +# SzHasherAbstract # ----------------------------------------------------------------------------- -class G2HasherAbstract(ABC): +class SzHasherAbstract(ABC): """ - G2 hasher module access library + SzHasher module access library """ # ------------------------------------------------------------------------- # Messages # ------------------------------------------------------------------------- - PREFIX = "g2hasher." + PREFIX = "szhasher." ID_MESSAGES = {0: ""} # ------------------------------------------------------------------------- @@ -45,16 +45,16 @@ def export_token_library(self, *args: Any, **kwargs: Any) -> str: @abstractmethod def init( - self, module_name: str, ini_params: str, verbose_logging: int = 0, **kwargs: Any + self, instance_name: str, settings: str, verbose_logging: int = 0, **kwargs: Any ) -> None: """TODO: document""" @abstractmethod def init_with_config_id( self, - module_name: str, - ini_params: str, - init_config_id: int, + instance_name: str, + settings: str, + config_id: int, verbose_logging: int = 0, **kwargs: Any ) -> None: diff --git a/src/senzing_abstract/szhelpers.py b/src/senzing_abstract/szhelpers.py new file mode 100644 index 0000000..32c7c83 --- /dev/null +++ b/src/senzing_abstract/szhelpers.py @@ -0,0 +1,298 @@ +""" +TODO: szhelpers.py +""" + +# NOTE This is to prevent TypeError: '_ctypes.PyCPointerType' object is not subscriptable +# on _Pointer[c_char]) for FreeCResources +# ctypes._Pointer is generic for type checkers, but at runtime it's not generic, so annotations +# import is necessary - or string annotation ("_Pointer[c_char]") . +from __future__ import annotations + +import json +import os +import re +import sys +from ctypes import ( + CDLL, + POINTER, + ArgumentError, + _Pointer, + c_char, + c_char_p, + c_uint, + c_void_p, + cast, +) +from functools import wraps +from types import TracebackType +from typing import Any, Callable, Dict, Optional, Type, TypeVar, Union + +if sys.version_info < (3, 10): + from typing_extensions import ParamSpec +else: + from typing import ParamSpec + +# NOTE import orjson if available, on a basic loads it is at least 12% faster on a decently sized getentity and higher for other operations +# with suppress(ModuleNotFoundError): +# import orjson + +uintptr_type = POINTER(c_uint) +T = TypeVar("T") +P = ParamSpec("P") + +# ORJSON_AVAILABLE = "orjson" in dir() + +# ----------------------------------------------------------------------------- +# Classes +# ----------------------------------------------------------------------------- + + +class FreeCResources: + """Free C resources""" + + def __init__(self, handle: CDLL, resource: _Pointer[c_char]) -> None: + self.handle = handle + self.resource = resource + + def __enter__(self) -> None: + pass + + def __exit__( + self, + exc_type: Optional[Type[BaseException]], + exc_value: Optional[BaseException], + exc_tb: Optional[TracebackType], + ) -> None: + self.handle.G2GoHelper_free(self.resource) + + +# class SzJsonString(str): +# """Normally return a JSON string representation of a response from a method call. +# Return a dictionary of the string response if .as_dict() is specified.""" + +# def __init__(self, json_string: str): +# self.json_string = json_string +# print(f"{ORJSON_AVAILABLE = }") + +# # NOTE json.loads() is always Any, need union if return string when not JSON +# # NOTE https://stackoverflow.com/questions/76759158/type-hinting-a-json-object-in-python +# # NOTE "Even the good people at typeshed use Any as the return type for json.load/json.loads to this day. And they basically maintain the official type stubs for the standard library." +# # NOTE https://github.com/python/typeshed/blob/f2ee9e9368a18b19bbf2ac05b6eb6bfea96d9a0c/stdlib/json/__init__.pyi#L39-L60 +# # NOTE Using Any will impact automatic documentation generation if szhelpers gets documented? + +# def as_dict(self) -> Any: +# # TODO: Add check to ensure json_string looks like JSON, is it needed? It's the engines methods using the class not customers. +# # if re.match("^{.*}$", self.json_string): +# # return json.loads(self.json_string) +# # return self.json_string +# # TODO: What if the loads fails? +# if ORJSON_AVAILABLE: +# return orjson.loads(self.json_string).decode() +# return json.loads(self.json_string) + + +# ----------------------------------------------------------------------------- +# Decorators +# ----------------------------------------------------------------------------- + + +def catch_ctypes_exceptions(function_to_decorate: Callable[P, T]) -> Callable[P, T]: + """Modify a ctypes.ArgumentError to a TypeError with additional information if exception occurs.""" + + @wraps(function_to_decorate) + def inner_function(*args: P.args, **kwargs: P.kwargs) -> T: + try: + return function_to_decorate(*args, **kwargs) + except ArgumentError as err: + bad_arg_match = None + method_name = function_to_decorate.__name__ + module_name = function_to_decorate.__module__ + basic_raise_msg = ( + f"wrong type for an argument when calling {module_name}.{method_name}" + ) + # NOTE Checking can find the information from ctypes.Argument error, works currently but could change in future? + # NOTE If can locate what we are looking for from ctypes.ArgumentError can give a more detailed and useful exception message + # NOTE Current message from ctypes: ctypes.ArgumentError: argument 2: TypeError: wrong type + if len(err.args) >= 1: + bad_arg_match = re.match(r"argument (\d+):", err.args[0]) + if bad_arg_match: + bad_arg_index = bad_arg_match.group(1) + try: + bad_arg_index = int(bad_arg_index) + bad_arg_value = args[bad_arg_index] + bad_arg_type = type(bad_arg_value) + bad_arg_tuple = list(function_to_decorate.__annotations__.items())[ + bad_arg_index - 1 + ] + except (IndexError, ValueError): + raise TypeError(basic_raise_msg) from err + if len(bad_arg_tuple) != 2: + raise TypeError(basic_raise_msg) from err + raise TypeError( + f"wrong type for argument {bad_arg_tuple[0]}, expected {bad_arg_tuple[1]} but received {bad_arg_type.__name__} when calling {module_name}.{method_name}" + ) from err + raise TypeError() from err + # # NOTE Do we need to catch anything else? Has a code smell about it + # TODO: Is this generic catch needed? + # except Exception as err: + # # print(f"In szhelpers last exception: {err}") + # raise err + + return inner_function + + +# ----------------------------------------------------------------------------- +# Helpers for working with parameters +# ----------------------------------------------------------------------------- + + +def as_str(candidate_value: Union[str, Dict[Any, Any]]) -> str: + """ + Given a string or dict, return a str. + + Args: + candidate_value Union[str, Dict[Any, Any]]: _description_ + + Returns: + str: The string representation of the candidate_value + """ + # NOTE Testing + if isinstance(candidate_value, dict): + # if ORJSON_AVAILABLE: + # return orjson.dumps(candidate_value).decode() + return json.dumps(candidate_value) + return candidate_value + + +# ----------------------------------------------------------------------------- +# Helpers for working with C +# ----------------------------------------------------------------------------- + + +# TODO: Figure out better return type hint (e.g. POINTER[c_uint], _Pointer[c_uint]) +def as_uintptr_t(candidate_value: int) -> Any: + """ + Internal processing function. + This converts many types of values to an integer. + + :meta private: + """ + + # TODO: ctypes_exception catch this - before and after test should be the same + if not isinstance(candidate_value, int): + raise TypeError( + f"{candidate_value} is type{type(candidate_value)}. Needs to be type(int)" + ) + result = cast(candidate_value, POINTER(c_uint)) + return result + + +# NOTE Believe not needed with catch_ctypes_exceptions decorator and this code would +# NOTE would return ValueErrors if a str with any non digit characters was passed in +def as_c_int(candidate_value: Any) -> int: + """ + Internal processing function. + This converts many types of values to an integer. + + :meta private: + """ + + if candidate_value is None: # handle null string + # TODO: Doesn't need int + return int(0) + if isinstance(candidate_value, str): # if string is unicode, transcode to utf-8 str + return int(candidate_value.encode("utf-8")) + if isinstance( + candidate_value, bytearray + ): # if input is bytearray, assume utf-8 and convert to str + return int(candidate_value) + if isinstance(candidate_value, bytes): + return int(candidate_value) + # TODO: If already an int why use int()? + # input is already an int + return int(candidate_value) + + +def as_c_char_p(candidate_value: Any) -> Any: + """ + Internal processing function. + + :meta private: + """ + + if candidate_value is None: # handle null string + return b"" + if isinstance(candidate_value, str): # if string is unicode, transcode to utf-8 str + return candidate_value.encode("utf-8") + if isinstance( + candidate_value, bytearray + ): # if input is bytearray, assume utf-8 and convert to str + return candidate_value.decode().encode("utf-8") + if isinstance(candidate_value, bytes): + return str(candidate_value).encode("utf-8") + # input is already a str + return candidate_value + # TODO: Instead of TypeError can we utilise SzBadInputException and a new exception so a user only needs to catch + # SzError or SzBadInputException instead of knowing they must also catch TypeError. Would be more convenient and simpler + # raise TypeError( + # f"{candidate_value} has unsupported type of {type(candidate_value)}" + # ) + + +def as_python_int(candidate_value: Any) -> int: + """ + From a c_void_p, return a true python int. + + Args: + candidate_value (Any): A c_void_p to be transformed. + + Returns: + int: The python int representation + + :meta private: + """ + + result = cast(candidate_value, c_void_p).value + # TODO: For methods using this could we get a non zero return code and return None? + # TODO: Would never reach the return as_python_int(result.response) is non zero return code + # TODO: Consequences of returning a 0 which wouldn't be a valid handle? + if result is None: + result = 0 + return result + + +def as_python_str(candidate_value: Any) -> str: + """ + From a c_char_p, return a true python str, + + Args: + candidate_value (Any): A c_char_p value to be transformed. + + Returns: + str: The python string representation. + + :meta private: + """ + # TODO: Do these functions need try/except? + result_raw = cast(candidate_value, c_char_p).value + result = result_raw.decode() if result_raw else "" + return result + + +# ----------------------------------------------------------------------------- +# Helpers for working with files and directories. +# ----------------------------------------------------------------------------- + + +def find_file_in_path(filename: str) -> str: + """ + Find a file in the PATH environment variable. + + :meta private: + """ + path_dirs = os.environ["PATH"].split(os.pathsep) + for path_dir in path_dirs: + file_path = os.path.join(path_dir, filename) + if os.path.exists(file_path): + return file_path + return "" diff --git a/src/senzing_abstract/szproduct_abstract.py b/src/senzing_abstract/szproduct_abstract.py new file mode 100644 index 0000000..d7811be --- /dev/null +++ b/src/senzing_abstract/szproduct_abstract.py @@ -0,0 +1,167 @@ +#! /usr/bin/env python3 + +""" +szproduct_abstract.py is the abstract class for all implementations of szproduct. +""" + +# TODO: Determine specific SzError, Errors for "Raises:" documentation. +import json +from abc import ABC, abstractmethod +from typing import Any, Dict, Optional, Union, cast + +# Metadata + +__all__ = ["SzProductAbstract"] +__version__ = "0.0.1" # See https://www.python.org/dev/peps/pep-0396/ +__date__ = "2023-10-30" +__updated__ = "2023-11-27" + +# ----------------------------------------------------------------------------- +# SzProductAbstract +# ----------------------------------------------------------------------------- + + +class SzProductAbstract(ABC): + """ + SzProductAbstract is the definition of the Senzing Python API that is + implemented by packages such as szproduct.py. + """ + + # ------------------------------------------------------------------------- + # Messages + # ------------------------------------------------------------------------- + + PREFIX = "szproduct." + ID_MESSAGES = { + 4001: PREFIX + "destroy() failed. Return code: {0}", + 4002: PREFIX + "initialize({0}, {1}, {2}) failed. Return code: {3}", + 4003: PREFIX + + "SzProduct({0}, {1}) failed. instance_name and settings must both be set or both be empty", + } + + # ------------------------------------------------------------------------- + # Interface definition + # ------------------------------------------------------------------------- + + @abstractmethod + def destroy(self, **kwargs: Any) -> None: + """ + The `destroy` method will destroy and perform cleanup for the Senzing SzProduct object. + It should be called after all other calls are complete. + + **Note:** If the `SzProduct` constructor was called with parameters, + the destructor will automatically call the destroy() method. + In this case, a separate call to `destroy()` is not needed. + + Raises: + szexception.SzError: + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szproduct/szproduct_initialize_and_destroy.py + :linenos: + :language: python + """ + + @abstractmethod + def initialize( + self, + instance_name: str, + settings: Union[str, Dict[Any, Any]], + verbose_logging: Optional[int] = 0, + **kwargs: Any + ) -> None: + """ + The `initialize` method initializes the Senzing SzProduct object. + It must be called prior to any other calls. + + **Note:** If the SzProduct constructor is called with parameters, + the constructor will automatically call the `initialize()` method. + In this case, a separate call to `initialize()` is not needed. + + Args: + instance_name (str): A short name given to this instance of the SzProduct object, to help identify it within system logs. + settings (str): A JSON string containing configuration parameters. + verbose_logging (int): `Optional:` A flag to enable deeper logging of the Senzing processing. 0 for no Senzing logging; 1 for logging. Default: 0 + + Raises: + TypeError: Incorrect datatype of input parameter. + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szproduct/szproduct_initialize_and_destroy.py + :linenos: + :language: python + """ + + @abstractmethod + def get_license(self, **kwargs: Any) -> str: + """ + The `get_license` method retrieves information about the currently used license by the Senzing API. + + Returns: + str: A JSON document containing Senzing license metadata. + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szproduct/get_license.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szproduct/get_license.txt + :linenos: + :language: json + """ + + @abstractmethod + def get_version(self, **kwargs: Any) -> str: + """ + The `get_version` method returns the version of the Senzing API. + + Returns: + str: A JSON document containing metadata about the Senzing Engine version being used. + + .. collapse:: Example: + + .. literalinclude:: ../../examples/szproduct/get_version.py + :linenos: + :language: python + + **Output:** + + .. literalinclude:: ../../examples/szproduct/get_version.txt + :linenos: + :language: json + """ + + # ------------------------------------------------------------------------- + # Convenience methods + # ------------------------------------------------------------------------- + + def license_as_dict(self, **kwargs: Any) -> Dict[str, Any]: + """ + A convenience method for + :meth:`senzing_abstract.SzProductAbstract.get_license` + + Returns: + Dict[str, Any]: A dictionary containing Senzing license metadata. + """ + return cast( + Dict[str, Any], + json.loads(self.get_license(**kwargs)), + ) + + def version_as_dict(self, **kwargs: Any) -> Dict[str, Any]: + """ + A convenience method for + :meth:`senzing_abstract.SzProductAbstract.get_version` + + Returns: + Dict[str, Any]: A dictionary containing metadata about the Senzing Engine version being used. + """ + return cast( + Dict[str, Any], + json.loads(self.get_version(**kwargs)), + ) diff --git a/tests/g2config_test.py b/tests/g2config_test.py deleted file mode 100644 index 3809e2f..0000000 --- a/tests/g2config_test.py +++ /dev/null @@ -1,138 +0,0 @@ -#! /usr/bin/env python3 - -""" -TODO: g2config_test.py -""" - -# pylint: disable=E1101 - -from typing import Any, Dict, Union - -import pytest - -from senzing_abstract import g2config_abstract - -# ----------------------------------------------------------------------------- -# G2Config fixtures -# ----------------------------------------------------------------------------- - - -@pytest.fixture(name="g2_config", scope="module") # type: ignore[misc] -def g2config_fixture() -> g2config_abstract.G2ConfigAbstract: - """ - Object under test. - """ - - return G2ConfigTest() - - -# ----------------------------------------------------------------------------- -# G2ConfigTest class -# ----------------------------------------------------------------------------- - - -class G2ConfigTest(g2config_abstract.G2ConfigAbstract): - """ - G2 config module access library. - """ - - # ------------------------------------------------------------------------- - # G2Config methods - # ------------------------------------------------------------------------- - - def add_data_source( - self, - config_handle: int, - input_json: Union[str, Dict[Any, Any]], - *args: Any, - **kwargs: Any, - ) -> str: - return "" - - def close(self, config_handle: int, *args: Any, **kwargs: Any) -> None: - pass - - def create(self, *args: Any, **kwargs: Any) -> int: - return 0 - - def delete_data_source( - self, - config_handle: int, - input_json: Union[str, Dict[Any, Any]], - *args: Any, - **kwargs: Any, - ) -> None: - pass - - def destroy(self, *args: Any, **kwargs: Any) -> None: - pass - - def init( - self, - module_name: str, - ini_params: Union[str, Dict[Any, Any]], - verbose_logging: int = 0, - **kwargs: Any, - ) -> None: - pass - - def list_data_sources(self, config_handle: int, *args: Any, **kwargs: Any) -> str: - return "" - - def load( - self, json_config: Union[str, Dict[Any, Any]], *args: Any, **kwargs: Any - ) -> int: - return 0 - - def save(self, config_handle: int, *args: Any, **kwargs: Any) -> str: - return "" - - -# ----------------------------------------------------------------------------- -# Test cases -# ----------------------------------------------------------------------------- - - -def test_add_data_source(g2_config: g2config_abstract.G2ConfigAbstract) -> None: - """Test G2Config().add_data_source().""" - g2_config.add_data_source(0, "") - - -def test_close(g2_config: g2config_abstract.G2ConfigAbstract) -> None: - """Test G2Config().close().""" - g2_config.close(0, "") - - -def test_create(g2_config: g2config_abstract.G2ConfigAbstract) -> None: - """Test G2Config().create().""" - g2_config.create() - - -def test_delete_data_source(g2_config: g2config_abstract.G2ConfigAbstract) -> None: - """Test G2Config().delete_data_source().""" - g2_config.delete_data_source(0, "") - - -def test_destroy(g2_config: g2config_abstract.G2ConfigAbstract) -> None: - """Test G2Config().destroy().""" - g2_config.destroy(0, "") - - -def test_init(g2_config: g2config_abstract.G2ConfigAbstract) -> None: - """Test G2Config().init().""" - g2_config.init("", "") - - -def test_list_data_sources(g2_config: g2config_abstract.G2ConfigAbstract) -> None: - """Test G2Config().list_data_sources().""" - g2_config.list_data_sources(0) - - -def test_load(g2_config: g2config_abstract.G2ConfigAbstract) -> None: - """Test G2Config().load().""" - g2_config.load("") - - -def test_save(g2_config: g2config_abstract.G2ConfigAbstract) -> None: - """Test G2Config().save().""" - g2_config.save(0) diff --git a/tests/g2configmgr_test.py b/tests/g2configmgr_test.py deleted file mode 100644 index e3c2784..0000000 --- a/tests/g2configmgr_test.py +++ /dev/null @@ -1,134 +0,0 @@ -#! /usr/bin/env python3 - -""" -TODO: g2configmgr_test.py -""" - -# pylint: disable=E1101 - -from typing import Any, Dict, Union - -import pytest - -from senzing_abstract import g2configmgr_abstract - -# ----------------------------------------------------------------------------- -# G2Config fixtures -# ----------------------------------------------------------------------------- - - -@pytest.fixture(name="g2_configmgr", scope="module") # type: ignore[misc] -def g2configmgr_fixture() -> g2configmgr_abstract.G2ConfigMgrAbstract: - """ - Object under test. - """ - - return G2ConfigMgrTest() - - -# ----------------------------------------------------------------------------- -# G2ConfigTest class -# ----------------------------------------------------------------------------- - - -class G2ConfigMgrTest(g2configmgr_abstract.G2ConfigMgrAbstract): - """ - G2 configmgr module access library. - """ - - # ------------------------------------------------------------------------- - # G2ConfigMgr methods - # ------------------------------------------------------------------------- - - def add_config( - self, - config_str: Union[str, Dict[Any, Any]], - config_comments: str, - *args: Any, - **kwargs: Any, - ) -> int: - return 0 - - def destroy(self, *args: Any, **kwargs: Any) -> None: - """None""" - - def get_config(self, config_id: int, *args: Any, **kwargs: Any) -> str: - return "" - - def get_config_list(self, *args: Any, **kwargs: Any) -> str: - return "" - - def get_default_config_id(self, *args: Any, **kwargs: Any) -> int: - return 0 - - def init( - self, - module_name: str, - ini_params: Union[str, Dict[Any, Any]], - verbose_logging: int = 0, - **kwargs: Any, - ) -> None: - """None""" - - def replace_default_config_id( - self, old_config_id: int, new_config_id: int, *args: Any, **kwargs: Any - ) -> None: - """None""" - - def set_default_config_id(self, config_id: int, *args: Any, **kwargs: Any) -> None: - """None""" - - -# ----------------------------------------------------------------------------- -# Test cases -# ----------------------------------------------------------------------------- - - -def test_add_config(g2_configmgr: g2configmgr_abstract.G2ConfigMgrAbstract) -> None: - """Test G2ConfigMgr().add_config().""" - g2_configmgr.add_config("", "") - - -def test_destroy(g2_configmgr: g2configmgr_abstract.G2ConfigMgrAbstract) -> None: - """Test G2ConfigMgr().destroy().""" - g2_configmgr.destroy() - - -def test_get_config(g2_configmgr: g2configmgr_abstract.G2ConfigMgrAbstract) -> None: - """Test G2ConfigMgr().get_config().""" - g2_configmgr.get_config(0) - - -def test_get_config_list( - g2_configmgr: g2configmgr_abstract.G2ConfigMgrAbstract, -) -> None: - """Test G2ConfigMgr().get_config_list().""" - g2_configmgr.get_config_list() - - -def test_get_default_config_id( - g2_configmgr: g2configmgr_abstract.G2ConfigMgrAbstract, -) -> None: - """Test G2ConfigMgr().get_default_config_id().""" - g2_configmgr.get_default_config_id() - - -def test_init( - g2_configmgr: g2configmgr_abstract.G2ConfigMgrAbstract, -) -> None: - """Test G2ConfigMgr().init().""" - g2_configmgr.init("", "") - - -def test_replace_default_config_id( - g2_configmgr: g2configmgr_abstract.G2ConfigMgrAbstract, -) -> None: - """Test G2ConfigMgr().replace_default_config_id().""" - g2_configmgr.replace_default_config_id(0, 0) - - -def test_set_default_config_id( - g2_configmgr: g2configmgr_abstract.G2ConfigMgrAbstract, -) -> None: - """Test G2ConfigMgr().set_default_config_id().""" - g2_configmgr.set_default_config_id(0) diff --git a/tests/g2diagnostic_test.py b/tests/g2diagnostic_test.py deleted file mode 100644 index 4739ef1..0000000 --- a/tests/g2diagnostic_test.py +++ /dev/null @@ -1,159 +0,0 @@ -#! /usr/bin/env python3 - -""" -TODO: g2diagnostic_test.py -""" - -# pylint: disable=E1101 - -from typing import Any, Dict, Union - -import pytest - -from senzing_abstract import g2diagnostic_abstract - -# ----------------------------------------------------------------------------- -# G2Config fixtures -# ----------------------------------------------------------------------------- - - -@pytest.fixture(name="g2_diagnostic", scope="module") # type: ignore[misc] -def g2diagnostic_fixture() -> g2diagnostic_abstract.G2DiagnosticAbstract: - """ - Object under test. - """ - - return G2DiagnosticTest() - - -# ----------------------------------------------------------------------------- -# G2ConfigTest class -# ----------------------------------------------------------------------------- - - -class G2DiagnosticTest(g2diagnostic_abstract.G2DiagnosticAbstract): - """ - G2 diagnostic module access library. - """ - - # ------------------------------------------------------------------------- - # G2Diagnostic methods - # ------------------------------------------------------------------------- - - def check_db_perf(self, seconds_to_run: int, *args: Any, **kwargs: Any) -> str: - return "" - - def destroy(self, *args: Any, **kwargs: Any) -> None: - """None""" - - def get_available_memory(self, *args: Any, **kwargs: Any) -> int: - return 0 - - def get_db_info(self, *args: Any, **kwargs: Any) -> str: - return "" - - def get_logical_cores(self, *args: Any, **kwargs: Any) -> int: - return 0 - - def get_physical_cores(self, *args: Any, **kwargs: Any) -> int: - return 0 - - def get_total_system_memory(self, *args: Any, **kwargs: Any) -> int: - return 0 - - def init( - self, - module_name: str, - ini_params: Union[str, Dict[Any, Any]], - verbose_logging: int = 0, - **kwargs: Any, - ) -> None: - """None""" - - def init_with_config_id( - self, - module_name: str, - ini_params: Union[str, Dict[Any, Any]], - init_config_id: int, - verbose_logging: int = 0, - **kwargs: Any, - ) -> None: - """None""" - - def reinit(self, init_config_id: int, *args: Any, **kwargs: Any) -> None: - """None""" - - -# ----------------------------------------------------------------------------- -# Test cases -# ----------------------------------------------------------------------------- - - -def test_check_db_perf( - g2_diagnostic: g2diagnostic_abstract.G2DiagnosticAbstract, -) -> None: - """Test G2Config().check_db_perf().""" - g2_diagnostic.check_db_perf(0) - - -def test_destroy( - g2_diagnostic: g2diagnostic_abstract.G2DiagnosticAbstract, -) -> None: - """Test G2Config().destroy().""" - g2_diagnostic.destroy() - - -def test_get_available_memory( - g2_diagnostic: g2diagnostic_abstract.G2DiagnosticAbstract, -) -> None: - """Test G2Config().get_available_memory().""" - g2_diagnostic.get_available_memory() - - -def test_get_db_info( - g2_diagnostic: g2diagnostic_abstract.G2DiagnosticAbstract, -) -> None: - """Test G2Config().get_db_info().""" - g2_diagnostic.get_db_info() - - -def test_get_logical_cores( - g2_diagnostic: g2diagnostic_abstract.G2DiagnosticAbstract, -) -> None: - """Test G2Config().get_logical_cores().""" - g2_diagnostic.get_logical_cores() - - -def test_get_physical_cores( - g2_diagnostic: g2diagnostic_abstract.G2DiagnosticAbstract, -) -> None: - """Test G2Config().get_physical_cores().""" - g2_diagnostic.get_physical_cores() - - -def test_get_total_system_memory( - g2_diagnostic: g2diagnostic_abstract.G2DiagnosticAbstract, -) -> None: - """Test G2Config().get_total_system_memory().""" - g2_diagnostic.get_total_system_memory() - - -def test_init( - g2_diagnostic: g2diagnostic_abstract.G2DiagnosticAbstract, -) -> None: - """Test G2Config().init().""" - g2_diagnostic.init("", "") - - -def test_init_with_config_id( - g2_diagnostic: g2diagnostic_abstract.G2DiagnosticAbstract, -) -> None: - """Test G2Config().init_with_config_id().""" - g2_diagnostic.init_with_config_id("", "", 0) - - -def test_reinit( - g2_diagnostic: g2diagnostic_abstract.G2DiagnosticAbstract, -) -> None: - """Test G2Config().reinit().""" - g2_diagnostic.reinit(0) diff --git a/tests/g2engine_test.py b/tests/g2engine_test.py deleted file mode 100644 index fac44df..0000000 --- a/tests/g2engine_test.py +++ /dev/null @@ -1,1124 +0,0 @@ -#! /usr/bin/env python3 - -""" -TODO: g2engine_test.py -""" - -# pylint: disable=E1101,C0302 - -from typing import Any, Dict, Iterable, Tuple, Union - -import pytest - -from senzing_abstract import g2engine_abstract -from senzing_abstract.g2engineflags import G2EngineFlags - -# ----------------------------------------------------------------------------- -# G2Engine fixtures -# ----------------------------------------------------------------------------- - - -@pytest.fixture(name="g2_engine", scope="module") # type: ignore[misc] -def g2engine_fixture() -> g2engine_abstract.G2EngineAbstract: - """ - Object under test. - """ - - return G2EngineTest() - - -# ----------------------------------------------------------------------------- -# G2EngineTest class -# ----------------------------------------------------------------------------- - - -class G2EngineTest(g2engine_abstract.G2EngineAbstract): - """ - G2 engine module access library. - """ - - # ------------------------------------------------------------------------- - # G2Engine methods - # ------------------------------------------------------------------------- - - def add_record( - self, - data_source_code: str, - record_id: str, - json_data: Union[str, Dict[Any, Any]], - # TODO: load_id is no longer used, being removed from V4 C api? - load_id: str = "", - flags: int = 0, # pylint: disable=W0613 - **kwargs: Any, - ) -> None: - """None""" - - def add_record_with_info( - self, - data_source_code: str, - record_id: str, - json_data: Union[str, Dict[Any, Any]], - # TODO: load_id is no longer used, being removed from V4 C api? - load_id: str = "", - flags: int = 0, - **kwargs: Any, - ) -> str: - return "" - - def close_export(self, response_handle: int, **kwargs: Any) -> None: - """None""" - - def count_redo_records(self, **kwargs: Any) -> int: - return 0 - - def delete_record( - self, - data_source_code: str, - record_id: str, - # TODO: load_id is no longer used, being removed from V4 C api? - load_id: str = "", - **kwargs: Any, - ) -> None: - """None""" - - def delete_record_with_info( - self, - data_source_code: str, - record_id: str, - # TODO: load_id is no longer used, being removed from V4 C api? - load_id: str = "", - flags: int = 0, - **kwargs: Any, - ) -> str: - return "" - - def destroy(self, **kwargs: Any) -> None: - """None""" - - def export_config(self, **kwargs: Any) -> str: - return "" - - def export_config_and_config_id(self, **kwargs: Any) -> Tuple[str, int]: - return "", 0 - - def export_csv_entity_report( - self, - csv_column_list: str, - flags: int = G2EngineFlags.G2_EXPORT_DEFAULT_FLAGS, - **kwargs: Any, - ) -> int: - return 0 - - def export_csv_entity_report_iterator( - self, - flags: int = G2EngineFlags.G2_EXPORT_DEFAULT_FLAGS, - **kwargs: Any, - ) -> Iterable[str]: - return [""] - - def export_json_entity_report( - self, flags: int = G2EngineFlags.G2_EXPORT_DEFAULT_FLAGS, **kwargs: Any - ) -> int: - return 0 - - def export_json_entity_report_iterator( - self, - flags: int = G2EngineFlags.G2_EXPORT_DEFAULT_FLAGS, - **kwargs: Any, - ) -> Iterable[str]: - return [""] - - def fetch_next(self, response_handle: int, **kwargs: Any) -> str: - return "" - - def find_interesting_entities_by_entity_id( - self, entity_id: int, flags: int = 0, **kwargs: Any - ) -> str: - return "" - - def find_interesting_entities_by_record_id( - self, - data_source_code: str, - record_id: str, - flags: int = 0, - **kwargs: Any, - ) -> str: - return "" - - def find_network_by_entity_id_v2( - self, - entity_list: Union[str, Dict[Any, Any]], - max_degree: int, - build_out_degree: int, - max_entities: int, - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def find_network_by_entity_id( - self, - entity_list: Union[str, Dict[Any, Any]], - max_degree: int, - build_out_degree: int, - max_entities: int, - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def find_network_by_record_id_v2( - self, - record_list: Union[str, Dict[Any, Any]], - max_degree: int, - build_out_degree: int, - max_entities: int, - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def find_network_by_record_id( - self, - record_list: Union[str, Dict[Any, Any]], - max_degree: int, - build_out_degree: int, - max_entities: int, - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def find_path_by_entity_id_v2( - self, - entity_id_1: int, - entity_id_2: int, - max_degree: int, - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def find_path_by_entity_id( - self, - entity_id_1: int, - entity_id_2: int, - max_degree: int, - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def find_path_by_record_id_v2( - self, - data_source_code_1: str, - record_id_1: str, - data_source_code_2: str, - record_id_2: str, - max_degree: int, - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def find_path_by_record_id( - self, - data_source_code_1: str, - record_id_1: str, - data_source_code_2: str, - record_id_2: str, - max_degree: int, - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def find_path_excluding_by_entity_id_v2( - self, - entity_id_1: int, - entity_id_2: int, - max_degree: int, - excluded_entities: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def find_path_excluding_by_entity_id( - self, - entity_id_1: int, - entity_id_2: int, - max_degree: int, - excluded_entities: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def find_path_excluding_by_record_id_v2( - self, - data_source_code_1: str, - record_id_1: str, - data_source_code_2: str, - record_id_2: str, - max_degree: int, - excluded_records: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def find_path_excluding_by_record_id( - self, - data_source_code_1: str, - record_id_1: str, - data_source_code_2: str, - record_id_2: str, - max_degree: int, - excluded_records: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def find_path_including_source_by_entity_id_v2( - self, - entity_id_1: int, - entity_id_2: int, - max_degree: int, - excluded_entities: Union[str, Dict[Any, Any]], - required_dsrcs: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def find_path_including_source_by_entity_id( - self, - entity_id_1: int, - entity_id_2: int, - max_degree: int, - excluded_entities: Union[str, Dict[Any, Any]], - required_dsrcs: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def find_path_including_source_by_record_id_v2( - self, - data_source_code_1: str, - record_id_1: str, - data_source_code_2: str, - record_id_2: str, - max_degree: int, - excluded_records: Union[str, Dict[Any, Any]], - required_dsrcs: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def find_path_including_source_by_record_id( - self, - data_source_code_1: str, - record_id_1: str, - data_source_code_2: str, - record_id_2: str, - max_degree: int, - excluded_records: Union[str, Dict[Any, Any]], - required_dsrcs: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_FIND_PATH_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def get_active_config_id(self, **kwargs: Any) -> int: - return 0 - - def get_entity_by_entity_id_v2( - self, - entity_id: int, - flags: int = G2EngineFlags.G2_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def get_entity_by_entity_id( - self, - entity_id: int, - flags: int = G2EngineFlags.G2_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def get_entity_by_record_id_v2( - self, - data_source_code: str, - record_id: str, - flags: int = G2EngineFlags.G2_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def get_entity_by_record_id( - self, - data_source_code: str, - record_id: str, - flags: int = G2EngineFlags.G2_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def get_record_v2( - self, - data_source_code: str, - record_id: str, - flags: int = G2EngineFlags.G2_RECORD_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def get_record( - self, - data_source_code: str, - record_id: str, - flags: int = G2EngineFlags.G2_RECORD_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def get_redo_record(self, **kwargs: Any) -> str: - return "" - - def get_repository_last_modified_time(self, **kwargs: Any) -> int: - return 0 - - def get_virtual_entity_by_record_id_v2( - self, - record_list: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_HOW_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def get_virtual_entity_by_record_id( - self, - record_list: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_HOW_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def how_entity_by_entity_id_v2( - self, - entity_id: int, - flags: int = G2EngineFlags.G2_HOW_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def how_entity_by_entity_id( - self, - entity_id: int, - flags: int = G2EngineFlags.G2_HOW_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def init( - self, - module_name: str, - ini_params: Union[str, Dict[Any, Any]], - verbose_logging: int = 0, - **kwargs: Any, - ) -> None: - """None""" - - def init_with_config_id( - self, - module_name: str, - ini_params: Union[str, Dict[Any, Any]], - init_config_id: int, - verbose_logging: int = 0, - **kwargs: Any, - ) -> None: - """None""" - - def prime_engine(self, **kwargs: Any) -> None: - """None""" - - def process(self, record: Union[str, Dict[Any, Any]], **kwargs: Any) -> None: - """None""" - - def process_with_info( - self, record: Union[str, Dict[Any, Any]], flags: int, **kwargs: Any - ) -> str: - return "" - - def purge_repository(self, **kwargs: Any) -> None: - """None""" - - def reevaluate_entity(self, entity_id: int, flags: int = 0, **kwargs: Any) -> None: - """None""" - - def reevaluate_entity_with_info( - self, entity_id: int, flags: int = 0, **kwargs: Any - ) -> str: - return "" - - def reevaluate_record( - self, - data_source_code: str, - record_id: str, - flags: int = 0, - **kwargs: Any, - ) -> None: - """None""" - - def reevaluate_record_with_info( - self, - data_source_code: str, - record_id: str, - flags: int = 0, - **kwargs: Any, - ) -> str: - return "" - - def reinit(self, init_config_id: int, **kwargs: Any) -> None: - """None""" - - def replace_record( - self, - data_source_code: str, - record_id: str, - json_data: Union[str, Dict[Any, Any]], - # TODO: load_id is no longer used, being removed from V4 C api? - load_id: str = "", - **kwargs: Any, - ) -> None: - """None""" - - def replace_record_with_info( - self, - data_source_code: str, - record_id: str, - json_data: Union[str, Dict[Any, Any]], - # TODO: load_id is no longer used, being removed from V4 C api? - load_id: str = "", - flags: int = 0, - **kwargs: Any, - ) -> str: - return "" - - def search_by_attributes_v2( - self, - json_data: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def search_by_attributes_v3( - self, - json_data: Union[str, Dict[Any, Any]], - search_profile: str, - flags: int = G2EngineFlags.G2_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def search_by_attributes( - self, - json_data: Union[str, Dict[Any, Any]], - flags: int = G2EngineFlags.G2_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def stats(self, **kwargs: Any) -> str: - return "" - - def why_entities_v2( - self, - entity_id_1: int, - entity_id_2: int, - flags: int = G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def why_entities( - self, - entity_id_1: int, - entity_id_2: int, - flags: int = G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def why_entity_by_entity_id_v2( - self, - entity_id: int, - flags: int = G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def why_entity_by_entity_id( - self, - entity_id: int, - flags: int = G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def why_entity_by_record_id_v2( - self, - data_source_code: str, - record_id: str, - flags: int = G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def why_entity_by_record_id( - self, - data_source_code: str, - record_id: str, - flags: int = G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def why_record_in_entity( - self, - data_source_code: str, - record_id: str, - **kwargs: Any, - ) -> str: - return "" - - def why_record_in_entity_v2( - self, - data_source_code: str, - record_id: str, - flags: int, - **kwargs: Any, - ) -> str: - return "" - - def why_records_v2( - self, - data_source_code_1: str, - record_id_1: str, - data_source_code_2: str, - record_id_2: str, - flags: int = G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - def why_records( - self, - data_source_code_1: str, - record_id_1: str, - data_source_code_2: str, - record_id_2: str, - flags: int = G2EngineFlags.G2_WHY_ENTITY_DEFAULT_FLAGS, - **kwargs: Any, - ) -> str: - return "" - - -# ----------------------------------------------------------------------------- -# Test cases -# ----------------------------------------------------------------------------- - - -def test_add_record(g2_engine: g2engine_abstract.G2EngineAbstract) -> None: - """Test G2Engine().add_record().""" - g2_engine.add_record("", "", "") - - -def test_add_record_with_info(g2_engine: g2engine_abstract.G2EngineAbstract) -> None: - """Test G2Engine().add_record_with_info().""" - g2_engine.add_record_with_info("", "", "") - - -def test_close_export(g2_engine: g2engine_abstract.G2EngineAbstract) -> None: - """Test G2Engine().close_export().""" - g2_engine.close_export(0) - - -def test_count_redo_records(g2_engine: g2engine_abstract.G2EngineAbstract) -> None: - """Test G2Engine().count_redo_records().""" - g2_engine.count_redo_records() - - -def test_delete_record(g2_engine: g2engine_abstract.G2EngineAbstract) -> None: - """Test G2Engine().delete_record().""" - g2_engine.delete_record("", "") - - -def test_delete_record_with_info(g2_engine: g2engine_abstract.G2EngineAbstract) -> None: - """Test G2Engine().delete_record_with_info().""" - g2_engine.delete_record_with_info("", "") - - -def test_destroy(g2_engine: g2engine_abstract.G2EngineAbstract) -> None: - """Test G2Engine().destroy().""" - g2_engine.destroy() - - -def test_export_config(g2_engine: g2engine_abstract.G2EngineAbstract) -> None: - """Test G2Engine().export_config().""" - g2_engine.export_config() - - -def test_export_config_and_config_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().export_config_and_config_id().""" - g2_engine.export_config_and_config_id() - - -def test_export_csv_entity_report( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().export_csv_entity_report().""" - g2_engine.export_csv_entity_report("") - - -def test_export_csv_entity_report_iterator( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().export_csv_entity_report_iterator().""" - g2_engine.export_csv_entity_report_iterator() - - -def test_export_json_entity_report( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().export_json_entity_report().""" - g2_engine.export_json_entity_report() - - -def test_export_json_entity_report_iterator( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().export_json_entity_report_iterator().""" - g2_engine.export_json_entity_report_iterator() - - -def test_fetch_next( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().fetch_next().""" - g2_engine.fetch_next(0) - - -def test_find_interesting_entities_by_entity_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_interesting_entities_by_entity_id().""" - g2_engine.find_interesting_entities_by_entity_id(0) - - -def test_find_interesting_entities_by_record_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_interesting_entities_by_record_id().""" - g2_engine.find_interesting_entities_by_record_id("", "") - - -def test_find_network_by_entity_id_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_network_by_entity_id_v2().""" - g2_engine.find_network_by_entity_id_v2("", 0, 0, 0) - - -def test_find_network_by_entity_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_network_by_entity_id().""" - g2_engine.find_network_by_entity_id("", 0, 0, 0) - - -def test_find_network_by_record_id_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_network_by_record_id_v2().""" - g2_engine.find_network_by_record_id_v2("", 0, 0, 0) - - -def test_find_network_by_record_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_network_by_record_id().""" - g2_engine.find_network_by_record_id("", 0, 0, 0) - - -def test_find_path_by_entity_id_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_path_by_entity_id_v2().""" - g2_engine.find_path_by_entity_id_v2(0, 0, 0) - - -def test_find_path_by_entity_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_path_by_entity_id().""" - g2_engine.find_path_by_entity_id(0, 0, 0) - - -def test_find_path_by_record_id_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_path_by_record_id_v2().""" - g2_engine.find_path_by_record_id_v2("", "", "", "", 0) - - -def test_find_path_by_record_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_path_by_record_id().""" - g2_engine.find_path_by_record_id("", "", "", "", 0) - - -def test_find_path_excluding_by_entity_id_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_path_excluding_by_entity_id_v2().""" - g2_engine.find_path_excluding_by_entity_id_v2(0, 0, 0, "") - - -def test_find_path_excluding_by_entity_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_path_excluding_by_entity_id().""" - g2_engine.find_path_excluding_by_entity_id(0, 0, 0, "") - - -def test_find_path_excluding_by_record_id_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_path_excluding_by_record_id_v2().""" - g2_engine.find_path_excluding_by_record_id_v2("", "", "", "", 0, "") - - -def test_find_path_excluding_by_record_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_path_excluding_by_record_id().""" - g2_engine.find_path_excluding_by_record_id("", "", "", "", 0, "") - - -def test_find_path_including_source_by_entity_id_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_path_including_source_by_entity_id_v2().""" - g2_engine.find_path_including_source_by_entity_id_v2(0, 0, 0, "", "") - - -def test_find_path_including_source_by_entity_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_path_including_source_by_entity_id().""" - g2_engine.find_path_including_source_by_entity_id(0, 0, 0, "", "") - - -def test_find_path_including_source_by_record_id_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_path_including_source_by_record_id_v2().""" - g2_engine.find_path_including_source_by_record_id_v2("", "", "", "", 0, "", "") - - -def test_find_path_including_source_by_record_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().find_path_including_source_by_record_id().""" - g2_engine.find_path_including_source_by_record_id("", "", "", "", 0, "", "") - - -def test_get_active_config_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().get_active_config_id().""" - g2_engine.get_active_config_id() - - -def test_get_entity_by_entity_id_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().get_entity_by_entity_id_v2().""" - g2_engine.get_entity_by_entity_id_v2(0) - - -def test_get_entity_by_entity_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().get_entity_by_entity_id().""" - g2_engine.get_entity_by_entity_id(0) - - -def test_get_entity_by_record_id_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().get_entity_by_record_id_v2().""" - g2_engine.get_entity_by_record_id_v2("", "") - - -def test_get_entity_by_record_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().get_entity_by_record_id().""" - g2_engine.get_entity_by_record_id("", "") - - -def test_get_record_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().get_record_v2().""" - g2_engine.get_record_v2("", "") - - -def test_get_record( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().get_record().""" - g2_engine.get_record("", "") - - -def test_get_redo_record( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().get_redo_record().""" - g2_engine.get_redo_record() - - -def test_get_repository_last_modified_time( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().get_repository_last_modified_time().""" - g2_engine.get_repository_last_modified_time() - - -def test_get_virtual_entity_by_record_id_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().get_virtual_entity_by_record_id_v2().""" - g2_engine.get_virtual_entity_by_record_id_v2("") - - -def test_get_virtual_entity_by_record_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().get_virtual_entity_by_record_id().""" - g2_engine.get_virtual_entity_by_record_id("") - - -def test_how_entity_by_entity_id_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().how_entity_by_entity_id_v2().""" - g2_engine.how_entity_by_entity_id_v2(0) - - -def test_how_entity_by_entity_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().how_entity_by_entity_id().""" - g2_engine.how_entity_by_entity_id(0) - - -def test_init( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().init().""" - g2_engine.init("", "") - - -def test_init_with_config_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().init_with_config_id().""" - g2_engine.init_with_config_id("", "", 0) - - -def test_prime_engine( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().prime_engine().""" - g2_engine.prime_engine() - - -def test_process( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().process().""" - g2_engine.process("") - - -def test_process_with_info( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().process_with_info().""" - g2_engine.process_with_info("", 0) - - -def test_purge_repository( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().purge_repository().""" - g2_engine.purge_repository() - - -def test_reevaluate_entity( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().reevaluate_entity().""" - g2_engine.reevaluate_entity(0) - - -def test_reevaluate_entity_with_info( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().reevaluate_entity_with_info().""" - g2_engine.reevaluate_entity_with_info(0) - - -def test_reevaluate_record( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().reevaluate_record().""" - g2_engine.reevaluate_record("", "") - - -def test_reevaluate_record_with_info( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().reevaluate_record_with_info().""" - g2_engine.reevaluate_record_with_info("", "") - - -def test_reinit( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().reinit().""" - g2_engine.reinit(0) - - -def test_replace_record( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().replace_record().""" - g2_engine.replace_record("", "", "") - - -def test_replace_record_with_info( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().replace_record_with_info().""" - g2_engine.replace_record_with_info("", "", "") - - -def test_search_by_attributes_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().search_by_attributes_v2().""" - g2_engine.search_by_attributes_v2("") - - -def test_search_by_attributes_v3( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().search_by_attributes_v3().""" - g2_engine.search_by_attributes_v3("", "") - - -def test_search_by_attributes( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().search_by_attributes().""" - g2_engine.search_by_attributes("") - - -def test_stats( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().stats().""" - g2_engine.stats() - - -def test_why_entities_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().why_entities_v2().""" - g2_engine.why_entities_v2(0, 0) - - -def test_why_entities( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().why_entities().""" - g2_engine.why_entities(0, 0) - - -def test_why_entity_by_entity_id_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().why_entity_by_entity_id_v2().""" - g2_engine.why_entity_by_entity_id_v2(0) - - -def test_why_entity_by_entity_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().why_entity_by_entity_id().""" - g2_engine.why_entity_by_entity_id(0) - - -def test_why_entity_by_record_id_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().why_entity_by_record_id_v2().""" - g2_engine.why_entity_by_record_id_v2("", "") - - -def test_why_entity_by_record_id( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().why_entity_by_record_id().""" - g2_engine.why_entity_by_record_id("", "") - - -def test_why_record_in_entity( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().why_record_in_entity().""" - g2_engine.why_record_in_entity("", "") - - -def test_why_record_in_entity_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().why_record_in_entity_v2().""" - g2_engine.why_record_in_entity_v2("", "", 0) - - -def test_why_records_v2( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().why_records_v2().""" - g2_engine.why_records_v2("", "", "", "") - - -def test_why_records( - g2_engine: g2engine_abstract.G2EngineAbstract, -) -> None: - """Test G2Engine().why_records().""" - g2_engine.why_records("", "", "", "") diff --git a/tests/g2product_test.py b/tests/g2product_test.py deleted file mode 100644 index a45fa88..0000000 --- a/tests/g2product_test.py +++ /dev/null @@ -1,84 +0,0 @@ -#! /usr/bin/env python3 - -""" -TODO: g2product_test.py -""" - -# pylint: disable=E1101 - -from typing import Any, Dict, Union - -import pytest - -from senzing_abstract import g2product_abstract - -# ----------------------------------------------------------------------------- -# G2Config fixtures -# ----------------------------------------------------------------------------- - - -@pytest.fixture(name="g2_product", scope="module") # type: ignore[misc] -def g2product_fixture() -> g2product_abstract.G2ProductAbstract: - """ - Object under test. - """ - - return G2ProductTest() - - -# ----------------------------------------------------------------------------- -# G2ProductTest class -# ----------------------------------------------------------------------------- - - -class G2ProductTest(g2product_abstract.G2ProductAbstract): - """ - G2 product module access library. - """ - - # ------------------------------------------------------------------------- - # G2Product methods - # ------------------------------------------------------------------------- - - def destroy(self, *args: Any, **kwargs: Any) -> None: - """None""" - - def init( - self, - module_name: str, - ini_params: Union[str, Dict[Any, Any]], - verbose_logging: int = 0, - **kwargs: Any, - ) -> None: - """None""" - - def license(self, *args: Any, **kwargs: Any) -> str: - return "" - - def version(self, *args: Any, **kwargs: Any) -> str: - return "" - - -# ----------------------------------------------------------------------------- -# Test cases -# ----------------------------------------------------------------------------- - - -def test_destroy(g2_product: g2product_abstract.G2ProductAbstract) -> None: - """Test G2Product().destroy().""" - g2_product.destroy() - - -def test_init(g2_product: g2product_abstract.G2ProductAbstract) -> None: - """Test G2Product().init().""" - g2_product.init("", "") - - -def test_license(g2_product: g2product_abstract.G2ProductAbstract) -> None: - """Test G2Product().license().""" - g2_product.license() - - -def test_version(g2_product: g2product_abstract.G2ProductAbstract) -> None: - """Test G2Product().version().""" - g2_product.version() diff --git a/tests/szconfig_test.py b/tests/szconfig_test.py new file mode 100644 index 0000000..76f607d --- /dev/null +++ b/tests/szconfig_test.py @@ -0,0 +1,134 @@ +#! /usr/bin/env python3 + +""" +TODO: szconfig_test.py +""" + +from typing import Any, Dict, Optional, Union + +import pytest + +from senzing_abstract import SzConfigAbstract + +# ----------------------------------------------------------------------------- +# Test cases +# ----------------------------------------------------------------------------- + + +def test_add_data_source(sz_config: SzConfigAbstract) -> None: + """Test SzConfig().add_data_source().""" + sz_config.add_data_source(0, "") + + +def test_close_config(sz_config: SzConfigAbstract) -> None: + """Test SzConfig().close_config().""" + sz_config.close_config(0) + + +def test_create_config(sz_config: SzConfigAbstract) -> None: + """Test SzConfig().create_config().""" + sz_config.create_config() + + +def test_delete_data_source(sz_config: SzConfigAbstract) -> None: + """Test SzConfig().delete_data_source().""" + sz_config.delete_data_source(0, "") + + +def test_destroy(sz_config: SzConfigAbstract) -> None: + """Test SzConfig().destroy().""" + sz_config.destroy() + + +def test_export_config(sz_config: SzConfigAbstract) -> None: + """Test SzConfig().export_config().""" + sz_config.export_config(0) + + +def test_get_data_sources(sz_config: SzConfigAbstract) -> None: + """Test SzConfig().get_data_sources().""" + sz_config.get_data_sources(0) + + +def test_import_config(sz_config: SzConfigAbstract) -> None: + """Test SzConfig().import_config().""" + sz_config.import_config("") + + +def test_initialize(sz_config: SzConfigAbstract) -> None: + """Test SzConfig().initialize().""" + sz_config.initialize("", "") + + +# ----------------------------------------------------------------------------- +# szConfig fixtures +# ----------------------------------------------------------------------------- + + +@pytest.fixture(name="sz_config", scope="module") +def szconfig_fixture() -> SzConfigAbstract: + """ + Object under test. + """ + + return SzConfigTest() + + +# ----------------------------------------------------------------------------- +# SzConfigTest class +# ----------------------------------------------------------------------------- + + +class SzConfigTest(SzConfigAbstract): + """ + SzConfig module access library. + """ + + # ------------------------------------------------------------------------- + # SzConfig methods + # ------------------------------------------------------------------------- + + def add_data_source( + self, + config_handle: int, + data_source_code: str, + **kwargs: Any, + ) -> str: + return "" + + def close_config(self, config_handle: int, **kwargs: Any) -> None: + """None""" + + def create_config(self, **kwargs: Any) -> int: + return 0 + + def delete_data_source( + self, + config_handle: int, + data_source_code: str, + **kwargs: Any, + ) -> None: + """None""" + + def destroy(self, **kwargs: Any) -> None: + """None""" + + def export_config(self, config_handle: int, **kwargs: Any) -> str: + return "" + + def get_data_sources(self, config_handle: int, **kwargs: Any) -> str: + return "" + + def import_config( + self, config_definition: Union[str, Dict[Any, Any]], **kwargs: Any + ) -> int: + return 0 + + def initialize( + self, + instance_name: str, + settings: Union[str, Dict[Any, Any]], + verbose_logging: Optional[int] = 0, + **kwargs: Any, + ) -> None: + """None""" diff --git a/tests/szconfigmanager_test.py b/tests/szconfigmanager_test.py new file mode 100644 index 0000000..89e73d1 --- /dev/null +++ b/tests/szconfigmanager_test.py @@ -0,0 +1,121 @@ +#! /usr/bin/env python3 + +""" +TODO: szconfigmanager_test.py +""" + +from typing import Any, Dict, Optional, Union + +import pytest + +from senzing_abstract import SzConfigManagerAbstract + +# ----------------------------------------------------------------------------- +# Test cases +# ----------------------------------------------------------------------------- + + +def test_add_config(sz_configmanager: SzConfigManagerAbstract) -> None: + """Test SzConfigManager().add_config().""" + sz_configmanager.add_config("", "") + + +def test_destroy(sz_configmanager: SzConfigManagerAbstract) -> None: + """Test SzConfigManager().destroy().""" + sz_configmanager.destroy() + + +def test_get_config(sz_configmanager: SzConfigManagerAbstract) -> None: + """Test SzConfigManager().get_config().""" + sz_configmanager.get_config(0) + + +def test_get_config_list(sz_configmanager: SzConfigManagerAbstract) -> None: + """Test SzConfigManager().get_config_list().""" + sz_configmanager.get_config_list() + + +def test_get_default_config_id(sz_configmanager: SzConfigManagerAbstract) -> None: + """Test SzConfigManager().get_default_config_id().""" + sz_configmanager.get_default_config_id() + + +def test_initialize(sz_configmanager: SzConfigManagerAbstract) -> None: + """Test SzConfigManager().initialize().""" + sz_configmanager.initialize("", "") + + +def test_replace_default_config_id(sz_configmanager: SzConfigManagerAbstract) -> None: + """Test SzConfigManager().replace_default_config_id().""" + sz_configmanager.replace_default_config_id(0, 0) + + +def test_set_default_config_id(sz_configmanager: SzConfigManagerAbstract) -> None: + """Test SzConfigManager().set_default_config_id().""" + sz_configmanager.set_default_config_id(0) + + +# ----------------------------------------------------------------------------- +# SzConfig fixtures +# ----------------------------------------------------------------------------- + + +@pytest.fixture(name="sz_configmanager", scope="module") +def szconfigmanager_fixture() -> SzConfigManagerAbstract: + """ + Object under test. + """ + + return SzConfigManagerTest() + + +# ----------------------------------------------------------------------------- +# SzConfigManagerTest class +# ----------------------------------------------------------------------------- + + +class SzConfigManagerTest(SzConfigManagerAbstract): + """ + SzConfigManager module access library. + """ + + # ------------------------------------------------------------------------- + # SzConfigManager methods + # ------------------------------------------------------------------------- + + def add_config( + self, + config_definition: Union[str, Dict[Any, Any]], + config_comment: str, + **kwargs: Any, + ) -> int: + return 0 + + def destroy(self, **kwargs: Any) -> None: + """None""" + + def get_config(self, config_id: int, **kwargs: Any) -> str: + return "" + + def get_config_list(self, **kwargs: Any) -> str: + return "" + + def get_default_config_id(self, **kwargs: Any) -> int: + return 0 + + def initialize( + self, + instance_name: str, + settings: Union[str, Dict[Any, Any]], + verbose_logging: Optional[int] = 0, + **kwargs: Any, + ) -> None: + """None""" + + def replace_default_config_id( + self, current_default_config_id: int, new_default_config_id: int, **kwargs: Any + ) -> None: + """None""" + + def set_default_config_id(self, config_id: int, **kwargs: Any) -> None: + """None""" diff --git a/tests/szdiagnostic_test.py b/tests/szdiagnostic_test.py new file mode 100644 index 0000000..458af17 --- /dev/null +++ b/tests/szdiagnostic_test.py @@ -0,0 +1,107 @@ +#! /usr/bin/env python3 + +""" +TODO: szdiagnostic_test.py +""" + +from typing import Any, Dict, Optional, Union + +import pytest + +from senzing_abstract import SzDiagnosticAbstract + +# ----------------------------------------------------------------------------- +# Test cases +# ----------------------------------------------------------------------------- + + +def test_check_datastore_performance(sz_diagnostic: SzDiagnosticAbstract) -> None: + """Test SzDiagnosic().check_datastore_performance().""" + sz_diagnostic.check_datastore_performance(0) + + +def test_destroy(sz_diagnostic: SzDiagnosticAbstract) -> None: + """Test SzDiagnosic().destroy().""" + sz_diagnostic.destroy() + + +def test_get_datastore_info(sz_diagnostic: SzDiagnosticAbstract) -> None: + """Test SzDiagnosic().get_datastore_info().""" + sz_diagnostic.get_datastore_info() + + +def test_get_feature(sz_diagnostic: SzDiagnosticAbstract) -> None: + """Test SzDiagnosic().get_datastore_info().""" + sz_diagnostic.get_feature(0) + + +def test_initialize(sz_diagnostic: SzDiagnosticAbstract) -> None: + """Test SzDiagnosic().initialize().""" + sz_diagnostic.initialize("", "") + + +def test_purge_repository(sz_diagnostic: SzDiagnosticAbstract) -> None: + """Test SzDiagnosic().purge_repository().""" + sz_diagnostic.purge_repository() + + +def test_reinitialize(sz_diagnostic: SzDiagnosticAbstract) -> None: + """Test SzDiagnosic().reinitialize().""" + sz_diagnostic.reinitialize(0) + + +# ----------------------------------------------------------------------------- +# SzDiagnostic fixtures +# ----------------------------------------------------------------------------- + + +@pytest.fixture(name="sz_diagnostic", scope="module") +def szdiagnostic_fixture() -> SzDiagnosticAbstract: + """ + Object under test. + """ + + return SzDiagnosticTest() + + +# ----------------------------------------------------------------------------- +# SzDiagnosticTest class +# ----------------------------------------------------------------------------- + + +class SzDiagnosticTest(SzDiagnosticAbstract): + """ + SzDiagnostic module access library. + """ + + # ------------------------------------------------------------------------- + # SzDiagnostic methods + # ------------------------------------------------------------------------- + + def check_datastore_performance(self, seconds_to_run: int, **kwargs: Any) -> str: + return "" + + def destroy(self, **kwargs: Any) -> None: + """None""" + + def get_datastore_info(self, **kwargs: Any) -> str: + return "" + + def get_feature(self, feature_id: int, **kwargs: Any) -> str: + return "" + + def initialize( + self, + instance_name: str, + settings: Union[str, Dict[Any, Any]], + config_id: Optional[int] = None, + verbose_logging: Optional[int] = 0, + **kwargs: Any, + ) -> None: + """None""" + + def purge_repository(self, **kwargs: Any) -> None: + """None""" + + def reinitialize(self, config_id: int, **kwargs: Any) -> None: + """None""" diff --git a/tests/szengine_test.py b/tests/szengine_test.py new file mode 100644 index 0000000..de34aab --- /dev/null +++ b/tests/szengine_test.py @@ -0,0 +1,422 @@ +#! /usr/bin/env python3 + +""" +TODO: szengine_test.py +""" + +from typing import Any, Dict, List, Optional, Union + +import pytest + +from senzing_abstract import SzEngineAbstract, SzEngineFlags + +# ----------------------------------------------------------------------------- +# Test cases +# ----------------------------------------------------------------------------- + + +def test_add_record(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().add_record().""" + sz_engine.add_record("", "", "") + + +def test_close_export(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().close_export().""" + sz_engine.close_export(0) + + +def test_count_redo_records(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().count_redo_records().""" + sz_engine.count_redo_records() + + +def test_delete_record(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().delete_record().""" + sz_engine.delete_record("", "") + + +def test_destroy(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().destroy().""" + sz_engine.destroy() + + +def test_export_csv_entity_report(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().export_csv_entity_report().""" + sz_engine.export_csv_entity_report("") + + +def test_export_json_entity_report(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().export_json_entity_report().""" + sz_engine.export_json_entity_report() + + +def test_fetch_next(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().fetch_next().""" + sz_engine.fetch_next(0) + + +def test_find_interesting_entities_by_entity_id(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().find_interesting_entities_by_entity_id().""" + sz_engine.find_interesting_entities_by_entity_id(0) + + +def test_find_interesting_entities_by_record_id(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().find_interesting_entities_by_record_id().""" + sz_engine.find_interesting_entities_by_record_id("", "") + + +def test_find_network_by_entity_id(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().find_network_by_entity_id().""" + sz_engine.find_network_by_entity_id("", 0, 0, 0) + + +def test_find_network_by_record_id(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().find_network_by_record_id().""" + sz_engine.find_network_by_record_id("", 0, 0, 0) + + +def test_find_path_by_entity_id(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().find_path_by_entity_id().""" + sz_engine.find_path_by_entity_id(0, 0, 0) + + +def test_find_path_by_record_id(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().find_path_by_record_id().""" + sz_engine.find_path_by_record_id("", "", "", "", 0) + + +def test_get_active_config_id(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().get_active_config_id().""" + sz_engine.get_active_config_id() + + +def test_get_entity_by_entity_id(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().get_entity_by_entity_id().""" + sz_engine.get_entity_by_entity_id(0) + + +def test_get_entity_by_record_id(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().get_entity_by_record_id().""" + sz_engine.get_entity_by_record_id("", "") + + +def test_get_record(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().get_record().""" + sz_engine.get_record("", "") + + +def test_get_redo_record(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().get_redo_record().""" + sz_engine.get_redo_record() + + +def test_get_stats(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().stats().""" + sz_engine.get_stats() + + +def test_get_virtual_entity_by_record_id(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().get_virtual_entity_by_record_id().""" + sz_engine.get_virtual_entity_by_record_id("") + + +def test_how_entity_by_entity_id(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().how_entity_by_entity_id().""" + sz_engine.how_entity_by_entity_id(0) + + +def test_initialize(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().init().""" + sz_engine.initialize("", "") + + +def test_prime_engine(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().prime_engine().""" + sz_engine.prime_engine() + + +def test_reevaluate_entity(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().reevaluate_entity().""" + sz_engine.reevaluate_entity(0) + + +def test_reevaluate_record(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().reevaluate_record().""" + sz_engine.reevaluate_record("", "") + + +def test_reinitialize(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().reinit().""" + sz_engine.reinitialize(0) + + +def test_search_by_attributes(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().search_by_attributes().""" + sz_engine.search_by_attributes("") + + +def test_why_entities(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().why_entities().""" + sz_engine.why_entities(0, 0) + + +def test_why_record_in_entity(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().why_record_in_entity().""" + sz_engine.why_record_in_entity("", "") + + +def test_why_records(sz_engine: SzEngineAbstract) -> None: + """Test SzEngine().why_records().""" + sz_engine.why_records("", "", "", "") + + +# ----------------------------------------------------------------------------- +# SzEngine fixtures +# ----------------------------------------------------------------------------- + + +@pytest.fixture(name="sz_engine", scope="module") +def szengine_fixture() -> SzEngineAbstract: + """ + Object under test. + """ + + return SzEngineTest() + + +# ----------------------------------------------------------------------------- +# SzEngineTest class +# ----------------------------------------------------------------------------- + + +class SzEngineTest(SzEngineAbstract): + """ + SzEngine module access library. + """ + + # ------------------------------------------------------------------------- + # SzEngine methods + # ------------------------------------------------------------------------- + + def add_record( + self, + data_source_code: str, + record_id: str, + record_definition: Union[str, Dict[Any, Any]], + flags: int = 0, + **kwargs: Any, + ) -> str: + return "" + + def close_export(self, export_handle: int, **kwargs: Any) -> None: + """None""" + + def count_redo_records(self, **kwargs: Any) -> int: + return 0 + + def delete_record( + self, + data_source_code: str, + record_id: str, + flags: int = 0, + **kwargs: Any, + ) -> str: + return "" + + def destroy(self, **kwargs: Any) -> None: + """None""" + + def export_csv_entity_report( + self, + csv_column_list: str, + flags: int = SzEngineFlags.SZ_EXPORT_DEFAULT_FLAGS, + **kwargs: Any, + ) -> int: + return 0 + + def export_json_entity_report( + self, flags: int = SzEngineFlags.SZ_EXPORT_DEFAULT_FLAGS, **kwargs: Any + ) -> int: + return 0 + + def fetch_next(self, export_handle: int, **kwargs: Any) -> str: + return "" + + def find_interesting_entities_by_entity_id( + self, entity_id: int, flags: int = 0, **kwargs: Any + ) -> str: + return "" + + def find_interesting_entities_by_record_id( + self, data_source_code: str, record_id: str, flags: int = 0, **kwargs: Any + ) -> str: + return "" + + def find_network_by_entity_id( + self, + entity_list: Union[str, Dict[str, List[Dict[str, int]]]], + max_degrees: int, + build_out_degree: int, + max_entities: int, + flags: int = SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + return "" + + def find_network_by_record_id( + self, + record_list: Union[str, Dict[str, List[Dict[str, str]]]], + max_degrees: int, + build_out_degree: int, + max_entities: int, + flags: int = SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + return "" + + def find_path_by_entity_id( + self, + start_entity_id: int, + end_entity_id: int, + max_degrees: int, + # TODO Should accept both entity and record IDs in V4, test + exclusions: Union[str, Dict[Any, Any]] = "", + required_data_sources: Union[str, Dict[Any, Any]] = "", + flags: int = SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + return "" + + def find_path_by_record_id( + self, + start_data_source_code: str, + start_record_id: str, + end_data_source_code: str, + end_record_id: str, + max_degrees: int, + exclusions: Union[str, Dict[Any, Any]] = "", + required_data_sources: Union[str, Dict[Any, Any]] = "", + flags: int = SzEngineFlags.SZ_FIND_PATH_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + return "" + + def get_active_config_id(self, **kwargs: Any) -> int: + return 0 + + def get_entity_by_entity_id( + self, + entity_id: int, + flags: int = SzEngineFlags.SZ_ENTITY_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + return "" + + def get_entity_by_record_id( + self, + data_source_code: str, + record_id: str, + flags: int = SzEngineFlags.SZ_ENTITY_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + return "" + + def get_record( + self, + data_source_code: str, + record_id: str, + flags: int = SzEngineFlags.SZ_RECORD_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + return "" + + def get_redo_record(self, **kwargs: Any) -> str: + return "" + + def get_stats(self, **kwargs: Any) -> str: + return "" + + def get_virtual_entity_by_record_id( + self, + record_list: Union[str, Dict[Any, Any]], + flags: int = SzEngineFlags.SZ_VIRTUAL_ENTITY_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + return "" + + def how_entity_by_entity_id( + self, + entity_id: int, + flags: int = SzEngineFlags.SZ_HOW_ENTITY_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + return "" + + def initialize( + self, + instance_name: str, + settings: Union[str, Dict[Any, Any]], + config_id: Optional[int] = 0, + verbose_logging: Optional[int] = 0, + **kwargs: Any, + ) -> None: + """None""" + + def prime_engine(self, **kwargs: Any) -> None: + """None""" + + def process_redo_record(self, redo_record: str, flags: int, **kwargs: Any) -> str: + return "" + + def reevaluate_entity(self, entity_id: int, flags: int = 0, **kwargs: Any) -> str: + return "" + + def reevaluate_record( + self, + data_source_code: str, + record_id: str, + flags: int = 0, + **kwargs: Any, + ) -> str: + return "" + + def reinitialize(self, config_id: int, **kwargs: Any) -> None: + """None""" + + def search_by_attributes( + self, + attributes: Union[str, Dict[Any, Any]], + search_profile: str = "", + flags: int = SzEngineFlags.SZ_SEARCH_BY_ATTRIBUTES_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + return "" + + def why_entities( + self, + entity_id_1: int, + entity_id_2: int, + flags: int = SzEngineFlags.SZ_WHY_ENTITIES_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + return "" + + def why_record_in_entity( + self, + data_source_code: str, + record_id: str, + flags: int = SzEngineFlags.SZ_WHY_RECORDS_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + return "" + + def why_records( + self, + data_source_code_1: str, + record_id_1: str, + data_source_code_2: str, + record_id_2: str, + flags: int = SzEngineFlags.SZ_WHY_RECORDS_DEFAULT_FLAGS, + **kwargs: Any, + ) -> str: + return "" diff --git a/tests/szproduct_test.py b/tests/szproduct_test.py new file mode 100644 index 0000000..36d19ae --- /dev/null +++ b/tests/szproduct_test.py @@ -0,0 +1,82 @@ +#! /usr/bin/env python3 + +""" +TODO: szproduct_test.py +""" + +from typing import Any, Dict, Optional, Union + +import pytest + +from senzing_abstract import SzProductAbstract + +# ----------------------------------------------------------------------------- +# Test cases +# ----------------------------------------------------------------------------- + + +def test_destroy(sz_product: SzProductAbstract) -> None: + """Test SzProduct().destroy().""" + sz_product.destroy() + + +def test_initialize(sz_product: SzProductAbstract) -> None: + """Test SzProduct().initialize().""" + sz_product.initialize("", "") + + +def test_get_license(sz_product: SzProductAbstract) -> None: + """Test SzProduct().get_license().""" + sz_product.get_license() + + +def test_get_version(sz_product: SzProductAbstract) -> None: + """Test SzProduct().get_version().""" + sz_product.get_version() + + +# ----------------------------------------------------------------------------- +# SzConfig fixtures +# ----------------------------------------------------------------------------- + + +@pytest.fixture(name="sz_product", scope="module") +def szproduct_fixture() -> SzProductAbstract: + """ + Object under test. + """ + + return SzProductTest() + + +# ----------------------------------------------------------------------------- +# SzProductTest class +# ----------------------------------------------------------------------------- + + +class SzProductTest(SzProductAbstract): + """ + SzProduct module access library. + """ + + # ------------------------------------------------------------------------- + # SzProduct methods + # ------------------------------------------------------------------------- + + def destroy(self, *args: Any, **kwargs: Any) -> None: + """None""" + + def initialize( + self, + instance_name: str, + settings: Union[str, Dict[Any, Any]], + verbose_logging: Optional[int] = 0, + **kwargs: Any + ) -> None: + """None""" + + def get_license(self, **kwargs: Any) -> str: + return "" + + def get_version(self, **kwargs: Any) -> str: + return ""