Registry / database / pyoxigraph

pyoxigraph

JSON →
library0.5.8pypypi✓ verified 87d ago

PyOxigraph provides Python bindings for Oxigraph, a high-performance SPARQL database and RDF toolkit implemented in Rust. It offers capabilities for parsing, storing, querying, and manipulating RDF data, including support for various RDF serialization formats and the SPARQL query language. The library is actively maintained with frequent releases, typically every few weeks, incorporating new features and performance improvements. Current version is 0.5.6.

pip install pyoxigraph
INSTALL
IMPORT
SIG · PYOXIGRAPH
P
pyoxigraph
databasepythonv0.5.8
Install
1.9s avg
Import
Disk
38MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.5.8 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 41.5MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.9s · import 0.000s · 38MB
38MB installed
● package 38MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Store
from pyoxigraph import Store
NamedNode
from pyoxigraph import NamedNode
Literal
from pyoxigraph import Literal
Triple
from pyoxigraph import Triple
QueryEvaluator
from pyoxigraph import QueryEvaluator

This example demonstrates how to create a `Store`, add RDF `Triple`s using `NamedNode` and `Literal` terms, and then query the store using a simple SPARQL `SELECT` statement.

from pyoxigraph import Store, NamedNode, Literal, Triple # Create an in-memory store store = Store() # Define some RDF terms ex_s = NamedNode("http://example.com/subject") ex_p = NamedNode("http://example.com/predicate") ex_o = Literal("object value") # Add a triple to the store store.add(Triple(ex_s, ex_p, ex_o)) # Add another triple store.add(Triple(NamedNode("http://example.com/another"), NamedNode("http://example.com/knows"), ex_s)) # Query the store using SPARQL print("\n--- Query Results ---") results = store.query("SELECT ?s ?p ?o WHERE { ?s ?p ?o }") for s, p, o in results: print(f"Subject: {s}, Predicate: {p}, Object: {o}") # Check if the store contains a specific triple if store.contains(Triple(ex_s, ex_p, ex_o)): print(f"\nStore contains: {ex_s} {ex_p} {ex_o}")
oxigraph --version
Debug
Known issues
breakingThe `rdf-star` feature (for RDF-star syntax) was replaced by `rdf-12` and `sparql-12` features in v0.5.0, aligning with W3C working drafts for RDF 1.2 and SPARQL 1.2. The triple term syntax also slightly changed.
fix
If you were using RDF-star, update your code to use the new RDF 1.2/SPARQL 1.2 features and adapt to the updated triple term syntax as defined in the latest specifications. Consult the PyOxigraph documentation for examples on enabling and using these features.
affects: >=0.5.0
gotchaStarting from v0.5.2, PyOxigraph's underlying RocksDB dependency requires a C++20 compatible compiler to build from source. This primarily affects users installing `pyoxigraph` without pre-built wheels or on platforms where Rust's build system needs to compile RocksDB.
fix
Ensure your system has a C++20 compatible compiler (e.g., GCC 10+, Clang 11+, MSVC 19.28+). If you're on an older system, you might need to upgrade your compiler or ensure pre-built wheels are available for your platform.
affects: >=0.5.2
gotchaLinux Python wheels for PyOxigraph, starting from v0.5.2, are built with a dependency on Glibc 2.28 or newer. This can cause runtime errors on older Linux distributions.
fix
If you encounter Glibc version errors, either upgrade your Linux distribution to one that provides Glibc 2.28+, or build `pyoxigraph` from source on your system to link against your existing Glibc version. Building from source requires a Rust toolchain and C++20 compiler.
affects: >=0.5.2
gotchaFor complex SPARQL queries, especially those involving `FROM` or `FROM NAMED` clauses, the `QueryEvaluator.prepare` method (introduced in v0.5.1) is the recommended approach over direct `QueryEvaluator.execute`. Using `QueryEvaluator.execute` might not correctly account for `FROM` clauses.
fix
For advanced querying scenarios, utilize `QueryEvaluator.prepare()` to pre-process your query, allowing for variable injection and proper handling of dataset clauses. Then, execute the prepared query. Refer to the documentation for `QueryEvaluator` usage.
affects: >=0.5.1
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pyoxigraph'
The pyoxigraph library is not installed in your current Python environment.
fix
Run `pip install pyoxigraph` to install the library.
error: C++ compiler support for C++20 is required
During installation (especially if pre-built wheels are unavailable), the underlying RocksDB dependency failed to compile because your C++ compiler does not support the C++20 standard.
fix
Upgrade your C++ compiler. For example, use GCC version 10 or newer, Clang version 11 or newer, or MSVC 19.28 (Visual Studio 2019 version 16.8) or newer.
ImportError: /lib64/libc.so.6: version 'GLIBC_2.28' not found (required by .../pyoxigraph.cpython-3x-xxxx.so)
You are trying to run a pre-built pyoxigraph wheel on a Linux system with a Glibc version older than 2.28.
fix
Upgrade your Linux distribution to one that provides Glibc 2.28 or newer (e.g., Ubuntu 20.04+, Debian 10+). Alternatively, you can try to build `pyoxigraph` from source, which will link against your system's Glibc, but requires a Rust toolchain and C++20 compiler.
Upgrade
Version history
0.5.8latest on PyPI · released Apr 28, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
6
Resources
pyoxigraph — pip install pyoxigraph · libregistry