holosdb
An RDF 1.2 triplestore with SPARQL 1.2, where access policy is enforced at the index scan rather than by rewriting queries.
pip install holosdb
from holosdb import Store, Principal, Policy
store = Store() # in memory
store = Store("./var/db") # persistent
store.load("data.trig")
store.load("dump.nq.gz") # gzip: streamed, multi-member safe
for row in store.query("SELECT ?s ?name WHERE { ?s <http://example.com/name> ?name }"):
print(row["s"], row["name"])
Asking a question as somebody
This is the part no other binding in this ecosystem has. A query can carry a principal and a policy, and the answer comes back filtered to what that principal may see:
policy = (Policy()
.deny_predicate("http://example.com/salary", except_role="hr")
.label_graph("http://example.com/reviews", 3))
anyone = Principal.anonymous()
hr = Principal("urn:user:alice", roles=["hr"], clearance=3)
store.query(q, principal=anyone, policy=policy) # no salaries, no reviews
store.query(q, principal=hr, policy=policy) # both
Because the filtering happens at the scan and not above it:
the answer to Q equals the answer Q would have over the sub-dataset the principal may see.
That holds for every query shape without anyone enumerating them. A COUNT cannot leak
the existence of hidden rows, and a FILTER NOT EXISTS cannot probe for them.
Use Policy().fail_closed() when a partial answer would be misread as a complete one — a
compliance report, a reconciliation total — and an error is better than a quiet omission.
What else is here
store.validate("shapes.ttl") # SHACL, {'conforms': False, 'violations': 12, ...}
store.named_graphs()
store.dictionary_size # smaller than you expect: see below
holosdb.geosparql_functions() # 45 of them
holosdb.has_rocksdb() # what this wheel actually contains
GeoSPARQL works through the ordinary query path, so it composes with policy — denying
geo:asWKT makes a spatial join find nothing:
store.query("""
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX uom: <http://www.opengis.net/def/uom/OGC/1.0/>
SELECT ?site WHERE {
?site <http://www.opengis.net/ont/geosparql#asWKT> ?g .
FILTER(geof:sfWithin(?g, geof:buffer(?depot, 5, uom:kilometre)))
}
""")
dictionary_size is reliably smaller than the number of terms — every integer, float,
dateTime and short string is packed into its own 64-bit id and never reaches the dictionary.
A million triples produced 489,479 dictionary entries.
Threading
A Store is safe to share across threads, and the GIL is released around every query
and every load. Concurrent readers genuinely run concurrently rather than taking turns.
What is not here
store.update(...) raises NotImplementedError. There is no SPARQL Update evaluator in
this build — raising is deliberate, because silently accepting an update that did nothing
would be much worse than an error. Writes go through add() and load().
Persistence is compiled into the wheel rather than installed beside it, so
pip install holosdb[rocksdb] is accepted but installs nothing; the published wheels already
have it. PACKAGING.md explains why a Python extra cannot do otherwise, and
has_rocksdb() reports what you actually got.
Licence
MIT or Apache-2.0, at your option.
Release files for holosdb 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| holosdb-0.1.0.tar.gz | 300.9 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| holosdb-0.1.0-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| holosdb-0.1.0-cp39-abi3-manylinux_2_28_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.28+ x86-64 | Details |
| holosdb-0.1.0-cp39-abi3-manylinux_2_28_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.28+ ARM64 | Details |
| holosdb-0.1.0-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details |
| holosdb-0.1.0-cp39-abi3-macosx_10_13_x86_64.whl | CPython 3.9 | abi3 | macOS 10.13+ x86-64 | Details |
Total release size: 28.0 MB
Release files / holosdb-0.1.0.tar.gz
| Download URL | holosdb-0.1.0.tar.gz |
|---|---|
| Size | 300.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c1d72ab3a7c2665040292cadab42f117d9a837ea2e7570bd4adc546ff3b3ebf2
|
|
BLAKE2b-256 checksum How to use checksums |
24ff7403dabd014ece2aae5c0b9789755797fc4898dd6a4dc595f5366e172fbd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / holosdb-0.1.0-cp39-abi3-win_amd64.whl
| Download URL | holosdb-0.1.0-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 5.1 MB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
16fdf821ed03a0f768ba29650672250ccce6cd79e7c54d6bb144cb3d80c43b47
|
|
BLAKE2b-256 checksum How to use checksums |
2d5f7f8390b14a28308b4fff4dd4bbee3f625f1144403c72c4aabdcb2dd9592c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / holosdb-0.1.0-cp39-abi3-manylinux_2_28_x86_64.whl
| Download URL | holosdb-0.1.0-cp39-abi3-manylinux_2_28_x86_64.whl |
|---|---|
| Size | 6.4 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
23c0da337236b759bce7c5d98cdf0db256cf1d7d66cee65248de94946c2abdf4
|
|
BLAKE2b-256 checksum How to use checksums |
67e45a9c544265593a4e44de429879a998fb5758adfd2a4a4f8da73910e8cb4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / holosdb-0.1.0-cp39-abi3-manylinux_2_28_aarch64.whl
| Download URL | holosdb-0.1.0-cp39-abi3-manylinux_2_28_aarch64.whl |
|---|---|
| Size | 5.8 MB |
| Tags | CPython 3.9 Linux glibc 2.28+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
14a037a8abcc01311938767f74a61f2967bc807c5764371da434627fdd1b42ab
|
|
BLAKE2b-256 checksum How to use checksums |
64fdee94cab8a5c343bf3079a854364ead5d1360fce7310da12dfe5046b42cbb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / holosdb-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | holosdb-0.1.0-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 5.0 MB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
6a8086e528568f67036a8b6465018991d408e8d943171b77ed86182bb65e23df
|
|
BLAKE2b-256 checksum How to use checksums |
77e6bd5e6562546e189e3ee0bbaba0a6aa35ff6a169e38dce9dd2b50762c3507
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency logRelease files / holosdb-0.1.0-cp39-abi3-macosx_10_13_x86_64.whl
| Download URL | holosdb-0.1.0-cp39-abi3-macosx_10_13_x86_64.whl |
|---|---|
| Size | 5.4 MB |
| Tags | CPython 3.9 abi3 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
a0a9b76ee0a38ea623f31ef847b5121b1c8e42bd877b9465477b9bf8f9945b11
|
|
BLAKE2b-256 checksum How to use checksums |
44579e2fce16e9a8708a968e2b26513f07cf44938137b1865caa544f63209c2f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 26, 2026.
Transparency log