-
Notifications
You must be signed in to change notification settings - Fork 579
feat: RDF4J Client #3306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
edmondchuc
wants to merge
54
commits into
7.x
Choose a base branch
from
v7/feat/rdf4j
base: 7.x
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
feat: RDF4J Client #3306
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…ementation Also set up and add tests
# Conflicts: # poetry.lock
…, add overwrite and get methods on Repository class and add tests for them
…d some docstring content
… object of Repository.get() method
Also fixes a httpx limitation with key-only query params.
…ons as well" This reverts commit 323f303.
…ec. Update tests to skip if httpx is not available
nicholascar
approved these changes
Nov 7, 2025
| namespace: str | ||
|
|
||
|
|
||
| class NamespaceManager: |
Member
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you consider an alternate name here to ensure no confusion with RDFLib's NamespaceManager, or are you following naming suggested by the RDF4J API?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes
This PR introduces a httpx-based RDF4J Client that wraps the RDF4J REST API: https://rdf4j.org/documentation/reference/rest-api/.
Where possible, it provides tight integration with RDFLib by returning RDFLib data objects for graphs, datasets, and SPARQL results.
Majority of the code is in
rdflib.contrib.rdf4j.client. The codebase is covered by unit tests (with mocks) and end-to-end test with testcontainers, which spins up real GraphDB instances. I've tried to document what I can with docstrings, but I will add user-facing documentation soon.The main classes to note:
RDF4JClient- the main entrypoint to using this package.RepositoryManager- manage repositories at the server-levelRepository- manages an individual repositoryNamespaceManager- manage a repository's namespace prefixesGraphStoreManager- a repository's graph store protocol interfaceTransaction- a transaction manager for a repositoryNotes
A small bit of GraphDB specific code is included in the PR but please ignore it for now. This is incomplete and only here to showcase how we'd implement some GraphDB specific handling on top of RDF4J. This will be a separate piece of work in a separate PR.
I had to add in the python version upper bound
<4.0inpyproject.tomlas it's required by testcontainers. We can remove this upper bound once testcontainers relaxes this constraint in testcontainers/testcontainers-python#909.Next steps
Checklist
the same change.
./examples.so maintainers can fix minor issues and keep your PR up to date.