By default, SHACL shapes are open — they validate the properties they know about and silently ignore any extra properties on an instance. This mirrors OWL's Open World Assumption where unknown data is simply information you haven't seen yet.
sh:closed true flips this to strict mode: any property on an instance that isn't explicitly listed in the shape causes a validation violation.
sh:closed true
# Open shape — ignores unexpected properties nws:CustomerShape a sh:NodeShape ; sh:targetClass nwo:Customer ; sh:property [ sh:path nwo:companyName ; sh:datatype xsd:string ] ; sh:property [ sh:path nwo:contactName ; sh:datatype xsd:string ] . # ↓ A Customer with an extra "nickname" property → passes validation (ignored)
# Closed shape — rejects unexpected properties nws:CustomerShape a sh:NodeShape ; sh:targetClass nwo:Customer ; sh:closed true ; sh:ignoredProperties ( rdf:type ) ; sh:property [ sh:path nwo:companyName ; sh:datatype xsd:string ] ; sh:property [ sh:path nwo:contactName ; sh:datatype xsd:string ] . # ↓ A Customer with an extra "nickname" property → VIOLATION!
When sh:closed true is set, every property not in the shape triggers a violation — including rdf:type. But every RDF instance has rdf:type (that's how we know it's a Customer in the first place). So we need a strategy for handling these well-known properties.
rdf:type
The traditional approach simply lists properties to skip during validation:
sh:ignoredProperties ( rdf:type rdfs:label ) ;
This tells SHACL: "Don't complain about these properties." The downside: you lose the ability to enforce them (e.g., require every resource to have an rdfs:label).
rdfs:label
RDF Studio now uses a smarter approach — instead of ignoring annotation properties, it enforces them with configurable severity:
# Instead of ignoring rdf:type, require it: sh:property [ sh:path rdf:type ; sh:minCount 1 ; # Required sh:severity sh:Violation ; # Missing rdf:type is an error ] ; # Require rdfs:label at warning level: sh:property [ sh:path rdfs:label ; sh:minCount 1 ; sh:severity sh:Warning ; # Missing label is a warning, not an error ] ;
This gives you fine-grained control: you can require rdf:type (violation if missing), recommend rdfs:label (warning if missing), or ignore properties that are optional.
See the Annotation Property Rules guide for the full details.
nwo:comapnyName
Consider a Northwind Employee with some unexpected extra properties:
Employee
nwr:employee-1 a nwo:Employee ; nwo:firstName "Nancy" ; nwo:lastName "Davolio" ; nwo:title "Sales Representative" ; nwo:birthDate "1948-12-08"^^xsd:date ; foaf:nickname "Nan" ; # ← Extra property from FOAF schema:jobTitle "Sales Rep" . # ← Extra property from Schema.org
The validator reports TWO violations:
foaf:nickname
EmployeeShape
schema:jobTitle
This catches potential data quality issues — maybe these properties should be in the ontology, or maybe they're mistakes.
The validator only checks the properties it knows about:
firstName
lastName
title
birthDate
No violations. The extra properties are invisible to validation.
RDF Studio makes sh:closed configurable through a toggle in the SHACL generation dialog:
sh:closed
sh:ignoredProperties
RDF Studio defaults to closed shapes because:
The choice between open and closed shapes dramatically affects your validation report:
The last two rows show the critical difference. Open shapes silently accept both legitimate cross-vocabulary properties AND accidental typos. Closed shapes catch both — which is usually what you want for data validation, even if it means a few false positives from intentional cross-vocabulary usage.
A pragmatic workflow:
This gives you maximum visibility first, then you selectively relax constraints where appropriate.