Skip to content

Commit c42f9b2

Browse files
authored
Late updates from #441 (#446)
1 parent 0fac307 commit c42f9b2

File tree

1 file changed

+51
-45
lines changed

1 file changed

+51
-45
lines changed

shacl12-node-expr/index.html

Lines changed: 51 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -562,10 +562,10 @@ <h3>Document Conventions</h3>
562562
<h2>Getting started with Node Expressions</h2>
563563
<p><em>This section is informative.</em></p>
564564
<p>
565-
SHACL <a>shapes graphs</a> can declare node expressions as values of various properties where dynamic computation is useful,
565+
A SHACL <a>shapes graph</a> can declare node expressions as values of various properties where dynamic computation is useful,
566566
such as <code>sh:targetNode</code>, <code>sh:values</code> and <code>sh:deactivated</code>.
567-
Node expressions are represented by RDF nodes and can be evaluated to produce a list of <a>output nodes</a>.
568-
For example when used at <code>sh:targetNode</code>, a node expression produces the list
567+
A node expression is represented by an RDF node and can be evaluated to produce a list of <a>output nodes</a>.
568+
For example, when used at <code>sh:targetNode</code>, a node expression produces the list
569569
of target nodes of a <a>shape</a>.
570570
When used at <code>sh:values</code>, a node expression produces the derived values for the property specified by <code>sh:path</code>.
571571
</p>
@@ -602,11 +602,11 @@ <h2>Getting started with Node Expressions</h2>
602602
The following diagram illustrates how this node expression is interpreted, from a logical point of view.
603603
During validation, a SHACL processor will determine the <a>target</a> nodes of the shape
604604
by evaluating the <a>filterShape expression</a>.
605-
The filterShape expression, however, first evaluates its input expression, which is specified via <code>sh:nodes</code>
605+
However, the filterShape expression first evaluates its input expression, which is specified via <code>sh:nodes</code>
606606
and is an <a>instancesOf expression</a>.
607-
This will produce all instances of the given class <code>ex:Company</code>.
608-
The <code>sh:filterShape</code> is then applied to all of these instances, to only keep the companies
609-
that <a>conform</a> to the provided <a>shape</a> by having their headquarter in Estonia.
607+
This will produce all instances of the given class, <code>ex:Company</code>.
608+
The <code>sh:filterShape</code> is then applied to all of these instances, to keep only the companies
609+
that <a>conform</a> to the provided <a>shape</a>, by having their headquarters in Estonia.
610610
</p>
611611
<div>
612612
<img
@@ -616,8 +616,8 @@ <h2>Getting started with Node Expressions</h2>
616616
>
617617
</div>
618618
<p>
619-
The same scenario as above can also be expressed using SPARQL <a href="shacl12-sparql#SelectExpression">select expressions</a>.
620-
Specific implementations of the SHACL node expressions may (for example for performance reasons)
619+
The scenario above can also be expressed using SPARQL <a href="shacl12-sparql#SelectExpression">select expressions</a>.
620+
For performance reasons, for example, specific implementations of SHACL node expressions might
621621
internally convert node expressions such as the <code>sh:filterShape</code> above to SPARQL.
622622
</p>
623623
<p>
@@ -688,10 +688,10 @@ <h2>Getting started with Node Expressions</h2>
688688
>
689689
</div>
690690
<p>
691-
A difference between this example and the previous examples about <code>sh:targetNode</code>
691+
One difference between this example and the previous examples about <code>sh:targetNode</code>
692692
is that these node expressions are evaluated against a given <a>focus node</a>.
693-
So when a data visualization needs to render an instance of <code>ex:Company</code>,
694-
the currently displayed company is the <a>focus node</a>, from which the number of employees
693+
This means that when a data visualization needs to render an instance of <code>ex:Company</code>,
694+
the currently displayed company is the <a>focus node</a>, for which the number of employees
695695
will be fetched.
696696
</p>
697697
<p class="todo">Clarify when these derived properties can be used (e.g. in sh:path expressions but not as triples elsewhere)</p>
@@ -705,30 +705,30 @@ <h2>Node Expression Syntax</h2>
705705
<p>
706706
The term <a>node expression function</a> refers to the <em>kind</em> or <em>type</em>
707707
of a <a>node expression</a>.
708-
For example, <code>sh:FilterShapeExpression</code> is a <a>node expression function</a>
708+
For example, <code>sh:FilterShapeExpression</code> is a <a>node expression function</a>,
709709
while a specific instance of this function in the <a>graph</a> is the <a>node expression</a> itself.
710710
</p>
711711
<p>
712712
The most basic node expression functions are <a>constant node expressions</a>, which are either
713-
<a>literals</a> or <a>IRIs</a> and simply evaluate to these constants.
714-
All other node expressions are represented by <a>blank nodes</a> and come in the following two variations.
713+
<a>literals</a> or <a>IRIs</a>, and simply evaluate to these constants.
714+
All other node expressions are represented by <a>blank nodes</a>, and come in the following two variations:
715715
</p>
716716
<ul>
717717
<li>
718-
<a>Named parameter functions</a> are represented by a <a>blank node</a> that is the subject of one or more
718+
A <a>named parameter function</a> is represented by a <a>blank node</a> that is the subject of one or more
719719
triples, including the <a>key parameter</a> of the node expression function.
720720
</li>
721721
<li>
722-
<a>List parameter functions</a> are comparable to traditional functions in, for example, SPARQL
723-
and are represented by a <a>blank node</a> that is the subject of a single triple with a SHACL list as its object.
722+
A <a>list parameter function</a> is comparable to a traditional function in SPARQL, for example,
723+
and is represented by a <a>blank node</a> that is the subject of a single triple with a SHACL list as its object.
724724
</li>
725725
</ul>
726726

727727
<section id="ConstantNodeExpression">
728728
<h3>Constant Node Expressions</h3>
729729
<p>
730730
The <a>node expression functions</a> in this section are called <dfn>constant node expressions</dfn>.
731-
They were introduced in the SHACL Core specification but are repeated here to keep this document self-contained.
731+
They were introduced in the SHACL Core specification and are repeated here to keep this document self-contained.
732732
</p>
733733

734734
<section id="IRIExpression">
@@ -782,22 +782,28 @@ <h3>Named Parameter Functions</h3>
782782
that is represented by a <a>blank node</a> that is the <a>subject</a> of at least
783783
one <a>triple</a> where the <a>predicate</a> can be used to uniquely identify the function,
784784
which is known as the <dfn>key parameter</dfn>.
785+
<p>
786+
The evaluation of a <a>named parameter function</a> can produce any of the following:
785787
</p>
786-
<p>The evaluation of a <a>named parameter function</a> can produce either:
787-
<ul>
788-
<li>zero <a>output nodes</a>, i.e. the empty list</li>
789-
<li>one or more <a>output nodes</a>, i.e. a list of one or more nodes</li>
790-
<li>an <a>evaluation failure</a>, i.e. an (unexpected) error during the evaluation</li>
791-
</ul>
792-
</p>
793-
<p>
794-
For example, the <a>named parameter function</a> <a href="#FilterShapeExpression">sh:FilterShapeExpression</a> has
795-
<code>sh:filterShape</code> as its <a>key parameter</a>.
788+
<ul>
789+
<li>zero <a>output nodes</a>,
790+
i.e., an empty list</li>
791+
<li>one or more <a>output nodes</a>,
792+
i.e., a list of one or more nodes</li>
793+
<li>an <a>evaluation failure</a>,
794+
i.e., an (unexpected) error during the evaluation</li>
795+
</ul>
796+
<p>
797+
For example, the <a>named parameter function</a>
798+
<a href="#FilterShapeExpression"><code>sh:FilterShapeExpression</code></a>
799+
has <code>sh:filterShape</code> as its <a>key parameter</a>.
796800
In this document, key parameters are marked in <b>bold face</b>.
797801
</p>
798802
<p>
799-
Expressions based on <a>named parameter functions</a> often take other <a>node expressions</a>
800-
as arguments, evaluate those input node expressions and then produce a different list of <a>nodes</a>
803+
Expressions based on <a>named parameter functions</a> often
804+
take other <a>node expressions</a> as arguments,
805+
evaluate those input node expressions,
806+
and then produce a different list of <a>nodes</a>
801807
as <a>output nodes</a>.
802808
</p>
803809
<p><em>The remainder of this section is informative.</em></p>
@@ -815,32 +821,32 @@ <h3>List Parameter Functions</h3>
815821
The <a>predicate</a> of this <a>triple</a> is called the <dfn>list parameter property</dfn>.
816822
</p>
817823
<p>
818-
The <a>evaluation</a> of a <a>list parameter function</a> can produce either:
824+
The <a>evaluation</a> of a <a>list parameter function</a> can produce any of the following:
819825
</p>
820826
<ul>
821-
<li>one <a>output node</a>, i.e. a list of one <a>node</a></li>
822-
<li>zero <a>output nodes</a>, i.e. the empty list</li>
823-
<li>an <a>evaluation failure</a>, i.e. an (unexpected) error during the evaluation</li>
827+
<li>one <a>output node</a>, i.e., a list of one <a>node</a></li>
828+
<li>zero <a>output nodes</a>, i.e., an empty list</li>
829+
<li>an <a>evaluation failure</a>, i.e., an (unexpected) error during the evaluation</li>
824830
</ul>
825831
<p>
826-
Furthermore, all arguments of a <a>list parameter function</a> must evaluate to individual <a>nodes</a>
827-
and not lists of nodes.
828-
If an argument is a <a>node expression</a> then this <a>node expression</a> must evaluate to
829-
at most one <a>output node</a>.
832+
Furthermore, each argument of a <a>list parameter function</a> must evaluate to an individual, single <a>node</a>,
833+
not to a list of nodes.
834+
If an argument is a <a>node expression</a>, then this <a>node expression</a> must evaluate to
835+
a maximum of one <a>output node</a>.
830836
An <a>evaluation failure</a> must be produced if there is more than one <a>output node</a>.
831837
This is different from <a>named parameter functions</a>, where arguments may produce lists of multiple nodes.
832838
</p>
833839
<p><em>The remainder of this section is informative.</em></p>
834840
<p>
835-
Note that some <a>named parameter functions</a> such as <code>sh:IntersectionExpression</code>
836-
also use <a>SHACL lists</a> as object of the <a>key parameter</a>, similar to <a>list parameter functions</a> which always have <a>SHACL lists</a> as object of their <a>list parameter property</a>.
837-
However, these may produce more than one <a>output nodes</a> and also accept lists as input nodes.
841+
Note that some <a>named parameter functions</a> &mdash; such as <code>sh:IntersectionExpression</code> &mdash;
842+
also use a <a>SHACL list</a> as an object of the <a>key parameter</a>, similar to <a>list parameter functions</a> which always have a <a>SHACL list</a> as the object of their <a>list parameter property</a>.
843+
However, these may produce more than one <a>output nodes</a>, and also accept lists as input nodes.
838844
</p>
839845
<p>
840-
The following example uses multiple (imaginary) <a>list parameter functions</a>
841-
<code>ex:coalesce</code> and <code>ex:concat</code> to compute the <code>ex:displayName</code>
846+
The following example uses multiple (imaginary) <a>list parameter functions</a> &mdash;
847+
<code>ex:coalesce</code> and <code>ex:concat</code> &mdash; to compute the <code>ex:displayName</code>
842848
of a person as either the value of <code>ex:fullName</code> or (if that doesn't exist)
843-
as the concatenation of first and last names, with a space in between.
849+
as a concatenation of <code>ex:firstName</code>, a space, and <code>ex:lastName</code>.
844850
</p>
845851
<p>
846852
<aside class="example" title="A comple node expression based on list parameter functions.">

0 commit comments

Comments
 (0)