Property constraints

minCount, maxCount, datatype, class.

0/3 done

Theory

Common property constraints:

ConstraintMeaning
sh:minCount nat least n values
sh:maxCount nat most n values
sh:datatype xsd:Teach literal has datatype T
sh:class :Ceach value is an instance of class C

Worked example — multiple constraints

Worked example — combining constraints on one property.

All constraints on the same property go inside a single sh:property blank node. You don't nest — you just list them with ;:

@prefix sh: <http://www.w3.org/ns/shacl#> .

:MasterShape a sh:NodeShape ;
  sh:targetClass :Master ;
  sh:property [
    sh:path :teaches ;
    sh:class :Ninja ;
    sh:minCount 1 ;
    sh:maxCount 3
  ] .

This shape says: every :Master must teach at least 1 and at most 3 things, and each of those things must be a :Ninja. Copy this template, then adapt the path / class / counts for the challenge below.

Reading in progress · 0 of 3 activities done