From 0077fa3983984b6a9f1951581391ecdd936cbf98 Mon Sep 17 00:00:00 2001
From: Simon Steyskal List Expressions
The following example declares a property for instances of rdfs:Class
where the values are derived from the values of the path rdfs:subClassOf*
but with the constants from the list ( owl:Thing rdfs:Resource ) removed using
- shnex:minus.
+ shnex:remove.
-
-
-
+
A blank node that is the subject of the following properties
- is called a union expression with the function name shnex:UnionExpression:
+ is called a join expression with the function name shnex:JoinExpression:
Property
@@ -1242,7 +1242,7 @@ Union Expressions
-
+ shnex:unionshnex:join
A well-formed SHACL list where each member is a well-formed node expression.
@@ -1254,10 +1254,10 @@ Union Expressions
- Let members be the members of the value of shnex:union in the union expression.
+ Let members be the members of the value of shnex:join in the join expression.
The output nodes of the union expression are the concatenation of all output nodes
for each node expression NE in members, using evalExpr(NE, focusGraph, focusNode, scope).
The order is preserved, evaluating the members from left to right and keeping the order of each list of output nodes.
@@ -1269,16 +1269,16 @@
- The Example for shnex:distinct uses shnex:union.
+ The Example for shnex:distinct uses shnex:join.
-
+
A blank node that is the subject of the following properties
- is called a minus expression with the function name shnex:MinusExpression:
+ is called a remove expression with the function name shnex:RemoveExpression:
Property
@@ -1287,7 +1287,7 @@ Minus Expressions
-
+ shnex:minusshnex:remove
A well-formed node expression.
@@ -1308,21 +1308,21 @@ Minus Expressions
- Let minus be the value of shnex:minus
- and nodes be the value of shnex:nodes in the minus expression.
- Let M be the output nodes of evalExpr(minus, focusGraph, focusNode, scope).
+ Let toRemove be the value of shnex:remove
+ and nodes be the value of shnex:nodes in the remove expression.
+ Let M be the output nodes of evalExpr(toRemove, focusGraph, focusNode, scope).
Let N be the output nodes of evalExpr(nodes, focusGraph, focusNode, scope).
- The output nodes of the minus expression are the nodes in N
+ The output nodes of the remove expression are the nodes in N
except those that are also in M, preserving the order of N.
- Nodes must be equal using term equality, i.e. "01"^^xsd:integer is distinct from "1"^^xsd:integer.
+ Nodes must be equal using term equality, i.e., "01"^^xsd:integer is distinct from "1"^^xsd:integer.
The remainder of this section is informative.
- The List Expression example uses shnex:minus.
+ The List Expression example uses shnex:remove.
+ This section describes advanced node expression functions for sequence manipulation, + providing enhanced operations for complex sequence processing scenarios. +
+ +
+
+ A blank node that is the subject of the following properties
+ is called a flatMap expression with the function name shnex:FlatMapExpression:
+
+
+
+
+ Property
+ Constraints
+ Description
+
+
+
+
+
+ shnex:flatMap
+ A well-formed node expression.
+
+
+ The node expression that is applied to each input node.
+
+
+
+
+
+ shnex:nodes
+ A well-formed node expression.
+
+
+ The input nodes. If omitted, defaults to the focus node.
+
+
+ Let mapper be the value of shnex:flatMap
+ and nodes be the value of shnex:nodes in a flatMap expression.
+ If shnex:nodes is not specified, let nodes be the focus node.
+ Let N be the output nodes of evalExpr(nodes, focusGraph, focusNode, scope).
+ For each node n in N, let M_n be the output nodes of
+ evalExpr(mapper, focusGraph, n, scope).
+ The output nodes of the flatMap expression are produced by concatenating all sequences
+ M_n in the order of the corresponding nodes n in N.
+
The remainder of this section is informative.
+
+ The shnex:flatMap operation applies an expression to each input node and flattens the results
+ into a single sequence. This is particularly useful when combining results from multiple path traversals
+ or when working with nested structures.
+
+ The following example illustrates the use of shnex:flatMap to derive a property
+ ex:allSkills that collects all skills from all employees of a company.
+ The flatMap operation applies a path expression to each employee and flattens the resulting
+ skill sequences into a single comprehensive list.
+
+
+
+ A blank node that is the subject of the following properties
+ is called a findFirst expression with the function name shnex:FindFirstExpression:
+
+
+
+
+ Property
+ Constraints
+ Description
+
+
+
+
+
+ shnex:findFirst
+ A well-formed shape.
+
+
+ The shape that the matching node must conform to.
+
+
+
+
+
+ shnex:nodes
+ A well-formed node expression.
+
+
+ The input nodes. If omitted, defaults to the focus node.
+
+
+ Let shape be the value of shnex:findFirst
+ and nodes be the value of shnex:nodes in a findFirst expression.
+ If shnex:nodes is not specified, let nodes be the focus node.
+ Let N be the output nodes of evalExpr(nodes, focusGraph, focusNode, scope).
+ The output nodes of the findFirst expression contain exactly the first node n
+ in N that conforms to the shape shape,
+ or an empty sequence if no such node exists.
+
The remainder of this section is informative.
+
+ The shnex:findFirst operation finds the first node in a sequence that conforms to a given shape.
+
+ The following example illustrates the use of shnex:findFirst to derive a property
+ ex:seniorEmployee that finds the first employee with more than 5 years of experience.
+ The findFirst operation tests each employee against a shape that validates their years of service.
+
+
+
+ A blank node that is the subject of the following properties
+ is called a matchAll expression with the function name shnex:MatchAllExpression:
+
+
+
+
+ Property
+ Constraints
+ Description
+
+
+
+
+
+ shnex:matchAll
+ A well-formed shape.
+
+
+ The shape that all input nodes must conform to.
+
+
+
+
+
+ shnex:nodes
+ A well-formed node expression.
+
+
+ The input nodes. If omitted, defaults to the focus node.
+
+
+ Let shape be the value of shnex:matchAll
+ and nodes be the value of shnex:nodes in the matchAll expression.
+ If shnex:nodes is not specified, let nodes be the focus node.
+ Let N be the output nodes of evalExpr(nodes, focusGraph, focusNode, scope).
+ The output nodes of the matchAll expression contain the boolean true if
+ every node n in N conforms to the shape shape;
+ otherwise the output contains the boolean false.
+
The remainder of this section is informative.
+
+ The shnex:matchAll operation returns true if all nodes in a sequence conform to a given shape,
+ false otherwise.
+
+ The following example illustrates the use of shnex:matchAll to derive a property
+ ex:allEmployeesActive that checks whether all employees of a company are currently active.
+ The matchAll operation tests each employee against a shape that validates their active status.
+
+
@@ -3114,4 +3118,4 @@