A simple interface to interact with a GraphDB instance
Project description
graph_db_interface
This repository acts as an interface to abstract SPARQL queries to callable methods to interact with a running GraphDB instance in an easier way.
Installation
To install the current PyPI release, simply run the following command using your preferred python interpreter:
pip install graph-db-interface
Or after cloning this repository you can also use poetry to install the package:
poetry install
Getting Started
The package uses a single class named GraphDB. To use the interface, simply generate an object from this class:
from graph_db_interface import GraphDB, GraphDBCredentials
credentials = GraphDBCredentials(
base_url="<your_graph_db_url>",
username="<your_graph_db_user>",
password="<your_graph_db_password>",
repository="<your_selected_repository_id>",
)
my_db = GraphDB(credentials=credentials)
Running Tests
The test suite expects a running GraphDB instance and uses a dedicated test repository.
Required environment variables for tests:
GRAPHDB_URLGRAPHDB_USERNAMEGRAPHDB_PASSWORDGRAPHDB_TEST_REPOSITORY
Example:
export GRAPHDB_URL="http://localhost:7200"
export GRAPHDB_USERNAME="admin"
export GRAPHDB_PASSWORD="root"
export GRAPHDB_TEST_REPOSITORY="test-repo"
poetry run pytest tests -v
Note: application/runtime credentials loaded via GraphDBCredentials.from_env() still use GRAPHDB_REPOSITORY by default.
License
The package is licensed under the MIT license.
Acknowledgements
This package is developed as part of the INF subproject of the CRC 1574: Circular Factory for the Perpetual Product. This work is therefore supported by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) [grant-number: SFB-1574-471687386]
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file graph_db_interface-2.0.0.tar.gz.
File metadata
- Download URL: graph_db_interface-2.0.0.tar.gz
- Upload date:
- Size: 27.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b90f8ff2b5240ed3fd69c67699006d007a1a79078b4b48996c03addd82f5051c
|
|
| MD5 |
8aed39fdf4db386d4942d9cf36a5c654
|
|
| BLAKE2b-256 |
334b5d31d690f3033cda87f7700e62e2db1ae73bf482c11fe6ad02893a64c095
|
Provenance
The following attestation bundles were made for graph_db_interface-2.0.0.tar.gz:
Publisher:
publish-to-pypi.yml on JaFeKl/graph_db_interface
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graph_db_interface-2.0.0.tar.gz -
Subject digest:
b90f8ff2b5240ed3fd69c67699006d007a1a79078b4b48996c03addd82f5051c - Sigstore transparency entry: 1181674960
- Sigstore integration time:
-
Permalink:
JaFeKl/graph_db_interface@155d55e58188b46fb3a722775e56a7b5d0bd1aa6 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/JaFeKl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@155d55e58188b46fb3a722775e56a7b5d0bd1aa6 -
Trigger Event:
release
-
Statement type:
File details
Details for the file graph_db_interface-2.0.0-py3-none-any.whl.
File metadata
- Download URL: graph_db_interface-2.0.0-py3-none-any.whl
- Upload date:
- Size: 35.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0643ac81223b3c7c11c249778fbad061e96a792b47f2f5142f2841d3bcdc93cc
|
|
| MD5 |
b1beee4fb814d7dab0b1dcb3db246f8f
|
|
| BLAKE2b-256 |
67f012193d3be13658a7011bb021eef21a6734fc6f1c72226b7d6cc09dcecbd0
|
Provenance
The following attestation bundles were made for graph_db_interface-2.0.0-py3-none-any.whl:
Publisher:
publish-to-pypi.yml on JaFeKl/graph_db_interface
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
graph_db_interface-2.0.0-py3-none-any.whl -
Subject digest:
0643ac81223b3c7c11c249778fbad061e96a792b47f2f5142f2841d3bcdc93cc - Sigstore transparency entry: 1181674964
- Sigstore integration time:
-
Permalink:
JaFeKl/graph_db_interface@155d55e58188b46fb3a722775e56a7b5d0bd1aa6 -
Branch / Tag:
refs/tags/v2.0.0 - Owner: https://github.com/JaFeKl
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-to-pypi.yml@155d55e58188b46fb3a722775e56a7b5d0bd1aa6 -
Trigger Event:
release
-
Statement type: