SHACL Flashcards
(10 cards)
What is SHACL?
The W3C Shapes Constraint Language for defining and validating structural and value constraints on RDF graphs.
Components of a SHACL NodeShape?
Shape name, targets (class/node/predicate-based), and property constraints.
How to target all instances of a class?
Use sh:targetClass with the class IRI on a NodeShape.
How to enforce exactly one property value?
In sh:property, set sh:minCount 1 and sh:maxCount 1 on the sh:path.
How to enforce a property’s datatype?
Include sh:datatype with the appropriate XSD type in the property shape.
How to restrict allowed values to a set?
Use sh:in with a list of permissible RDF terms.
How to specify node kind (IRI, Literal)?
Use sh:nodeKind with sh:IRI, sh:Literal, or sh:BlankNode values.
How to combine or negate shapes?
Use logical constraints sh:and, sh:or, and sh:not.
How to limit unknown properties?
Set sh:closed true and list exceptions with sh:ignoredProperties.
How are recursive shapes validated?
Through a fixpoint assignment process that ensures consistent node-shape mappings.