implements resolution for ISSUE-100 ldpatch
authorAlexandre Bertails <alexandre@bertails.org>
Mon, 24 Nov 2014 13:55:17 -0500
branchldpatch
changeset 914 88bfaff0ca03
parent 913 cd2b89e3cdc8
child 915 a61e98c879f0
implements resolution for ISSUE-100
ldpatch.html
--- a/ldpatch.html	Sun Nov 23 21:58:27 2014 +0100
+++ b/ldpatch.html	Mon Nov 24 13:55:17 2014 -0500
@@ -292,15 +292,15 @@
     profile:image &lt;https://example.org/timbl.jpg&gt; .
 } .
 
-Bind ?workLocation &lt;#&gt; /schema:workLocation .
+Bind ?workLocation &lt;#&gt;/schema:workLocation .
 Cut ?workLocation .
 
 UpdateList &lt;#&gt; ex:preferredLanguages 1..2 ( "fr-CH" ) .
 
-Bind ?event &lt;#&gt; /schema:attendee[/schema:url = &lt;https://www.w3.org/2012/ldp/wiki/F2F5&gt;]  .
+Bind ?event &lt;#&gt;/schema:attendee[/schema:url=&lt;https://www.w3.org/2012/ldp/wiki/F2F5&gt;]  .
 Add { ?event rdf:type schema:Event } .
 
-Bind ?ted &lt;http://conferences.ted.com/TED2009/&gt; /^schema:url! .
+Bind ?ted &lt;http://conferences.ted.com/TED2009/&gt;/^schema:url! .
 Delete { ?ted schema:startDate "2009-02-04" } .
 Add {
   ?ted schema:location [
@@ -446,23 +446,26 @@
       <section id="path-expression">
         <h2><dfn>Path Expression</dfn></h2>
         <p>
-            A <a>Path expression</a> can be used to locate RDF nodes within the <a>target graph</a>. A path expression consists of a series of one or more <a>Step</a>s or <a>Constraint</a>s, separated by "<code>/</code>", and optionally beginning with "<code>/</code>". The main goal is to allow addressing a blank node by “walking” the arcs of the graph from an already identified node. This is done by applying in order each <a>Step</a> or <a>Constraint</a> to a set of nodes <var>N</var>.
+            A <a>Path expression</a> can be used to locate RDF nodes within the <a>target graph</a>. A path expression consists of a series of one or more <a>Step</a>s (introduced by a "<code>/</code>") or <a>Constraint</a>s, which are applied in order from left to right. The main goal is to allow addressing a blank node by “walking” the arcs of the graph from an previously identified node.
+        </p>
+        <p>
+            <code>/</code> behaves like a left-associated operator where the left operand is a node set, the right operand is a <a>Step</a>, and the result is a node set. A <a>Constraint</a> behaves like a predicate function whose implicit parameter is the node set on which it is applied. In the context of a <a>Filter</a>, this implicit node set becomes the left operand for <code>/</code>.
         </p>
         <p>
             A <dfn>Step</dfn> can be of three kinds:
         </p>
         <ul>
-            <li>A <dfn>StepForward</dfn> is defined by an IRI <var>p</var>, and consists in following the corresponding outgoing arcs: <var>N</var> is replaced by the set of the objects of all triples from the <a>target graph</a> with predicate <var>p</var> and their subject in <var>N</var>.</li>
-          <li>A <dfn>StepBackward</dfn> is defined by an IRI <var>p</var> preceded with the caret ("<code>^</code>") sign, and consists in following the corresponding incoming arcs: <var>N</var> is replaced by the set of the subjects of all triples from the <a>target graph</a> with predicate <var>p</var> and their object in <var>N</var>.</li>
-          <li>A <dfn>StepAt</dfn> is defined by an integer <i>n</i>, and consists in following <var>n</var> <code>rdf:rest</code> arcs and one <code>rdf:first</code> arc in order to reach the corresponding member of an RDF collection. It is equivalent to a sequence of <var>n</var>+1 <a>StepForward</a>s with the corresponding IRIs.</li>
+            <li>A <dfn>StepForward</dfn> is defined by an IRI, and consists in following the corresponding outgoing arcs in the <a>target graph</a>.</li>
+            <li>A <dfn>StepBackward</dfn> is defined by an IRI preceded by the caret ("<code>^</code>") sign, and consists in following the corresponding incoming arcs <em>in reverse</em> in the <a>target graph</a>.</li>
+            <li>A <dfn>StepAt</dfn> is defined by an integer <i>n</i>, and consists in following <var>n</var> <code>rdf:rest</code> arcs and one <code>rdf:first</code> arc in order to reach the corresponding member of an RDF collection. It is equivalent to a sequence of <var>n</var>+1 <a>StepForward</a>s with the corresponding IRIs.</li>
         </ul>
         <p>
-A <dfn>Constraint</dfn> can be of two kinds:
+            A <dfn>Constraint</dfn> can be of two kinds:
         </p>
         <ul>
-          <li>A <dfn>Unicity constraint</dfn>, described by the <em>bang</em> ("<code>!</code>") character, checks that <var>N</var> contains exactly one node. If this is not the case, <var>N</var> is replaced by the empty set (which triggers the Path Expression to fail).</li>
-          <li>A <dfn>Filter</dfn>, consisting of a path <var>p</var> in square brackets ("<code>[</code>", "<code>]</code>"), keeps only nodes that “satisfy” the enclosed path, i.e. those from which the enclosed path reaches at least one node: <var>N</var> is replaced by the subset of its elements <var>n</var> such that applying <var>p</var> to {<var>n</var>} results in a non-empty set. </li>
-          <li>Additionally, the path in a <a>filter</a> can be followed by the equal ("<code>=</code>") sign and a <tref>Value</tref> <var>v</var>. In that case, only the node for which that particular value is reached through the enclosed path are kept: <var>N</var> is replaced by the subset of its elements <var>n</var> such that applying <var>p</var> to {<var>n</var>} results in a set containing <var>v</var>.</li>
+          <li>A <dfn>Unicity constraint</dfn>, described by the <em>bang</em> ("<code>!</code>") character, checks that the current node set contains exactly one node.</li>
+          <li>A <dfn>Filter</dfn>, consisting of a <a>Path expression</a> between square brackets ("<code>[</code>", "<code>]</code>"), keeps only the nodes that “satisfy” the enclosed path, i.e. those from which the enclosed path reaches at least one node.</li>
+          <li>Additionally, the path in a <a>filter</a> can specify an equality constraint with the use of the equal ("<code>=</code>") sign and a <tref>Value</tref>. In that case, only the nodes for which that particular value is reached through the enclosed path are kept.</li>
         </ul>
 
         <p>
@@ -500,7 +503,7 @@
           <p>
               Following the example above, the <a>Bind</a> operation creates a new variable called <code>event</code>, starting from the RDF Term <code>&lt;#&gt;</code> and following the path expression <code>/schema:performerIn[/schema:url = &lt;https://www.w3.org/2012/ldp/wiki/F2F5&gt;]</code> in order to identify the RDF Term to which this variable will be bound to – i.e. <code>_:b2</code> in the <a>target graph</a>.
           <pre class='example'>
-Bind ?event &lt;#&gt; /schema:performerIn[/schema:url = &lt;https://www.w3.org/2012/ldp/wiki/F2F5&gt;] .
+Bind ?event &lt;#&gt;/schema:performerIn[/schema:url=&lt;https://www.w3.org/2012/ldp/wiki/F2F5&gt;] .
           </pre>
           </p>
 
@@ -838,7 +841,7 @@
     <td>[11]</td>
     <td><a href="#grammar-production-path">path</a></td>
     <td>::=</td>
-    <td>('<code class="grammar-literal">/</code>'? <a href="#grammar-production-step">step</a> | <a href="#grammar-production-constraint">constraint</a> )? ( '<code class="grammar-literal">/</code>' <a href="#grammar-production-step">step</a> | <a href="#grammar-production-constraint">constraint</a> )*</td>
+    <td>( '<code class="grammar-literal">/</code>' <a href="#grammar-production-step">step</a> | <a href="#grammar-production-constraint">constraint</a> )*</td>
 </tr>
 <tr id="grammar-production-step">
     <td>[12]</td>
@@ -1150,6 +1153,7 @@
 </table>
 
 
+
     </section>
 
     <section class="appendix" id="media-registration">