Added Link headers to examples. Moved LDPC creation before LDPR
authorAndrei Sambra <andrei@w3.org>
Thu, 26 Mar 2015 10:38:48 -0400
changeset 958 2f25528e103a
parent 938 859f98c26867
child 959 b2d2d631693e
Added Link headers to examples. Moved LDPC creation before LDPR
ldp-primer/examples/bccreate.txt
ldp-primer/examples/bcget_res.txt
ldp-primer/ldp-primer.html
--- a/ldp-primer/examples/bccreate.txt	Mon Jan 26 11:51:28 2015 -0500
+++ b/ldp-primer/examples/bccreate.txt	Thu Mar 26 10:38:48 2015 -0400
@@ -1,5 +1,6 @@
 POST /alice/ HTTP/1.1
 Host: example.org
+Link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
 Slug: foaf
 Content-Type: text/turtle
 
@@ -17,6 +18,7 @@
 
 POST /alice/ HTTP/1.1
 Host: example.org
+Link: <http://www.w3.org/ns/ldp#Resource>; rel="type"
 Slug: foaf
 Content-Type: application/ld+json
 
--- a/ldp-primer/examples/bcget_res.txt	Mon Jan 26 11:51:28 2015 -0500
+++ b/ldp-primer/examples/bcget_res.txt	Thu Mar 26 10:38:48 2015 -0400
@@ -1,6 +1,6 @@
 HTTP/1.1 200 OK 
 Content-Type: text/turtle; charset=UTF-8
-Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel='type', <http://www.w3.org/ns/ldp#Resource>; rel='type'
+Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type", <http://www.w3.org/ns/ldp#Resource>; rel="type"
 Allow: OPTIONS,HEAD,GET,POST,PUT,PATCH
 Accept-Post: text/turtle, application/ld+json, image/bmp, image/jpeg
 Accept-Patch: text/ldpatch
@@ -18,7 +18,7 @@
 
 HTTP/1.1 200 OK 
 Content-Type: application/ld+json; charset=UTF-8
-Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel='type', <http://www.w3.org/ns/ldp#Resource>; rel='type'
+Link: <http://www.w3.org/ns/ldp#BasicContainer>; rel="type", <http://www.w3.org/ns/ldp#Resource>; rel="type"
 Allow: OPTIONS,HEAD,GET,POST,PUT,PATCH
 Accept-Post: text/turtle, application/ld+json, image/bmp, image/jpeg
 Accept-Patch: text/ldpatch
--- a/ldp-primer/ldp-primer.html	Mon Jan 26 11:51:28 2015 -0500
+++ b/ldp-primer/ldp-primer.html	Thu Mar 26 10:38:48 2015 -0400
@@ -485,40 +485,66 @@
     </section>
 
     <section>
-      <h2> Creating a RDF resource (POST an RDF resource to an LDP-BC) </h2> 
+      <h3 id="meta-structure">Creating Containers and Structural Hierarchy</h3>
+      <p>In order for the client to introduce hierarchy to the management of documents, the document store allows creation of container resources, enabling Alice to create a container hierarchy to organise her documents. This can be done by POSTing (a child) container representation to a (parent) container. For instance, it enables Alice to create a child container which she intends to use for image storage.
+      </p>
+
+    <figure id="fig-bcs">
+      <img src="images/bcs.png" alt=".." />
+      <figcaption>Child Containers inside a Basic Container.</figcaption>
+    </figure>
+
+      <pre title="State of Alice's document store before creating the photo (child) container" class='example' data-include='examples/create_cr_s1.txt' data-oninclude='fixCode'></pre>  
+
+      <p>To create a new container for managing photos, Alice POSTs a representation of a container (LDP-BC) to the root container. Alice express her intention that the newly created resource should be an LDP Basic Container by including a Link header in the request with the relationship "type". </p>
+      <pre title="Request - creating a new container" class='example' data-include='examples/create_cr_req.txt' data-oninclude='fixCode'></pre>  
+      <p>If the POST is successful, the server responds with the location of the newly created container for the photos.</p>
+      <pre title="Response - creating a new container" class="example">
+HTTP/1.1 201 Created
+Location: http://example.org/alice/photos/
+Link: &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel=&quot;type&quot;
+Content-Length: 0  
+        </pre>  
+
+      <p>This is how the parent container will look like after creating the new container</p>
+      <pre title="State of Alice's document store after creating the photo (child) container" class='example' data-include='examples/create_cr_s2.txt' data-oninclude='fixCode'></pre> 
+      <p>and the photo container will look like the following.</p>
+      <pre title="State of Alice's newly created photo container" class='example' data-include='examples/create_cr_s3.txt' data-oninclude='fixCode'></pre> 
+
+    </section> 
+
+    <section>
+      <h2> Creating an RDF resource (POST an RDF resource to an LDP-BC) </h2> 
 
       <p>
-        Alice can upload a social profile document to her store, by POSTing her FOAF personal profile document to her LDP-BC at the root of her document store. Note, the Slug header offers the server a hint about URL of the resource to be created.  
+        Alice can upload a social profile document to her store, by POSTing her FOAF personal profile document to her LDP-BC at the root of her document store. Note, the Slug header offers a hint to the server about the URL of the resource to be created. Alice also indicates that the newly created resource should be an LDP Resource by including a Link header in the request with the relationship "type".
       </p>
       
-      <p> The FOAF document includes statements about the resource to be created and other resources relative to the resource to be created. According the LDP specification
-      Alice can use null relative URI (<>) in the request entity body to refer to resource to be created.
+      <p> The FOAF document includes statements about the resource to be created and other resources relative to the resource to be created. According the LDP specification, Alice can use an empty relative URI (&lt;&gt;) in the request entity body to refer to resource to be created.
       
       </p>
 
-      <pre title="Request - creating a RDF resource" class='example' data-include='examples/bccreate.txt' data-oninclude='fixCode'></pre> 
-
-   </pre> 
+      <pre title="Request - creating an RDF resource" class='example' data-include='examples/bccreate.txt' data-oninclude='fixCode'></pre> 
 
-   <pre title="Response - creating a RDF resource" class="example"> 
-HTTP/1.1 201 Created
-Location: http://example.org/alice/foaf
-Link: &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel=&#39;type&#39;
-Content-Length: 0 
-   </pre>
+      <pre title="Response - creating an RDF resource" class="example"> 
+        HTTP/1.1 201 Created
+        Location: http://example.org/alice/foaf
+        Link: &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel="type"
+        Content-Length: 0 
+      </pre>
       <p> The response to the create request provides a Link to the newly created resource using the Location header. In this case, the server has honored the hint provided by the slug header and created the new resource in the URL http://example.org/alice/foaf. </p>
       <p>Knowing the URL of the newly created resource, Alice can check the container again to confirm that the container correctly contains the newly created resource.</p>
 
       <pre title="Request - basic container retrieval after resource created" class="example">
-    GET /alice/ HTTP/1.1
-    Host: example.org
-    Accept: text/turtle, application/ld+json
-     </pre>
+        GET /alice/ HTTP/1.1
+        Host: example.org
+        Accept: text/turtle, application/ld+json
+      </pre>
 
-     <pre title="Response - basic container retrieval after resource created" class='example' data-include='examples/bcget_res.txt' data-oninclude='fixCode'/>
-     <p>
-       The ldp:contains containment triple discloses the newly created resource in the response. 
-     </p>
+      <pre title="Response - basic container retrieval after resource created" class='example' data-include='examples/bcget_res.txt' data-oninclude='fixCode'/>
+      <p>
+        The ldp:contains containment triple discloses the newly created resource in the response. 
+      </p>
 
     </section>
 
@@ -530,6 +556,7 @@
       <pre title="Request - creating a non-RDF resource" class="example"> 
 POST /alice/ HTTP/1.1
 Host: example.org
+Link: &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel="type"
 Slug: avatar
 Content-Type: image/png
 Content- Length: 1020
@@ -602,35 +629,6 @@
    </pre>     
     </section>
 
-    <section>
-      <h3 id="meta-structure">Structural Manipulation (Child Containers)</h3>
-      <p>In order for the client to introduce hierarchy to the management of documents, the document store allows creation of documents which are containers. That enables Alice to create a container hierarchy to organise her documents. This can be done by POSTing (a child) container representation to a (parent) container. This enables Alice to create a child container which she intends to use for image storage.
-      </p>
-
-    <figure id="fig-bcs">
-      <img src="images/bcs.png" alt=".." />
-      <figcaption>Child Containers inside a Basic Container.</figcaption>
-    </figure>
-
-      <pre title="State of Alice's document store before creating the photo (child) container" class='example' data-include='examples/create_cr_s1.txt' data-oninclude='fixCode'></pre>  
-
-      <p>To create a new container for managing photos, Alice POSTs a representation of a container (LDP-BC) to the root container. Alice express her intention that the newly created resource should be an LDP Basic Container by including a Link header in the request with the relationship 'type'. </p>
-      <pre title="Request - creating a new container" class='example' data-include='examples/create_cr_req.txt' data-oninclude='fixCode'></pre>  
-      <p>If the create is successful, the server responds with location of the newly created container for the photos.</p>
-      <pre title="Response - creating the new container" class="example">
-HTTP/1.1 201 Created
-Location: http://example.org/alice/photos/
-Link: &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel=&quot;type&quot;
-Content-Length: 0  
-        </pre>  
-
-      <p>After creation of this new container, the parent container will look like</p>
-      <pre title="State of Alice's document store after creating the photo (child) container" class='example' data-include='examples/create_cr_s2.txt' data-oninclude='fixCode'></pre> 
-      <p>and the photo container will look like the following.</p>
-      <pre title="State of Alice's newly created photo container" class='example' data-include='examples/create_cr_s3.txt' data-oninclude='fixCode'></pre> 
-
-    </section> 
-
   </section>
 
   <section id="bugtracker">