--- a/ldpatch.html Thu Nov 20 17:47:31 2014 +0100
+++ b/ldpatch.html Thu Nov 20 17:53:51 2014 +0100
@@ -246,6 +246,167 @@
</section>
+ <section id="examples" class="informative">
+ <h2>Examples</h2>
+
+ <section id="full-example">
+ <h2>Full example</h2>
+
+ <p>
+ The following RDF Graph describes the relation between a person named Tim Berners-Lee (denoted by <code><http://example.org/timbl#></code>) and two events he attended.
+ </p>
+ <pre class='example'>
+@prefix schema: <http://schema.org/> .
+@prefix profile: <http://ogp.me/ns/profile#> .
+@prefix ex: <http://example.org/vocab#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+<#> a schema:Person ;
+ schema:alternateName "TimBL" ;
+ profile:first_name "Tim" ;
+ profile:last_name "Berners-Lee" ;
+ schema:workLocation [ schema:name "W3C/MIT" ] ;
+ schema:performerIn _:b1, _:b2 ;
+ ex:preferredLanguages ( "en" "fr" ).
+
+_:b1 schema:name "F2F5 - Linked Data Platform" ;
+ schema:url <https://www.w3.org/2012/ldp/wiki/F2F5> .
+
+_:b2 a schema:Event ;
+ schema:name "TED 2009" ;
+ schema:startDate "2009-02-04" ;
+ schema:url <http://conferences.ted.com/TED2009/> .
+ </pre>
+ <p>
+ The following is an example HTTP Patch request, conveying an LD Patch document:
+ </p>
+ <pre class='example'>
+PATCH /timbl HTTP/1.1
+Host: example.org
+Content-Length: 478
+Content-Type: text/ldpatch
+If-Match: "abc123"
+
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+@prefix schema: <http://schema.org/> .
+@prefix profile: <http://ogp.me/ns/profile#> .
+@prefix ex: <http://example.org/vocab#> .
+
+Delete { <#> profile:first_name "Tim" } .
+Add {
+ <#> profile:first_name "Timothy" ;
+ profile:image <https://example.org/timbl.jpg> .
+} .
+
+Bind ?workLocation <#> /schema:workLocation .
+Cut ?workLocation.
+
+UpdateList <#> ex:preferredLanguages 1..2 ( "fr-CH" ) .
+
+Bind ?event <#> /schema:attendee[/schema:url = <https://www.w3.org/2012/ldp/wiki/F2F5>] .
+Add { ?event rdf:type schema:Event } .
+
+Bind ?ted <http://conferences.ted.com/TED2009/> /^schema:url! .
+Delete { ?ted schema:startDate "2009-02-04" } .
+Add {
+ ?ted schema:location [
+ schema:name "Long Beach, California" ;
+ schema:geo [
+ schema:latitude "33.7817" ;
+ schema:longitude "-118.2054"
+ ]
+ ]
+} .
+ </pre>
+ <p>
+ This example introduces most features of the LD Patch format: <code>@prefix</code> and prefixed names, the <a>Add</a>, <a>Delete</a>, <a>Cut</a>, and <a>UpdateList</a> operations, the <a>Bind</a>-ing mechanism and blank node creation. The "text/ldpatch" media type is <a href="#media-registration">prospectively</a> used to identify such LD Patch documents.
+ </p>
+ <p>
+ The following is the resulting (patched) document.
+ </p>
+ <pre class='example'>
+@prefix schema: <http://schema.org/> .
+@prefix profile: <http://ogp.me/ns/profile#> .
+@prefix ex: <http://example.org/vocab#> .
+@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
+<#> a schema:Person ;
+ schema:alternateName "TimBL" ;
+ profile:first_name "Timothy" ;
+ profile:last_name "Berners-Lee" ;
+ profile:image <https://example.org/timbl.jpg> ;
+ schema:attendee _:b1, _:b2 ;
+ ex:preferredLanguages ( "en" "fr-CH" ).
+
+_:b1 a schema:Event ;
+ schema:name "F2F5 - Linked Data Platform" ;
+ schema:url <https://www.w3.org/2012/ldp/wiki/F2F5> .
+
+_:b2 a schema:Event ;
+ schema:name "TED 2009" ;
+ schema:url <http://conferences.ted.com/TED2009/> ;
+ schema:location [
+ schema:name "Long Beach, California";
+ schema:geo [ schema:latitude "33.7817" ; schema:longitude "-118.2054" ]
+ ] .
+ </pre>
+ </section>
+
+ <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>
+
+ <pre class='example'>
+UpdateList <#> ex:preferredLanguages 1..2 ( "fr-CH" ) .
+ </pre>
+
+ <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 <#> 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:
+ </p>
+
+ <pre class='example'>
+UpdateList <#> ex:preferredLanguages .. ( "fr-CH" "en-US" ) .
+ </pre>
+
+ <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:
+ </p>
+
+ <pre class='example'>
+UpdateList <#> ex:preferredLanguages 2.. ( "fr-CH" "en-US" ) .
+ </pre>
+
+ <p>
+ This example shows how to <strong id="remove-elements">remove elements</strong> (here the second and the third) from a collection:
+ </p>
+
+ <pre class='example'>
+UpdateList <#> ex:preferredLanguages 1..3 ( ) .
+ </pre>
+
+ <p>
+ Finally, this example shows how to <strong id="empty-collection">empty a collection</strong>:
+ </p>
+
+ <pre class='example'>
+UpdateList <#> ex:preferredLanguages 0.. ( ) .
+ </pre>
+
+
+ </section>
+
+ </section>
+
+
<section class='normative' id='semantics'>
<h1>LD Patch Semantics</h1>
<p>
@@ -518,168 +679,6 @@
</section>
</section>
- <section id="examples" class="informative">
- <h2>Examples</h2>
-
- <section id="full-example">
- <h3>Full example</h3>
-
- <p>
- The following RDF Graph describes the relation between a person named Tim Berners-Lee (denoted by <code><http://example.org/timbl#></code>) and two events he attended.
- </p>
- <pre class='example'>
-@prefix schema: <http://schema.org/> .
-@prefix profile: <http://ogp.me/ns/profile#> .
-@prefix ex: <http://example.org/vocab#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-<#> a schema:Person ;
- schema:alternateName "TimBL" ;
- profile:first_name "Tim" ;
- profile:last_name "Berners-Lee" ;
- schema:workLocation [ schema:name "W3C/MIT" ] ;
- schema:performerIn _:b1, _:b2 ;
- ex:preferredLanguages ( "en" "fr" ).
-
-_:b1 schema:name "F2F5 - Linked Data Platform" ;
- schema:url <https://www.w3.org/2012/ldp/wiki/F2F5> .
-
-_:b2 a schema:Event ;
- schema:name "TED 2009" ;
- schema:startDate "2009-02-04" ;
- schema:url <http://conferences.ted.com/TED2009/> .
- </pre>
- <p>
- The following is an example HTTP Patch request, conveying an LD Patch document:
- </p>
- <pre class='example'>
-PATCH /timbl HTTP/1.1
-Host: example.org
-Content-Length: 478
-Content-Type: text/ldpatch
-If-Match: "abc123"
-
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-@prefix schema: <http://schema.org/> .
-@prefix profile: <http://ogp.me/ns/profile#> .
-@prefix ex: <http://example.org/vocab#> .
-
-Delete { <#> profile:first_name "Tim" } .
-Add {
- <#> profile:first_name "Timothy" ;
- profile:image <https://example.org/timbl.jpg> .
-} .
-
-Bind ?workLocation <#> /schema:workLocation .
-Cut ?workLocation.
-
-UpdateList <#> ex:preferredLanguages 1..2 ( "fr-CH" ) .
-
-Bind ?event <#> /schema:attendee[/schema:url = <https://www.w3.org/2012/ldp/wiki/F2F5>] .
-Add { ?event rdf:type schema:Event } .
-
-Bind ?ted <http://conferences.ted.com/TED2009/> /^schema:url! .
-Delete { ?ted schema:startDate "2009-02-04" } .
-Add {
- ?ted schema:location [
- schema:name "Long Beach, California" ;
- schema:geo [
- schema:latitude "33.7817" ;
- schema:longitude "-118.2054"
- ]
- ]
-} .
- </pre>
- <p>
- This example introduces most features of the LD Patch format: <code>@prefix</code> and prefixed names, the <a>Add</a>, <a>Delete</a>, <a>Cut</a>, and <a>UpdateList</a> operations, the <a>Bind</a>-ing mechanism and blank node creation. The "text/ldpatch" media type is <a href="#media-registration">prospectively</a> used to identify such LD Patch documents.
- </p>
- <p>
- The following is the resulting (patched) document.
- </p>
- <pre class='example'>
-@prefix schema: <http://schema.org/> .
-@prefix profile: <http://ogp.me/ns/profile#> .
-@prefix ex: <http://example.org/vocab#> .
-@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
-<#> a schema:Person ;
- schema:alternateName "TimBL" ;
- profile:first_name "Timothy" ;
- profile:last_name "Berners-Lee" ;
- profile:image <https://example.org/timbl.jpg> ;
- schema:attendee _:b1, _:b2 ;
- ex:preferredLanguages ( "en" "fr-CH" ).
-
-_:b1 a schema:Event ;
- schema:name "F2F5 - Linked Data Platform" ;
- schema:url <https://www.w3.org/2012/ldp/wiki/F2F5> .
-
-_:b2 a schema:Event ;
- schema:name "TED 2009" ;
- schema:url <http://conferences.ted.com/TED2009/> ;
- schema:location [
- schema:name "Long Beach, California";
- schema:geo [ schema:latitude "33.7817" ; schema:longitude "-118.2054" ]
- ] .
- </pre>
- </section>
-
- <section id="list-manipulation-examples">
- <h3><code>rdf:List</code> manipulation examples</h3>
-
- <p>
- This example shows how to <strong id="replace-elements">replace elements</strong> with new ones (here the second one):
- </p>
-
- <pre class='example'>
-UpdateList <#> ex:preferredLanguages 1..2 ( "fr-CH" ) .
- </pre>
-
- <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 <#> ex:preferredLanguages 2..3 ( "fr-CH" "en-US" ) .
- </pre>
-
- <p>
- This example shows how to <strong id="append-elements">append elements</strong> to a collection:
- </p>
-
- <pre class='example'>
-UpdateList <#> ex:preferredLanguages .. ( "fr-CH" "en-US" ) .
- </pre>
-
- <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:
- </p>
-
- <pre class='example'>
-UpdateList <#> ex:preferredLanguages 2.. ( "fr-CH" "en-US" ) .
- </pre>
-
- <p>
- This example shows how to <strong id="remove-elements">remove elements</strong> from a collection:
- </p>
-
- <pre class='example'>
-UpdateList <#> ex:preferredLanguages 2..3 ( ) .
- </pre>
-
- <p>
- Finally, this example shows how to <strong id="empty-collection">empty a collection</strong>:
- </p>
-
- <pre class='example'>
-UpdateList <#> ex:preferredLanguages 0.. ( ) .
- </pre>
-
-
- </section>
-
- </section>
-
-
-
<section id='concrete-syntax'>
<h1>Concrete Syntax</h1>
<p>