diff --git a/shacl12-core/index.html b/shacl12-core/index.html index 30116226..21665505 100644 --- a/shacl12-core/index.html +++ b/shacl12-core/index.html @@ -851,7 +851,7 @@

Shapes and Constraints

sh:name : xsd:string or rdf:langString
sh:description : xsd:string or rdf:langString
-
sh:defaultValue : any
+
sh:defaultValue : any
sh:group : sh:PropertyGroup
@@ -1422,25 +1422,24 @@

Property Shapes

A property shape is a shape in the shapes graph that is the subject of a triple that has sh:path as its predicate. A shape has at most one value for sh:path. -

- The value of sh:path in a property shape is either a well-formed - SHACL property path or a well-formed node expression. - The syntax rules for SHACL property paths take precedence over node expressions; - for example, this means that an IRI will be interpreted as a predicate path instead of an IRI expression. - The value of sh:path cannot be a literal. + The value of sh:path in a property shape is a well-formed + SHACL property path.

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. +

+ A property shape has at most one value for the property sh:values and this value is a well-formed node expression. + A property shape has at most one value for the property sh:defaultValue and this value is a well-formed node expression. + A property shape can only have values for sh:values and/or sh:defaultValue when its value for sh:path is a Predicate 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:

@@ -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 + + 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:

-
-
EVALUATION OF NODE EXPRESSIONS
- The evaluation of a node expression is defined as a function eval(expr, activeGraph, scope) -> outputNodes - where - - 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. -

- This SHACL Core specification only defines exactly the node expression functions from the following two sections. + This SHACL Core specification only exactly defines the node expression functions from the following two subsections. Other specifications such as [[shacl12-sparql]] introduce additional functions. Therefore node expressions serve as an extension point of SHACL. TODO: Add link to shacl12-node-expr once that is stable. @@ -2064,10 +2065,13 @@

Focus node (sh:focusNode)

Path (sh:resultPath)

- Validation results may have a value for the property sh:resultPath pointing at a well-formed SHACL property path - or node expression. + Validation results may have a value for the property sh:resultPath pointing at a well-formed SHACL property path. For results produced by a property shape, this SHACL property path is equivalent to the value of sh:path of the shape, unless stated otherwise. + If the sh:path p is a blank node, then the sh:resultPath is a "deep copy" + of p and any triples that can be reached by transitively traversing the blank nodes + that appear in the object position of these triples. + See the Concise Bounded Description.

@@ -2142,22 +2146,23 @@

Value Nodes of Node Shapes

Value Nodes of Property Shapes

For property shapes with a value for sh:path p the - value nodes are defined as follows. -

-

- If p is a SHACL property path, then its value nodes are the set of nodes in the data graph - that can be reached from the focus node with the path mapping of p. -

-

- If p is a node expression, then its value nodes are the set of output nodes of - eval(p, data graph, scope) where scope contains the focus node as value of the variable focusNode. -

-

- Unless stated otherwise, the value of sh:resultPath of each validation result is a "deep copy" - of p and any triples that can be reached by transitively traversing the blank nodes - that appear in the object position of these triples. - See the Concise Bounded Description. + set of value nodes is produced by the following steps:

+
    +
  1. + Add all nodes in the data graph that can be reached from the focus node with the path mapping of p. +
  2. +
  3. + If e is the value of sh:values at the property shape, + then add the output nodes of eval(e, data graph, scope) where scope + contains the focus node as the value of the variable focusNode. +
  4. +
  5. + If the set is still empty and d is the value of sh:defaultValue at the property shape, + then add the output nodes of eval(d, data graph, scope) where scope + contains the focus node as the value of the variable focusNode. +
  6. +
@@ -4133,16 +4138,6 @@

sh:group

Groups may also have an sh:order property to indicate the relative ordering of groups within the same form.

- -
-

sh:defaultValue

-

- Property shapes may have a single value for sh:defaultValue. - The default value does not have fixed semantics in SHACL, - but MAY be used by user interface tools to pre-populate input widgets. - The value type of the sh:defaultValue SHOULD align with - the specified sh:datatype or sh:class of the same shape. -

The following example illustrates the use of these various features together.

@@ -4315,7 +4310,7 @@

Revision History

Changes between SHACL 1.0 Core and SHACL 1.2 Core

    -
  • Introduced node expressions as an extension point to dynamically compute lists of nodes. Generalized sh:targetNode and sh:path to support node expressions.
  • +
  • Introduced node expressions as an extension point to dynamically compute lists of nodes. Generalized sh:targetNode and sh:defaultValue, and introduced sh:values to support node expressions.
  • Added the new constraint component sh:singleLine, see Issue 177
  • Moved SPARQL-based validators from Core to an Appendix of SHACL-SPARQL, see Issue 271
diff --git a/shacl12-sparql/index.html b/shacl12-sparql/index.html index 0304cff0..c0d2a62e 100644 --- a/shacl12-sparql/index.html +++ b/shacl12-sparql/index.html @@ -1246,14 +1246,15 @@

Select Expressions