-
Notifications
You must be signed in to change notification settings - Fork 579
feat: RDF4J store #3316
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
Merged
Merged
feat: RDF4J store #3316
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
Implements: - init/open - close - add - addN - contexts - add_graph - remove_graph - __len__
…ng up the repo between each tests
…k to stable v7 poetry.lock
nicholascar
added a commit
that referenced
this pull request
Nov 14, 2025
* feat: add RDF4JClient, RepositoryManager, and initial Repository implementation Also set up and add tests * test: add test for repo listing format error and repo not healthy error * chore: add testcontainers comment * docs: add google style docstring for mkdocs * test: add rdf4j client test * chore: add todo to only run rdf4j tests on python 3.9 or greater * chore: add todo to only run rdf4j tests on python 3.9 or greater * refactor: organise rdf4j package into rdflib.contrib * feat: add http_client property * feat: bootstrap a minimal graphdb client * chore: remove unused rdf4j testcontainer * chore: add testcontainer pytest marker, refactor rdf4j test structure, add overwrite and get methods on Repository class and add tests for them * test: rearrange unit tests * feat: Repository get method * feat: Repository delete method * feat: Repository size method * test: add e2e tests for the new Repository methods * feat: add Repository upload and graphs method * test: fix up and improve existing tests * test: add tests for Repository.graphs * chore: add docstring to overwrite and upload methods * feat: defer repository manager creation until accessed, and also amend some docstring content * feat: add RDF4J NamespaceManager * chore: fix mypy issues * test: add e2e tests for RDF4J Repository NamespaceManager * chore: doc improvements * feat: the repository's namespace prefixes are now bound to the return object of Repository.get() method * feat: add Repository GraphStoreManager * test: add e2e test for Repository GraphStoreManager Also fixes a httpx limitation with key-only query params. * chore: remove redundant re-raise of httpx exceptions * docs: add docstring to protocol method * style: formatting * feat: add Repository.query method * feat: add Repository.update method * feat: add Repository Transaction with ping and commit * refactor: prep Repository.size method to be used by transactions as well * test: refactor e2e test file names to avoid clash * test: fix test * Revert "refactor: prep Repository.size method to be used by transactions as well" This reverts commit 323f303. * test: fix test * feat: Add Transaction.size method * feat: Add Transaction rollback, add, and query methods * feat: Add Transaction delete, and also Transaction upload test * feat: Add Transaction update * feat: Add Transaction get * test: update transaction tests for upload and delete * fix: improve error handling * feat: dynamically import httpx by checking its existence with find_spec. Update tests to skip if httpx is not available * test: put httpx import behind has_httpx condition * test: fix test annotations * fix: add conditional import for GraphDBClient * test: ignore rdf4j and graphdb client.py for docstring tests * feat: RDF4J store (#3316) * fix: handle graph_name when it's a str * feat: wip RDF4JStore Implements: - init/open - close - add - addN - contexts - add_graph - remove_graph - __len__ * feat: RDF4J Store now supports handling namespaces and prefixes * feat: RDF4J Store triples and quads querying * feat: ensure no bnodes are used to cross document/query boundaries * chore: formatting * test: improve e2e test speed by reusing the same container and cleaning up the repo between each tests * feat: add RDF4JStore remove * feat: add RDF4JStore triples_choices tests * feat: add RDF4JStore SPARQL query and update tests * chore: fix mypy issues * test: error handling on client fixture * test: mark testcontainer tests and put test imports behind the has_httpx flag * build: remove upper python bound, bump testcontainers, and revert back to stable v7 poetry.lock * test: put testcontainer tests behind a flag for unsupported python versions * test: install rdf4j extras for python 3.9 and above * ci: skip testcontainer tests on non-linux runners * chore: rename RDF4J's NamespaceManager class --------- Co-authored-by: Nicholas Car <[email protected]>
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 builds on the RDF4J Client work introduced in #3306 and adds a new RDF4J Store backend.
Note that the end-to-end tests using testcontainers only run on the Linux runners in GitHub Actions. Additionally, testcontainers is only installed on python 3.9+.
Checklist
the same change.
./examples.so maintainers can fix minor issues and keep your PR up to date.