It is recommended, but not required, for a property shape to be declared as a SHACL instance of sh:PropertyShape.
SHACL instances of sh:PropertyShape have one value for the property sh:path.
+
Informally, property shapes specify constraints that need to be met with respect to nodes that can be reached from the
- focus node either by directly following a given property (specified as an IRI) or any other SHACL property path,
- specified using sh:path.
+ focus node by either (a) directly following a given property (specified as an IRI), (b) directly following any other SHACL property path
+ (specified using sh:path), (c) evaluating the node expression (specified using sh:values),
+ or, (d) if no other values exist, evaluating the node expression (specified using sh:defaultValue).
- If the sh:path is not a well-formed property path, it must be a node expression
- and the constraints will be validated against the output nodes of this node expression.
- Note that support for node expressions is not required by SHACL Core,
+ Note that support for sh:values and sh:defaultValue is not required by SHACL Core,
but is necessary for extensions such as [[shacl12-sparql]].
@@ -1489,8 +1488,9 @@
SHACL Expressions
SHACL Core supports such expressions in the following features:
+
Property paths can be used at sh:path to derive the value nodes of a property shape.
Node expressions can be used at sh:targetNode to dynamically compute the targets of a shape.
-
Property paths and node expressions can be used at sh:path to derive the value nodes of a property shape.
Node expressions can be used as parameter values of most constraint components to represent constraints that may be different depending on each focus node. TODO: This change needs to be made still.
@@ -1653,21 +1653,37 @@
Node Expressions
Each of these parameters has an IRI.
One of these parameters can be the key parameter that uniquely identifies the function name.
+
+
EVALUATION OF NODE EXPRESSIONS
+ The evaluation of a node expression is defined as a function eval(expr, activeGraph, scope) -> outputNodes
+ where
+
scope is a map from variable names to individual nodes.
+ The value of the variable focusNode (if it exists) is called the input focus node.
+
+
+ The result of the evaluation of a node expression is a list of nodes (possibly empty and with duplicates) called the output nodes.
+ The evaluation may also result in an evaluation failure.
+
- The following example illustrates the syntax of a node expression, used as a blank node value of sh:path:
+ The following example illustrates the syntax of a node expression, used as a blank node value of sh:values: