Modelling Stub · Updated 2026-05-14

SHACL shapes

Validation rules expressed as SHACL — generated programmatically from JSON Schema constraints, with manual additions for cross-property business rules.

Status

This is a stub for upcoming work. The structure below is what we plan to populate; existing artefacts in source/ that feed it are cited inline.

Why SHACL alongside JSON Schema?

JSON Schema validates JSON documents. SHACL validates RDF graphs. PDTF v2.0 is built on W3C VC, which is fundamentally graph-shaped. Both tools serve different audiences:

Generation pipeline

flowchart LR classDef src fill:#eef4f8,stroke:#1a4d80,color:#0b2545; classDef proc fill:#fef3c7,stroke:#b45309,color:#7c2d12; classDef out fill:#dcfce7,stroke:#166534,color:#14532d; JS[JSON Schema v3
+ overlays]:::src ONT[Ontology .ttl]:::src GEN[Translator
schema → SHACL]:::proc HAND[Hand-authored
business rules]:::src SHAPES[SHACL .ttl
per overlay]:::out JS --> GEN ONT --> GEN GEN --> SHAPES HAND --> SHAPES
Mechanical translation of JSON Schema constraints + hand-authored cross-property rules.

What translates mechanically

Most JSON Schema constraints have direct SHACL equivalents:

JSON SchemaSHACL
requiredsh:minCount 1
typesh:datatype / sh:nodeKind
enumsh:in
patternsh:pattern
minimum / maximumsh:minInclusive / sh:maxInclusive
minLength / maxLengthsh:minLength / sh:maxLength

What needs hand-authoring

Target folder: source/00-deliverables/semantic-models/shapes/.