Updated examples in container sections to be in request/response format
authorsspeiche
Mon, 16 Jun 2014 08:31:26 -0400
changeset 644 afe041e0f7fc
parent 643 f3071866e9cb
child 645 c460e6ff7ed0
Updated examples in container sections to be in request/response format
ldp.html
--- a/ldp.html	Mon Jun 16 10:43:42 2014 +0200
+++ b/ldp.html	Mon Jun 16 08:31:26 2014 -0400
@@ -1006,14 +1006,25 @@
 		container with only three members and some information about the
 		container (the fact that it is a container and a brief title):</p>
 
-<pre class="example" id="ldpc-ex-simple"># The following is the representation of
-#    http://example.org/c1/
-<!-- @base is here only so it's easier to paste into validators for checking -->
-# @base &lt;http://example.org/c1/&gt;
+<em>Request</em> to <code>http://example.org/c1/</code>:
+<pre class="example" id="ldpc-ex-simple-req">GET /c1/ HTTP/1.1
+Host: example.org
+Accept: text/turtle</pre>
+
+<em>Response:</em>
+<pre class="example" id="ldpc-ex-simple">HTTP/1.1 200 OK
+Content-Type: text/turtle
+Date: Thu, 12 Jun 2014 18:26:59 GMT
+ETag: 2014-06-12T18:25:43.46Z
+Accept-Post: text/turtle, application/ld+json
+Allow: POST,GET,OPTIONS,HEAD,PUT
+Link: &lt;http://www.w3.org/ns/ldp#BasicContainer&gt;; rel="type",
+      &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel="type"
+<!-- @base <http://example.org/c1/>. -->
 @prefix dcterms: &lt;http://purl.org/dc/terms/&gt;.
 @prefix ldp: &lt;http://www.w3.org/ns/ldp#&gt;.
 
-&lt;&gt;
+&lt;http://example.org/c1/&gt;
    a ldp:BasicContainer;
    dcterms:title "A very simple container";
    ldp:contains &lt;r1&gt;, &lt;r2&gt;, &lt;r3&gt;.</pre>
@@ -1044,13 +1055,24 @@
 	a  predicate from an application's domain model as the membership predicate. Let's
 	start with a pre-existing domain resource for a person's net worth, as illustrated below:</p>
 			
-<pre class="example" id="ldpc-ex-membership-partial"># The following is a representation of
-#   http://example.org/netWorth/nw1
-<!-- @base is here only so it's easier to paste into validators for checking -->
-# @base &lt;http://example.org/netWorth/nw1/&gt;
+<em>Request</em> to <code>http://example.org/netWorth/nw1</code>:
+<pre class="example" id="ldpc-ex-membership-partial-req">GET /netWorth/nw1 HTTP/1.1
+Host: example.org
+Accept: text/turtle</pre>
+
+<em>Response:</em>
+<pre class="example" id="ldpc-ex-membership-partial">HTTP/1.1 200 OK
+Content-Type: text/turtle
+Date: Thu, 12 Jun 2014 18:26:59 GMT
+ETag: 2014-06-12T18:25:43.46Z
+Link: &lt;http://www.w3.org/ns/ldp#RDFSource&gt;; rel="type",
+      &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel="type"
+Allow: GET,OPTIONS,HEAD,PUT,DELETE
+<!-- @base <http://example.org/netWorth/nw1>. -->
 @prefix ldp: &lt;http://www.w3.org/ns/ldp#&gt;.
-@prefix o: &lt;http://example.org/ontology/&gt;.
-&lt;&gt;
+@prefix o: &lt;http://example.org/ontology#&gt;.
+
+&lt;http://example.org/netWorth/nw1&gt;
    a o:NetWorth;
    o:netWorthOf &lt;http://example.org/users/JohnZSmith&gt;;
    o:asset 
@@ -1082,17 +1104,28 @@
 	as separate HTTP resources.  Existing clients have no need to interact with those containers,
 	whereas LDP-enabled clients now have container URLs that they can interact with.  The existing
 	resource remains unchanged so that existing clients continue to function normally.
-	This is illustrated in the set of related examples (one example per HTTP resource) below:
+	This is illustrated in the set of related examples, one example per HTTP resource, starting with
+	the LDP-RS example from before:
 	</p>
+	
+<em>Request</em> to <code>http://example.org/netWorth/nw1</code>:
+<pre class="example" id="ldpc-ex-membership-full-req">GET /netWorth/nw1 HTTP/1.1
+Host: example.org
+Accept: text/turtle</pre>
 
-<pre class="example" id="ldpc-ex-membership-full"># The following is a representation of the unchanged net worth LDPR
-#   http://example.org/netWorth/nw1
-<!-- @base is here only so it's easier to paste into validators for checking -->
-# @base &lt;http://example.org/netWorth/nw1/&gt;.
+<em>Response:</em>
+<pre class="example" id="ldpc-ex-membership-full">HTTP/1.1 200 OK
+Content-Type: text/turtle
+Date: Thu, 12 Jun 2014 18:26:59 GMT
+ETag: 2014-06-12T18:25:43.46Z
+Link: &lt;http://www.w3.org/ns/ldp#RDFSource&gt;; rel="type",
+      &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel="type"
+Allow: GET,OPTIONS,HEAD,PUT,DELETE
+<!-- @base <http://example.org/netWorth/nw1>. -->
 @prefix ldp: &lt;http://www.w3.org/ns/ldp#&gt;.
-@prefix dcterms: &lt;http://purl.org/dc/terms/&gt;.
-@prefix o: &lt;http://example.org/ontology/&gt;.
-&lt;&gt;
+@prefix o: &lt;http://example.org/ontology#&gt;.
+
+&lt;http://example.org/netWorth/nw1&gt;
    a o:NetWorth;
    o:netWorthOf &lt;http://example.org/users/JohnZSmith&gt;;
    o:asset 
@@ -1116,17 +1149,29 @@
 	and flexibility on how to specify the <a title="Membership triples">membership triples</a>.
 	</p>
 
-<pre class="example" id="ldpc-ex-membership-subj"># The following is a representation of the asset container
-#   http://example.org/netWorth/nw1/assets/
-<!-- @base is here only so it's easier to paste into validators for checking -->
-# @base &lt;http://example.org/netWorth/nw1/assets/&gt;.
+<em>Request</em> to <code>http://example.org/netWorth/nw1/assets/</code>:
+<pre class="example" id="ldpc-ex-membership-subj-req">GET /netWorth/nw1/assets/ HTTP/1.1
+Host: example.org
+Accept: text/turtle</pre>
+
+<em>Response:</em>
+<pre class="example" id="ldpc-ex-membership-subj">HTTP/1.1 200 OK
+Content-Type: text/turtle
+Date: Thu, 12 Jun 2014 18:26:59 GMT
+ETag: 2014-06-12T18:25:43.46Z
+Accept-Post: text/turtle, application/ld+json
+Allow: POST,GET,OPTIONS,HEAD
+Link: &lt;http://www.w3.org/ns/ldp#DirectContainer&gt;; rel="type",
+      &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel="type"
+<!-- @base <http://example.org/netWorth/nw1/assets/>. -->      
 @prefix ldp: &lt;http://www.w3.org/ns/ldp#&gt;.
 @prefix dcterms: &lt;http://purl.org/dc/terms/&gt;.
-@prefix o: &lt;http://example.org/ontology/&gt;.
-&lt;&gt;
+@prefix o: &lt;http://example.org/ontology#&gt;.
+
+&lt;http://example.org/netWorth/nw1/assets/&gt;
    a ldp:DirectContainer;
    dcterms:title "The assets of JohnZSmith";
-   ldp:membershipResource &lt;http://example.org/netWorth/nw1/&gt;;
+   ldp:membershipResource &lt;http://example.org/netWorth/nw1&gt;;
    ldp:hasMemberRelation o:asset;
    ldp:contains &lt;a1&gt;, &lt;a2&gt;.
 </pre>
@@ -1143,18 +1188,29 @@
 
 	<p>The second container is a <a title="Linked Data Platform Direct Container">LDP Direct Container</a> to manage liabilities.  
 	</p>
+<em>Request</em> to <code>http://example.org/netWorth/nw1/liabilities/</code>:
+<pre class="example" id="ldpc-ex-membership-full-liabcont-req">GET /netWorth/nw1/liabilities/ HTTP/1.1
+Host: example.org
+Accept: text/turtle</pre>
 
-<pre class="example" id="ldpc-ex-membership-full-liabcont"># The following is a representation of the liability container
-#   http://example.org/netWorth/nw1/liabilities/
-<!-- @base is here only so it's easier to paste into validators for checking -->
-# @base &lt;http://example.org/netWorth/nw1/liabilities/&gt;.
+<em>Response:</em>
+<pre class="example" id="ldpc-ex-membership-full-liabcont">HTTP/1.1 200 OK
+Content-Type: text/turtle
+Date: Thu, 12 Jun 2014 18:26:59 GMT
+ETag: 2014-06-12T18:25:43.46Z
+Link: &lt;http://www.w3.org/ns/ldp#DirectContainer&gt;; rel="type",
+      &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel="type"
+Accept-Post: text/turtle, application/ld+json
+Allow: POST,GET,OPTIONS,HEAD
+<!-- @base <http://example.org/netWorth/nw1/liabilities/>. -->
 @prefix ldp: &lt;http://www.w3.org/ns/ldp#&gt;.
 @prefix dcterms: &lt;http://purl.org/dc/terms/&gt;.
-@prefix o: &lt;http://example.org/ontology/&gt;.
-&lt;&gt;
+@prefix o: &lt;http://example.org/ontology#&gt;.
+
+&lt;http://example.org/netWorth/nw1/liabilities/&gt;
    a ldp:DirectContainer;
    dcterms:title "The liabilities of JohnZSmith";
-   ldp:membershipResource &lt;http://example.org/netWorth/nw1/&gt;;
+   ldp:membershipResource &lt;http://example.org/netWorth/nw1&gt;;
    ldp:hasMemberRelation o:liability;
    ldp:contains &lt;l1&gt;, &lt;l2&gt;, &lt;l3&gt;.
 </pre>
@@ -1167,24 +1223,36 @@
 	To add a another liability, a client would POST something like this to the liability container:
 	</p>
 
-<pre class="example" id="ldpc-ex-membership-add-new-liability"># The following is a representation of the liability to be added
-#   http://example.org/netWorth/nw1/liabilities/new
+<em>Request</em> to <code>http://example.org/netWorth/nw1/liabilities/</code>:
+<pre class="example" id="ldpc-ex-membership-add-new-liability-req">POST /netWorth/nw1/liabilities/ HTTP/1.1
+Host: example.org
+Accept: text/turtle
+Content-Type: text/turtle
+Content-Length: 63
 <!-- @base is here only so it's easier to paste into validators for checking -->
-# @base &lt;http://example.org/netWorth/nw1/liabilities/new&gt;.
-@prefix o: &lt;http://example.org/ontology/&gt;.
+@prefix o: &lt;http://example.org/ontology#&gt;.
+
 &lt;&gt;
    a o:Liability.
    # plus any other properties that the domain says liabilities have
 </pre>
 
+<em>Response:</em>
+<pre class="example" id="ldpc-ex-membership-add-new-liability">HTTP/1.1 201 Created
+Location: http://example.org/netWorth/nw1/liabilities/l4
+Date: Thu, 12 Jun 2014 19:56:13 GMT
+Link: &lt;http://www.w3.org/ns/ldp#DirectContainer&gt;; rel="type",
+      &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel="type"
+</pre>
+
 	<p>
 	Assuming the server successfully processes this request and assigns the URI
 	<code>&lt;http://example.org/netWorth/nw1/liabilities/l4&gt;</code> to the 
 	newly created liability resource, at least two new triples would be added.
 	</p>
 	<ol>
-	<li>In the net worth resource, <code>o:liability &lt;l4&gt;</code></li>
-	<li>In the liability container, <code>ldp:contains &lt;l4&gt;</code>.</li>
+	<li>In the net worth resource, <code>&lt;http://example.org/netWorth/nw1&gt; o:liability &lt;liabilities/l4&gt;</code></li>
+	<li>In the liability container, <code>&lt;http://example.org/netWorth/nw1/liabilities/&gt; ldp:contains &lt;l4&gt;</code>.</li>
 	</ol>
 
 	<p>
@@ -1206,17 +1274,27 @@
 	advisors (people) that have managed the assets and liabilities.  We have decided
 	to identify these advisors with URLs that contain a fragment (hash) to represent
 	these real-world resources, not the documents that describe them.</p>
-	
-<pre class="example" id="ldpc-ex-membership-full-elab"># The following is an elaborated representation of
-#   http://example.org/netWorth/nw1
-# Adding o:advisor but eaving off o:asset and o:liability for brevity.
-<!-- @base is here only so it's easier to paste into validators for checking -->
-# @base &lt;http://example.org/netWorth/nw1/&gt;
+
+<em>Request</em> to <code>http://example.org/netWorth/nw1</code>:
+<pre class="example" id="ldpc-ex-membership-full-elab-req">GET /netWorth/nw1 HTTP/1.1
+Host: example.org
+Accept: text/turtle</pre>
+
+<em>Response:</em>
+<pre class="example" id="ldpc-ex-membership-full-elab">HTTP/1.1 200 OK
+Content-Type: text/turtle
+Date: Thu, 12 Jun 2014 18:26:59 GMT
+ETag: 2014-06-12T18:25:43.46Z
+Link: &lt;http://www.w3.org/ns/ldp#DirectContainer&gt;; rel="type",
+      &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel="type"
+Allow: GET,OPTIONS,HEAD,PUT,DELETE
+<!-- @base <http://example.org/netWorth/nw1>. -->
 @prefix ldp: &lt;http://www.w3.org/ns/ldp#&gt;.
 @prefix dcterms: &lt;http://purl.org/dc/terms/&gt;.
 @prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt;.
-@prefix o: &lt;http://example.org/ontology/&gt;.
-&lt;&gt;
+@prefix o: &lt;http://example.org/ontology#&gt;.
+
+&lt;http://example.org/netWorth/nw1&gt;
    a o:NetWorth;
    o:netWorthOf &lt;http://example.org/users/JohnZSmith&gt;;
    o:advisor
@@ -1250,27 +1328,38 @@
 	<p>
 	To add a another advisor, a client would POST something like this to the advisors container:
 	</p>
-
-<pre class="example" id="ldpc-ex-membership-add-new-advisor"># The following is a representation of the advisor to be added
-#   http://example.org/netWorth/nw1/advisors/new
-<!-- @base is here only so it's easier to paste into validators for checking -->
-# @base &lt;http://example.org/netWorth/nw1/advisors/new&gt;.
+<em>Request</em> to <code>http://example.org/netWorth/nw1/advisors/</code>:
+<pre class="example" id="ldpc-ex-membership-add-new-advisor">POST /netWorth/nw1/advisors/ HTTP/1.1
+Host: example.org
+Accept: text/turtle
+Content-Type: text/turtle
+Slug: george
+Content-Length: 72
+<!-- @base <http://example.org/netWorth/nw1/advisors/george>. -->
 @prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt;.
-@prefix o: &lt;http://example.org/ontology/&gt;.
+@prefix o: &lt;http://example.org/ontology#&gt;.
 &lt;&gt;
    a o:Advisor;
    foaf:primaryTopic &lt;#me&gt;.
    # plus any other properties that the domain says advisors have
 </pre>
 
+<em>Response:</em>
+<pre class="example" id="ldpc-ex-membership-add-new-advisor">HTTP/1.1 201 Created
+Location: http://example.org/netWorth/nw1/advisors/george
+Date: Thu, 12 Jun 2014 19:56:13 GMT
+Link: &lt;http://www.w3.org/ns/ldp#RDFSource&gt;; rel="type",
+      &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel="type"
+</pre>
+
 	<p>
 	Assuming the server successfully processes this request and assigns the URI
 	<code>&lt;http://example.org/netWorth/nw1/advisors/george&gt;</code> to the 
 	newly created advisor resource, at least two new triples would be added.
 	</p>
 	<ol>
-	<li>In the net worth resource, <code>o:advisor &lt;advisors/george#me&gt;</code></li>
-	<li>In the advisors container, <code>ldp:contains &lt;george&gt;</code></li>
+	<li>In the net worth resource, <code>&lt;http://example.org/netWorth/nw1&gt; o:advisor &lt;advisors/george#me&gt;</code></li>
+	<li>In the advisors container, <code>&lt;http://example.org/netWorth/nw1/advisors/&gt; ldp:contains &lt;george&gt;</code></li>
 	</ol>
 
 	<p>In summary, <a href="#fig-ldpc-types"></a> illustrates the LDP-defined container types: Basic, Direct, and Indirect, along
@@ -1326,18 +1415,21 @@
 		Here is an example requesting the minimal-container triples of a
 		container identified by the URL <code>http://example.org/container1/</code>.
 	</p>
-<p id="ldpc-ex-minimal-container">Request:</p>
-<pre class="example">GET /container1 HTTP/1.1
+<p id="ldpc-ex-minimal-container"><em>Request</em> to <code>http://example.org/container1/</code>:</p>
+<pre class="example">GET /container1/ HTTP/1.1
 Host: example.org
 Accept: text/turtle; charset=UTF-8
 Prefer: return=representation; include="http://www.w3.org/ns/ldp#PreferMinimalContainer"
 </pre>
-<p>Response:</p>
+<p><em>Response:</em></p>
 <pre class="example">HTTP/1.1 200 OK
 Content-Type: text/turtle; charset=UTF-8
 ETag: "_87e52ce291112"
 Content-Length: 325
-Link: &lt;http://www.w3.org/ns/ldp#DirectContainer&gt;; rel="type"
+Link: &lt;http://www.w3.org/ns/ldp#DirectContainer&gt;; rel="type",
+      &lt;http://www.w3.org/ns/ldp#Resource&gt;; rel="type"
+Accept-Post: text/turtle, application/ld+json
+Allow: POST,GET,OPTIONS,HEAD
 Preference-Applied: return=representation 
 
 @prefix dcterms: &lt;http://purl.org/dc/terms/&gt;.
@@ -2148,7 +2240,7 @@
 	# @base &lt;http://example.org/netWorth/nw1/assets/&gt;.
 	@prefix dcterms: &lt;http://purl.org/dc/terms/&gt;.
 	@prefix ldp: &lt;http://www.w3.org/ns/ldp#&gt;.
-	@prefix o: &lt;http://example.org/ontology/&gt;.
+	@prefix o: &lt;http://example.org/ontology#&gt;.
 
 	&lt;&gt;
 	   a ldp:DirectContainer;
@@ -2190,7 +2282,7 @@
 	# @base &lt;http://example.org/netWorth/nw1/assets/&gt;.
 	@prefix dcterms: &lt;http://purl.org/dc/terms/&gt;.
 	@prefix ldp: &lt;http://www.w3.org/ns/ldp#&gt;.
-	@prefix o: &lt;http://example.org/ontology/&gt;.
+	@prefix o: &lt;http://example.org/ontology#&gt;.
 
 	&lt;&gt;
 	   a ldp:DirectContainer;
@@ -2221,7 +2313,7 @@
 	# @base &lt;http://example.org/netWorth/nw1/assets/&gt;.
 	@prefix dcterms: &lt;http://purl.org/dc/terms/&gt;.
 	@prefix ldp: &lt;http://www.w3.org/ns/ldp#&gt;.
-	@prefix o: &lt;http://example.org/ontology/&gt;.
+	@prefix o: &lt;http://example.org/ontology#&gt;.
 
 	&lt;&gt;
 	   a ldp:DirectContainer;
@@ -2257,7 +2349,7 @@
 	# @base &lt;http://example.org/netWorth/nw1/assets/&gt;.
 	@prefix dcterms: &lt;http://purl.org/dc/terms/&gt;.
 	@prefix ldp: &lt;http://www.w3.org/ns/ldp#&gt;.
-	@prefix o: &lt;http://example.org/ontology/&gt;.
+	@prefix o: &lt;http://example.org/ontology#&gt;.
 
 	&lt;&gt;
 	   a ldp:DirectContainer;
@@ -2431,6 +2523,7 @@
 <h2>Detailed history</h2>
 <!-- <blockquote><em><a href="http://www.w3.org/TR/2013/WD-ldp-20130930/">Candidate Recommendation Draft</a></em></blockquote> -->
 <ul>
+	<li>2014-06-16 - Updated examples in container sections to be in request/response format (SS) </li>
 	<li>2014-06-10 - Use http-bis and Prefer RFC numbers, adjust BNF to match bis changes (JA) </li>
 	<li>2014-06-05 - Fixed LC1 date in change history pseudo-heading, was 2014 (JA) </li>
 	<li>2014-05-19 - Revert membership definition to be about LDPCs, not LDP-RS's (JA) </li>