bblocks-client
A Python client library for working with OGC Blocks registers.
OGC Blocks are reusable specification components that support validation, semantic annotation via JSON-LD, and federation across distributed registers.
Installation
pip install bblocks_client
Optional extras for validation and semantic uplift:
# JSON Schema validation
pip install bblocks_client[jsonschema]
# SHACL validation and semantic uplift (RDF/JSON-LD)
pip install bblocks_client[rdf]
# All extras
pip install bblocks_client[all]
Usage
Loading a register
from ogc.bblocks.register import load_register
register = load_register("https://example.org/bblocks/register.json")
# Look up a block by identifier
bblock = register.get_item_summary("my.org.bblock-id")
Imported registers (dependencies) are loaded automatically. Pass load_dependencies=False to skip this.
Accessing block metadata
get_item_summary() returns a BuildingBlockSummary with lightweight metadata.
get_item_full() fetches the full BuildingBlock, including examples and semantic uplift configuration.
bblock = register.get_item_full("my.org.bblock-id")
print(bblock.name)
print(bblock.status) # Status enum: stable, experimental, etc.
print(bblock.depends_on) # Set of dependency identifiers
print(bblock.ld_context) # URL to JSON-LD context
print(bblock.schema) # Dict of media-type -> schema URL
JSON Schema validation
Requires bblocks_client[jsonschema].
from ogc.bblocks.validate import validate_json
result = validate_json(bblock, {"type": "Feature", ...})
if not result.valid:
print(result.exception)
# Or raise directly:
result.raise_for_invalid()
SHACL validation
Requires bblocks_client[rdf].
from rdflib import Graph
from ogc.bblocks.validate import validate_shacl
graph = Graph().parse("data.ttl")
result = validate_shacl(bblock, graph)
print(result.report)
result.raise_for_invalid()
Semantic uplift (JSON to RDF)
Requires bblocks_client[rdf].
from ogc.bblocks.semantic_uplift import uplift_json
rdf_graph = uplift_json(bblock, {"name": "Alice", ...})
print(rdf_graph.serialize(format="turtle"))
This applies the block's JSON-LD context to the input data, producing an RDF graph. Pre- and post-processing steps (jq, SPARQL, SHACL rules) defined in the block are applied automatically.
License
Apache 2.0
Metadata
Release files for bblocks-client 0.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bblocks_client-0.0.2.tar.gz | 15.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bblocks_client-0.0.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 27.6 kB
Release files / bblocks_client-0.0.2.tar.gz
| Download URL | bblocks_client-0.0.2.tar.gz |
|---|---|
| Size | 15.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7f2a4e3c17cb549cb9d18ccb932496a598a471b72910bfbf8a638f4d1d4353ea
|
|
BLAKE2b-256 checksum How to use checksums |
cf8afc390a1315c750996f51c28fc6e4b035bdbcc32c3b42ab82f84b9ed59c33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Feb 20, 2026.
Transparency logRelease files / bblocks_client-0.0.2-py3-none-any.whl
| Download URL | bblocks_client-0.0.2-py3-none-any.whl |
|---|---|
| Size | 12.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bbaeb068da5f7d77057e07ad639694b4a968fa068c61ce5b23883fa72db7f547
|
|
BLAKE2b-256 checksum How to use checksums |
48530461f2f17b80f7862ad390fe8f441cb33596e1bbd768b249ee8a508da5a0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Feb 20, 2026.
Transparency log