methodatlas
RunsheetKnowledge Modeling

Shape-First Modeling

ComplexityMedium
TimeHalber Tag pro Domain Slice
Participants1-4
FormatWorkshop + async
MaturityEstablished
01

Prerequisite

What needs to be finished first

Complete firstCompetency Questions

A question set with must-have questions and required data per question exists, so shapes can fix the properties needed for answers as constraints.

Without: Without questions, shapes model desired structures that real data does not follow, making validation reports unusable.
02

Preparation

What needs to be ready before start

Materials

Shapes editor (Protégé with SHACL plugin, TopBraid, Stardog Studio) or text editor with Turtle highlighting; SHACL validator (for example pySHACL, Apache Jena SHACL, TopBraid); sample data as Turtle; repo with shapes/ folder; CI validation.

People / roles

One shapes modeler (lead); one domain expert per class; one data producer (owner of data source) for reality check; one data consumer for expectations on the contract.

Pre-read

Class list with priority; sample data per class (at least 50 instances per top class); known data-quality issues; reuse plan for external vocabularies; license and language.

Time needed

Half day per domain slice (4 h)

Setup

Repo with shapes/, data/ and tests/. Validator integrated into CI. Sample data loaded. One slot per class in the workshop plan, with domain expert available.

03

Core question

The one question this method answers

Which shapes define required properties, data types, cardinalities and relationships so that real data becomes validatable and contracts between producer and consumer are unambiguous?

04

Flow

Marker: Phase

StepDurationActionHint
1Phase 1: Prioritize classes
30 minSelect the most important 3-5 node classes for the first slice, based on CQs and data flow. Note owner, sample-data path and known issues per class.Trying to model everything at once delivers nothing validatable. Keep the slice small and extend in later iterations.
2Phase 2: Required properties
60 min per classPer class: property list with sh:path, sh:datatype, sh:minCount, sh:maxCount, sh:nodeKind. Explicitly mark required properties (minCount 1) as contract anchors.If required properties appear in less than 80% of real data, either the requirement is wrong or the data source is broken. Clarify before closing.
3Phase 3: Relationships and cardinalities
45 min per classProperties with class range (sh:class) for references. Cardinality per relationship. sh:or for alternative target classes where needed. Explicitly check self-references and cycles.Cardinality 1..* is often too lax. If no minimum amount is defined, empty lists pass. If the domain requires at least 2, set sh:minCount 2.
4Phase 4: Validate against sample data
30-45 min per classRun validator against sample data. Review violations: legitimate data error or too-strict shape? Document decision per violation (loosen shape, fix data source, exception).If 30% of sample instances trigger violations, the shape is not production-ready. Either loosen it with rationale or contact the data owner.
5Phase 5: Version shapes and integrate into pipeline
30 minCommit shape file, tag version (for example shapes/v0.3/Service.ttl). Set up CI job that validates on data updates or shape updates. Store validation report as artifact.Without CI integration, shapes are leftover cloth. CI must run shapes on every data PR (or ETL run) and enforce broken builds.
6Phase 6: Documentation as data contract
20 minExport shape per class as human-readable table (property, required, type, cardinality, note). Store in repo under docs/shapes/. Review with data producers and consumers.Shapes as TTL are readable for modelers, not for data producers. Without table documentation, the producer does not understand the contract.
05

Artifact

What comes out at the end

Form

shapes/ directory with SHACL or ShEx files per class, validation-report directory, human-readable documentation tables per shape, CI job configuration and changelog for shape versions.

Versioning / ownership

Shapes with their own SemVer (major for breaking contract changes). Each release has a changelog listing loosened/tightened constraints. Migration notes for producers documented.

Tool alternatives
  • Apache Jena SHACL or pySHACL for CLI/CI
  • TopBraid SHACL Engine for enterprise setups
  • Stardog Studio with SHACL editor
  • RDF4J Workbench for interactive testing

shape-first-modeling-working-template.md

Compact working template for Shape-First Modeling with context, input, output artifacts, and next step.

Shape-First Modeling Working Template

Goal

Modeling approach that defines data shapes and constraints before open ontology semantics.

Context

When and for what do we use this method?

Input

Which data, observations, decisions, or materials are available?

Execution

Short notes along the runsheet.

Output artifacts

  • SHACL or ShEx shapes:
  • Validation reports:
  • Data contracts:
  • Shape documentation:

Assumptions and open questions

  • ...

Decision / next step

Owner, date, and success signal.

06

Example output

Concrete filled scenario, fictional example

shape-first-modeling-beispiel.md

Concrete filled scenario, fictional example

Shape-First — Service class (v0.3, 2026-05-18)

Example SHACL (excerpt):

:ServiceShape a sh:NodeShape ;
  sh:targetClass :Service ;
  sh:property [ sh:path :name ; sh:datatype xsd:string ; sh:minCount 1 ; sh:maxCount 1 ] ;
  sh:property [ sh:path :tier ; sh:in ("critical" "standard" "experimental") ; sh:minCount 1 ] ;
  sh:property [ sh:path :owner ; sh:class :Team ; sh:minCount 1 ; sh:maxCount 1 ] ;
  sh:property [ sh:path :dependsOn ; sh:class :Service ; sh:minCount 0 ] .

Validation report (sample data as of 2026-05-18):

  • 312 Service instances checked.
  • 14 violations: 11x missing :owner (legacy service area), 3x invalid :tier value "prod".
  • Decisions: Legacy service as separate subclass :LegacyService with loosened owner constraint. Value "prod" mapped to "critical" in ETL.

Documentation table (excerpt):

PropertyRequiredTypeCardinalityNote
nameyesstring1..1Unique, kebab-case
tieryesenum1..1critical / standard / experimental

Maintenance: Owner @marcus, quarterly review. Breaking-change notice period 60 days after announcement.

07

Pitfalls

Recognize symptoms and steer against them

Trap

Shapes without real data

Symptom

Shapes are modeled without validating sample data, validation reports only appear in production.

What to do

Validate every shape iteration immediately against at least 50 real instances. Violations are learning data, not bug reports.

Trap

Too-strict constraints

Symptom

More than 30% of sample data triggers violations, ETL pipeline breaks in production.

What to do

Use strict constraints in several severities (sh:Violation, sh:Warning, sh:Info). Start as warning, then tighten in later release.

Trap

Shapes without documentation

Symptom

TTL files exist, but data producers do not understand the contract and keep delivering the wrong format.

What to do

Shape-to-table generator (for example SHACL Play or custom script) in CI. Documentation PR is mandatory for shape changes.

Trap

No CI validation

Symptom

Shapes exist, but nobody checks data PRs against them. Violations land in production.

What to do

CI job that runs validator on every data or shape PR. Failed validation = blocked PR. Shape changes require migration notes.

Trap

Shape version chaos

Symptom

Producer and consumer work with different shape versions, nobody knows which one applies.

What to do

SemVer for shapes, version IRI in every shape file. Producers pin a concrete version, update as deliberate step.

Trap

Only structural shapes, no value ranges

Symptom

Shapes check only type and cardinality, not allowed values. Producer sends status "prod" instead of "production".

What to do

Use value lists (sh:in) and patterns (sh:pattern) consistently where values are bounded. ETL mappings where needed, but not instead of shape.

08

Stop criteria

Done signals checkable in under a minute

No sample data available, shapes would be wish models.
Data source is unstable or changes structure weekly, shapes would become permanent construction.
No CI or validator infrastructure can be set up, shapes would remain dead in the repo.
Data flow demands schema-on-read without quality expectations, shape overhead is not justified.
Producer team refuses to honor the contract, shapes would have no political enforcement.
Modeling is exploratory (prototype < 1 month), contract constraints would slow iteration.

Finished the runsheet?

Go to the profile for purpose, similar methods, and sources or continue to the next method in the catalog.