includes outputs for rdf:list manipulation examples ldpatch
authorAlexandre Bertails <bertails@gmail.com>
Tue, 25 Nov 2014 20:02:27 -0500
branchldpatch
changeset 917 71f27638abd0
parent 916 12d2fb2fa378
child 918 3637285cdca2
includes outputs for rdf:list manipulation examples
ldpatch.html
--- a/ldpatch.html	Mon Nov 24 15:27:52 2014 -0500
+++ b/ldpatch.html	Tue Nov 25 20:02:27 2014 -0500
@@ -201,14 +201,14 @@
   <body>
     <section id='abstract'>
       <p>
-Linked Data Patch Format (LD Patch) defines a language for expressing a sequence of operations to apply to Linked Data resources; it is suitable for use with the HTTP PATCH method. <!-- The "text/ldpatch" media type is used to identify such Patch documents.-->
+Linked Data Patch Format (LD Patch) defines a language for expressing a sequence of operations for patching Linked Data resources; it is suitable for use with the HTTP PATCH method.
       </p>
     </section>
     
     <section id='sotd'>
 
       <p id="alternative-designs">
- 	Although the Linked Data Platform (LDP) Working Group is currently favoring LD Patch, it seeks more input in deciding which format to promote for use in <a href="http://www.w3.org/TR/ldp/#h4_ldpr-HTTP_PATCH">LDP PATCH</a> [[!LDP]] operations on <a href="http://www.w3.org/TR/ldp/#ldprs">RDF Sources</a>.  Other viable candidates include:</p>
+ 	Although the Linked Data Platform (LDP) Working Group is currently favoring LD Patch, it seeks more input in deciding which format to promote for use in <a href="http://www.w3.org/TR/ldp/#h4_ldpr-HTTP_PATCH">LDP PATCH</a> [[!LDP]] operations on <a href="http://www.w3.org/TR/ldp/#ldprs">LDP RDF Sources</a>.  Other viable candidates include:</p>
       
       <ul>
 	<li><a href="http://www.w3.org/TR/sparql11-http-rdf-update/#http-patch">SPARQL 1.1 Update</a> &mdash; already standardized, but quite complex for LDP scenarios</li>
@@ -232,7 +232,7 @@
 This document defines the Linked Data Patch Format (LD Patch), a format for describing changes to apply to Linked Data. It is suitable for use with <a href="http://tools.ietf.org/html/rfc5789">HTTP PATCH</a> [[!RFC5789]], a method to perform partial modifications to Web resources. <!-- The "text/ldpatch" media type is prospectively used to identify such LD Patch documents.-->
       </p>
       <p>
-An instance of the LD Patch language (or LD Patch document) defines a list of operations to be performed against a Linked Data resource, namely the addition or removal of RDF [[!rdf11-concepts]] triples in the graph representing this resource.
+          An instance of the LD Patch language (or LD Patch document) defines a list of operations to be performed against a Linked Data resource, namely the addition or removal of RDF [[!rdf11-concepts]] triples in the graph representing this resource.
       </p>
 
       <p id="relation-sparql-update">
@@ -348,54 +348,114 @@
       <section id="list-manipulation-examples">
           <h2><code>rdf:List</code> manipulation examples</h2>
 
-          <p>
-              This example shows how to <strong id="replace-elements">replace one element</strong> (here the second one) with a new one:
-          </p>
+          <p>All the LD Patch examples in this section are applied against the following RDF graph (target IRI <code>http://example.org/timbl</code>):</p>
 
           <pre class='example'>
-UpdateList &lt;#&gt; ex:preferredLanguages 1..2 ( "fr-CH" ) .
+&lt;#&gt; &lt;http://example.org/vocab#preferredLanguages&gt; ( "lorem" "ipsum" "dolor" "sit" "amet" ).
           </pre>
 
+
+
+          <h3 id="replace-elements">How to replace elements</h3>
+
           <p>
-              This example shows how to <strong id="insert-new-elements">insert new elements</strong> at a specific index (here <code>2</code>):
-          </p>
-
-          <pre class='example'>
-UpdateList &lt;#&gt; ex:preferredLanguages 2..2 ( "fr-CH" "en-US" ) .
-          </pre>
-
-          <p>
-              This example shows how to <strong id="append-elements">append elements</strong> at the end of a collection:
+              This example shows how to replace one element (here the second one) with a new one:
           </p>
 
           <pre class='example'>
-UpdateList &lt;#&gt; ex:preferredLanguages .. ( "fr-CH" "en-US" ) .
+UpdateList &lt;#&gt; &lt;http://example.org/vocab#preferredLanguages&gt; 1..2 ( "fr" ) .
           </pre>
 
+          <p>Output graph:</p>
+          
+          <pre class='example'>
+&lt;#&gt; &lt;http://example.org/vocab#preferredLanguages&gt; ( "lorem" "fr" "dolor" "sit" "amet" ).
+          </pre>
+
+
+          <h3 id="insert-new-elements">How to insert new elements</h3>
+
           <p>
-              This example shows how to <strong id="replace-elements">replace all the elements</strong> after the index <code>2</code> with the provided collection:
+              This example shows how to insert new elements at a specific index (here <code>2</code>):
           </p>
 
           <pre class='example'>
-UpdateList &lt;#&gt; ex:preferredLanguages 2.. ( "fr-CH" "en-US" ) .
+UpdateList &lt;#&gt; &lt;http://example.org/vocab#preferredLanguages&gt; 2..2 ( "en" "fr" ) .
           </pre>
 
+          <p>Output graph:</p>
+          
+          <pre class='example'>
+&lt;#&gt; &lt;http://example.org/vocab#preferredLanguages&gt; ( "lorem" "ipsum" "en" "fr" "dolor" "sit" "amet" ).
+          </pre>
+
+
+          <h3 id="append-elements">How to append elements</h3>
+
           <p>
-              This example shows how to <strong id="remove-elements">remove elements</strong> (here the second and the third) from a collection:
+              This example shows how to append elements at the end of a collection:
           </p>
 
           <pre class='example'>
-UpdateList &lt;#&gt; ex:preferredLanguages 1..3 ( ) .
+UpdateList &lt;#&gt; <#> &lt;http://example.org/vocab#preferredLanguages&gt; .. ( "en" "fr" ) .
           </pre>
 
+          <p>Output graph:</p>
+          
+          <pre class='example'>
+&lt;#&gt; &lt;http://example.org/vocab#preferredLanguages&gt; ( "lorem" "ipsum" "dolor" "sit" "amet" "en" "fr" ).
+          </pre>
+
+
+          <h3 id="replace-elements">How to replace all the elements after a given index</h3>
+
           <p>
-              Finally, this example shows how to <strong id="empty-collection">empty a collection</strong>:
+              This example shows how to replace all the elements after the index <code>2</code> with the provided collection:
           </p>
 
           <pre class='example'>
-UpdateList &lt;#&gt; ex:preferredLanguages 0.. ( ) .
+UpdateList &lt;#&gt; &lt;http://example.org/vocab#preferredLanguages&gt; 2.. ( "en" "fr" ) .
           </pre>
 
+          <p>Output graph:</p>
+          
+          <pre class='example'>
+&lt;#&gt; &lt;http://example.org/vocab#preferredLanguages&gt; ( "lorem" "ipsum" "en" "fr" ).
+          </pre>
+
+
+          <h3 id="remove-elements">How to remove elements</h3>
+
+          <p>
+              This example shows how to remove elements (here the second and the third) from a collection:
+          </p>
+
+          <pre class='example'>
+UpdateList &lt;#&gt; &lt;http://example.org/vocab#preferredLanguages&gt; 1..3 ( ) .
+          </pre>
+
+          <p>Output graph:</p>
+          
+          <pre class='example'>
+&lt;#&gt; &lt;http://example.org/vocab#preferredLanguages&gt; ( "lorem" "sit" "amet" ).
+          </pre>
+
+
+          <h3 id="empty-collection">How to empty a collection</h3>
+
+          <p>
+              Finally, this example shows how to empty a collection:
+          </p>
+
+          <pre class='example'>
+UpdateList &lt;#&gt; &lt;http://example.org/vocab#preferredLanguages&gt; 0.. ( ) .
+          </pre>
+
+          <p>Output graph:</p>
+          
+          <pre class='example'>
+&lt;#&gt; &lt;http://example.org/vocab#preferredLanguages&gt; ( ).
+          </pre>
 
       </section>
 
@@ -483,7 +543,7 @@
         <section id="bind-statement">
           <h2><dfn>Bind</dfn></h2>
           <p>
-              The <a>Bind</a> operation is used to bind an RDF Term to a variable. The process results in the variable being bound to exactly one node. After being bound, the variable can be used in the subsequent statements. Another <a>Bind</a> can override the value of a previously bound variable.
+              The <a>Bind</a> operation is used to bind an <a class="externalDFN" href="http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-term">RDF Term</a> to a variable. The process results in the variable being bound to exactly one node. After being bound, the variable can be used in the subsequent statements. Another <a>Bind</a> can override the value of a previously bound variable.
           </p>
 
           <p>
@@ -494,14 +554,14 @@
               <dfn>Var</dfn> contains a unique name for the new variable. Variables are prefixed by the "<code>?</code>" character, which is not part of the variable name.
           </p>
           <p>
-              <dfn>Value</dfn> is the RDF Term that will be used as starting point when following the path expression.
+              <dfn>Value</dfn> is the <a class="externalDFN" href="http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-term">RDF Term</a> that will be used as starting point when following the path expression.
           </p>
           <p>
-              <dfn>Path</dfn> is the expression that is used to identify the RDF Term to which the Variable will be bound. It is comprised of <a>Step</a>(s) and/or <a>Constraint</a>(s).
+              <dfn>Path</dfn> is the expression that is used to identify the <a class="externalDFN" href="http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-term">RDF Term</a> to which the Variable will be bound. It is comprised of <a>Step</a>(s) and/or <a>Constraint</a>(s).
           </p>
 
           <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>.
+              Following the example above, the <a>Bind</a> operation creates a new variable called <code>event</code>, starting from the <a class="externalDFN" href="http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-term">RDF Term</a> <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 <a class="externalDFN" href="http://www.w3.org/TR/rdf11-concepts/#dfn-rdf-term">RDF Term</a> 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; ] .
           </pre>