kapps-triplestore-interface
This library turns SPARQL queries and updates against a running GraphDB triplestore into callable Python methods. Three research projects run it in production.
Origin
This is a renamed fork of graph-db-interface
by Jan-Felix Klein.
- Origin:
JaFeKl/graph_db_interface— MIT licensed, last released asgraph-db-interface2.0.1 on PyPI. - This release: the
dev_semantic_middlewarebranch ofSAWeindel/graph_db_interface, which carries five commits by Sören Weindel and Etienne Hoffmann that are in no releasedgraph-db-interface. They are listed in CHANGELOG.md.
The licence is MIT. Jan-Felix Klein's 2025 copyright notice is retained — a condition of the licence this fork relies on, not a courtesy — alongside a 2026 notice for Etienne Hoffmann and Sören Weindel.
Migration from graph-db-interface
Three edits, and nothing else moves:
- Change your dependency from
graph-db-interfacetokapps-triplestore-interface. - Change imports from
from graph_db_interface import ...tofrom kapps_triplestore_interface import .... - If you catch it, change
GraphDBInterfaceErrortoTripleStoreInterfaceError.
The classes GraphDB and GraphDBCredentials, the flag use_gdb_token and the word
repository all stay, deliberately. A GDB token is a GraphDB-only mechanism — Basic auth
returns 401 against it, and the token comes from rest/login — so a backend-neutral name for
it would hide a vendor mechanism behind a neutral word rather than abstract it. Repository is
RDF4J's own term, and RDF4J is what this library speaks. And an abstraction never tested
against a second implementation is not one: when a second backend arrives, a class is added,
and GraphDB stays a correct name for the GraphDB implementation.
Why the first release is 2.1.0
It is the same mature library under a new name, so 2.x tells the truth about it where 0.x
would falsely say I may break you. Minor rather than patch because commit 65157c5 adds a
feature.
Not 3.0.0: semver's breaking-change rule governs upgrades within one distribution name, and
no such upgrade path exists here. Nobody is bumped from graph-db-interface to this — they
must edit their manifest, and that edit is the migration signal.
Installation
pip install kapps-triplestore-interface
Or, from a clone of this repository:
uv sync
Getting Started
The package uses a single class named GraphDB. To use the interface, create an object from
this class:
from kapps_triplestore_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"
uv run pytest tests -v
Note: application/runtime credentials loaded via GraphDBCredentials.from_env() still use
GRAPHDB_REPOSITORY by default.
Contributing
This repository is a publish target. It receives one commit per release, cut from a private development repository, so a pull request opened here has no shared history to merge into and cannot be merged. Please open an issue instead.
Improvements that belong to the library this was forked from are better sent to its origin,
JaFeKl/graph_db_interface.
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]
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 kapps_triplestore_interface-2.1.0.tar.gz.
File metadata
- Download URL: kapps_triplestore_interface-2.1.0.tar.gz
- Upload date:
- Size: 53.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6a9a88a949371ed32e76cf70c17741fcfffb6be1080c6987980732c189438e6
|
|
| MD5 |
65421616f04427cbb7e0343e1c612129
|
|
| BLAKE2b-256 |
1a7815991248dd4106f09782034883b3124a67333ebc915b81ea94f8e9f4057c
|
Provenance
The following attestation bundles were made for kapps_triplestore_interface-2.1.0.tar.gz:
Publisher:
publish.yml on circularfactory/kapps_triplestore_interface
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kapps_triplestore_interface-2.1.0.tar.gz -
Subject digest:
a6a9a88a949371ed32e76cf70c17741fcfffb6be1080c6987980732c189438e6 - Sigstore transparency entry: 2438257326
- Sigstore integration time:
-
Permalink:
circularfactory/kapps_triplestore_interface@2a0418a74054f9d576b0c7a918d7e699acde7849 -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/circularfactory
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2a0418a74054f9d576b0c7a918d7e699acde7849 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kapps_triplestore_interface-2.1.0-py3-none-any.whl.
File metadata
- Download URL: kapps_triplestore_interface-2.1.0-py3-none-any.whl
- Upload date:
- Size: 38.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
069ee46842f68c3a9ab35726d2cddc82d592ba74b86e53c491d2a72344811df5
|
|
| MD5 |
f7a21b282807bc00e2a0446278a28472
|
|
| BLAKE2b-256 |
e72ef54109b2e5d30379c33df675a05d357964bdc59922ecafe68875d4254903
|
Provenance
The following attestation bundles were made for kapps_triplestore_interface-2.1.0-py3-none-any.whl:
Publisher:
publish.yml on circularfactory/kapps_triplestore_interface
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kapps_triplestore_interface-2.1.0-py3-none-any.whl -
Subject digest:
069ee46842f68c3a9ab35726d2cddc82d592ba74b86e53c491d2a72344811df5 - Sigstore transparency entry: 2438257369
- Sigstore integration time:
-
Permalink:
circularfactory/kapps_triplestore_interface@2a0418a74054f9d576b0c7a918d7e699acde7849 -
Branch / Tag:
refs/tags/v2.1.0 - Owner: https://github.com/circularfactory
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@2a0418a74054f9d576b0c7a918d7e699acde7849 -
Trigger Event:
push
-
Statement type: