Registry / database / oxrdflib

oxrdflib

JSON →
library0.5.0pypypi✓ verified 84d ago

rdflib stores based on pyoxigraph. Version 0.5.0 requires Python >=3.8, upgrades pyoxigraph to 0.5, adds JSON-LD support, and improves SPARQL query behavior. Development is active on GitHub.

pip install oxrdflib
INSTALL
IMPORT
SIG · OXRDFLIB
O
oxrdflib
databasepythonv0.5.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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

OxigraphStore
from oxrdflib import OxigraphStore
from oxrdflib.store import OxigraphStore
OxigraphStore is a top-level export; don't use the old submodule path.
Oxigraph
from oxrdflib import Oxigraph
from oxgraph import Oxigraph
The store class is 'OxigraphStore' in oxrdflib; 'Oxigraph' might be a different library.

Create an rdflib Graph backed by Oxigraph in-memory store. Parse and query RDF.

from rdflib import Graph from oxrdflib import OxigraphStore g = Graph(store=OxigraphStore()) g.parse("example.ttl", format="turtle") print(len(g)) # Query g.update("INSERT DATA { <http://example.com/s> <http://example.com/p> <http://example.com/o> .}") results = g.query("SELECT * WHERE {?s ?p ?o}") for row in results: print(row)
Debug
Known issues
breakingIn v0.3.0, the 'OxSled' and 'OxMemory' stores were removed and replaced by the 'Oxigraph' store. On-disk storage now uses RocksDB; migrate by dumping data with v0.2, upgrade, then reload.
fix
Use OxigraphStore() for both in-memory and on-disk. To persist data, specify a path: OxigraphStore(path='/path/to/db').
affects: >=0.3.0
deprecatedThe legacy format names 'ox-ttl', 'ox-nt', etc. are still supported but the new format names 'ox-turtle', 'ox-n-triples' are preferred and may become default in future releases.
fix
Use 'ox-turtle' instead of 'ox-ttl', 'ox-n-triples' instead of 'ox-nt', etc.
affects: >=0.4.0
gotchaNamespaces set via bind() are not persisted to disk. They are only available for the current session.
fix
Re-bind namespaces after reloading a store, or store prefix mappings separately.
affects: all
gotchaThe store does not fully implement all rdflib store methods; some operations (e.g., context management) may behave differently. Test your code thoroughly.
fix
Review oxrdflib's GitHub issues and test your usage; consider using raw pyoxigraph for advanced features.
affects: all
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'oxrdflib'
oxrdflib is not installed.
fix
pip install oxrdflib
ImportError: cannot import name 'OxigraphStore' from 'oxrdflib'
Version mismatch; OxigraphStore was added in v0.1.0.
fix
Update oxrdflib to the latest version: pip install --upgrade oxrdflib
AttributeError: 'OxigraphStore' object has no attribute 'query'
Query is performed on the Graph object, not the store directly.
fix
Use graph.query() instead of store.query(). See quickstart example.
Upgrade
Version history
0.5.0latest on PyPI · released Sep 13, 2025
Audit
Dependencies
pyoxigraphrequiredCore storage backend, version >=0.5
rdflibrequiredRDF library interface, version >=6.2
Agent activity
4 hits · last 30 days
node
4
Resources
oxrdflib — pip install oxrdflib · libregistry