Building Blocks can be defined to reuse existing JSON schemas in a more sophisticated way.
A re-used schema can be:
- profiled (by extension or constraints)
- Mapped to a semantic (RDF) model allowing richer specification of constraints.
- Tested with examples and test cases.
This is simply a matter of referencing the reused schema in the building block schema(.json|.yaml):
{ "$ref": "http://somestablelocation.org/schema.json" }
this is done in a two-step process:
- in the (_bblocks-config.yaml)[_bblocks-config.yaml] file tell the processing where to find building block registers:
schema-mapping:
default: https://opengeospatial.github.io/bblocks/annotated-schemas/
imports:
- default
- https://opengeospatial.github.io/ogcapi-sosa/build/register.json
The default is the OGC master register of building blocks.
- use the bblocks:{id} syntax as href in schema $ref elements.
This means your building block will inherit all json-ld contexts and SHACL rules from the referenced building block automatically and apply during testing.