Moved the examples before the Concrete Syntax. Fixed typo for LD Patch Syntax->Semantics. ldpatch
authorAndrei Sambra <andrei.sambra@gmail.com>
Tue, 18 Nov 2014 14:10:29 -0500
branchldpatch
changeset 883 465e21e46365
parent 882 1f0c234f4bce
child 884 7a8d123386ee
Moved the examples before the Concrete Syntax. Fixed typo for LD Patch Syntax->Semantics.
ldpatch.html
--- a/ldpatch.html	Tue Nov 18 13:30:44 2014 -0500
+++ b/ldpatch.html	Tue Nov 18 14:10:29 2014 -0500
@@ -242,7 +242,7 @@
     </section>
       
     <section class='normative' id='language-features'>
-      <h1>LD Patch Syntax</h1>
+      <h1>LD Patch Semantics</h1>
       <p>
 An LD Patch document is made of a prologue and a list of statements, where the order is relevant. The prologue declares a number of <tref>prefixes</tref> used to abbreviate URIs. Then each statement either binds a variable to a matching node, or defines a modification on the graph.
       </p>
@@ -273,7 +273,7 @@
       <section id="node-matching-semantics">
         <h2><tdef>Node Matching Semantics</tdef></h2>
         <p>
-LD Patch borrows much of its syntax from <a href="http://www.w3.org/TR/turtle/">Turtle</a> [[turtle]] and <a href="http://www.w3.org/TR/sparql11-query/">SPARQL</a> [[sparql11-query]] for describing nodes. IRIs (either abbreviated or not) and literals represent the corresponding node in the graph being patched. Blank nodes, on the other hand, pose a problem, as they have no global identifier. Indeed, blank node identifiers have their scope limited to the document in which they appear. As a consequence, whenever blank node identifiers appears in an LD Patch document, it is understood to denote a <em>fresh</em> blank node, that needs to be created in the patched RDF graph. They cannot interfere with existing blank nodes in the graph.
+LD Patch borrows much of its syntax and semantics from <a href="http://www.w3.org/TR/turtle/">Turtle</a> [[turtle]] and <a href="http://www.w3.org/TR/sparql11-query/">SPARQL</a> [[sparql11-query]] for describing nodes. IRIs (either abbreviated or not) and literals represent the corresponding node in the graph being patched. Blank nodes, on the other hand, pose a problem, as they have no global identifier. Indeed, blank node identifiers have their scope limited to the document in which they appear. As a consequence, whenever blank node identifiers appears in an LD Patch document, it is understood to denote a <em>fresh</em> blank node, that needs to be created in the patched RDF graph. They cannot interfere with existing blank nodes in the graph.
         </p>
         <p>
 In order to be able to address blank nodes already present in the graph, LD Patch has two mechanisms: <tref>Bind</tref>ing a variable to a blank node reachable with a <tref>path expression</tref>, and <tref>UpdateList</tref> to deal with those blank nodes that constitute RDF collections. There are cases where those mechanisms will not be able to unambiuously address a given blank node, but those cases are deemed <a href="#pathological-graph">pathological</a>, and out of the scope of this specification.
@@ -465,6 +465,105 @@
       </section>
     </section>
 
+    <section id="examples" class="informative">
+      <h2>Examples</h2>
+
+      <p>
+        The following RDF Graph will be used as an example through this specification. It describes the relation between a person named Tim Berners-Lee (denoted by <code>&lt;http://example.org/timbl#&gt;</code>) and two events he attended.
+      </p>
+      <pre class='example'>
[email protected] schema: &lt;http://schema.org/&gt; .
[email protected] profile: &lt;http://ogp.me/ns/profile#&gt; .
[email protected] ex: &lt;http://example.org/vocab#&gt; .
[email protected] rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .
+&lt;http://example.com/timbl#&gt; 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 &lt;https://www.w3.org/2012/ldp/wiki/F2F5&gt; .
+
+_:b2 a schema:Event ;
+  schema:name "TED 2009" ;
+  schema:startDate "2009-02-04" ;
+  schema:url &lt;http://conferences.ted.com/TED2009/&gt; .
+      </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"
+
[email protected] rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .
[email protected] schema: &lt;http://schema.org/&gt; .
[email protected] profile: &lt;http://ogp.me/ns/profile#&gt; .
[email protected] ex: &lt;http://example.org/vocab#&gt; .
+
+Delete { &lt;#&gt; profile:first_name "Tim" } .
+Add    { 
+  &lt;#&gt; profile:first_name "Timothy" ;
+    profile:image &lt;https://example.org/timbl.jpg&gt;.
+} .
+
+UpdateList &lt;#&gt; ex:preferredLanguages 1..2 ( "fr-CH" ) .
+
+Bind ?event &lt;#&gt; /schema:performerIn[/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! .
+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 <tref>Add</tref>, <tref>Delete</tref> and <tref>UpdateList</tref> operations, the <tref>Bind</tref>-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'>
[email protected] schema: &lt;http://schema.org/&gt; .
[email protected] profile: &lt;http://ogp.me/ns/profile#&gt; .
[email protected] ex: &lt;http://example.org/vocab#&gt; .
+
+&lt;http://example.com/timbl#&gt; a schema:Person ;
+  schema:alternateName "TimBL" ;
+  profile:first_name "Timothy" ;
+  profile:last_name "Berners-Lee" ;
+  proflie:image &lt;https://example.org/timbl.jpg&gt; ;
+  schema:workLocation [ schema:name "W3C/MIT" ] ;
+  schema:performerIn _:b1, _:b2 ;
+  ex:preferredLanguages ( "en" "fr-CH" ).
+
+_:b1 a schema:Event ;
+  schema:name "F2F5 - Linked Data Platform" ;
+  schema:url &lt;https://www.w3.org/2012/ldp/wiki/F2F5&gt; .
+
+_:b2 a schema:Event ;
+  schema:name "TED 2009" ;
+  schema:url &lt;http://conferences.ted.com/TED2009/&gt; ;
+  schema:location [
+    schema:name "Long Beach, California";
+    schema:geo [ schema:latitude "33.7817" ; schema:longitude "-118.2054" ]
+  ] .
+      </pre>
+    </section>
+
     <section id='concrete-syntax'>
       <h1>Concrete Syntax</h1>
       <p>
@@ -680,7 +779,7 @@
     <td>[35]</td>
     <td><code>IRIREF</code></td>
     <td>::=</td>
-    <td>'<code class="grammar-literal"><</code>' ([^#x00-#x20<>"{}|^`\] | <a href="#grammar-production-UCHAR">UCHAR</a>)* '<code class="grammar-literal">></code>' /* #x00=NULL #01-#x1F=control codes #x20=space */</td>
+    <td>'<code class="grammar-literal">&lt;</code>' ([^#x00-#x20&lt;&gt;"{}|^`\] | <a href="#grammar-production-UCHAR">UCHAR</a>)* '<code class="grammar-literal">></code>' /* #x00=NULL #01-#x1F=control codes #x20=space */</td>
 </tr>
 <tr id="grammar-production-PNAME_NS">
     <td>[36]</td>
@@ -837,105 +936,6 @@
 
     </section>
 
-    <section id="examples" class="informative">
-      <h2>Examples</h2>
-
-      <p>
-        The following RDF Graph will be used as an example through this specification. It describes the relation between a person named Tim Berners-Lee (denoted by <code>&lt;http://example.org/timbl#&gt;</code>) and two events he attended.
-      </p>
-      <pre class='example'>
[email protected] schema: &lt;http://schema.org/&gt; .
[email protected] profile: &lt;http://ogp.me/ns/profile#&gt; .
[email protected] ex: &lt;http://example.org/vocab#&gt; .
[email protected] rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .
-&lt;http://example.com/timbl#&gt; 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 &lt;https://www.w3.org/2012/ldp/wiki/F2F5&gt; .
-
-_:b2 a schema:Event ;
-  schema:name "TED 2009" ;
-  schema:startDate "2009-02-04" ;
-  schema:url &lt;http://conferences.ted.com/TED2009/&gt; .
-      </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"
-
[email protected] rdf: &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .
[email protected] schema: &lt;http://schema.org/&gt; .
[email protected] profile: &lt;http://ogp.me/ns/profile#&gt; .
[email protected] ex: &lt;http://example.org/vocab#&gt; .
-
-Delete { &lt;#&gt; profile:first_name "Tim" } .
-Add    { 
-  &lt;#&gt; profile:first_name "Timothy" ;
-    profile:image &lt;https://example.org/timbl.jpg&gt;.
-} .
-
-UpdateList &lt;#&gt; ex:preferredLanguages 1..2 ( "fr-CH" ) .
-
-Bind ?event &lt;#&gt; /schema:performerIn[/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! .
-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 <tref>Add</tref>, <tref>Delete</tref> and <tref>UpdateList</tref> operations, the <tref>Bind</tref>-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'>
[email protected] schema: &lt;http://schema.org/&gt; .
[email protected] profile: &lt;http://ogp.me/ns/profile#&gt; .
[email protected] ex: &lt;http://example.org/vocab#&gt; .
-
-&lt;http://example.com/timbl#&gt; a schema:Person ;
-  schema:alternateName "TimBL" ;
-  profile:first_name "Timothy" ;
-  profile:last_name "Berners-Lee" ;
-  proflie:image &lt;https://example.org/timbl.jpg&gt; ;
-  schema:workLocation [ schema:name "W3C/MIT" ] ;
-  schema:performerIn _:b1, _:b2 ;
-  ex:preferredLanguages ( "en" "fr-CH" ).
-
-_:b1 a schema:Event ;
-  schema:name "F2F5 - Linked Data Platform" ;
-  schema:url &lt;https://www.w3.org/2012/ldp/wiki/F2F5&gt; .
-
-_:b2 a schema:Event ;
-  schema:name "TED 2009" ;
-  schema:url &lt;http://conferences.ted.com/TED2009/&gt; ;
-  schema:location [
-    schema:name "Long Beach, California";
-    schema:geo [ schema:latitude "33.7817" ; schema:longitude "-118.2054" ]
-  ] .
-      </pre>
-    </section>
-
     <section id="acknowledgements" class="appendix informative">
       <h2>Acknowledgements</h2>