Skip to content

Commit

Permalink
Merge pull request #1166 from w3c/conneg-self-canonical
Browse files Browse the repository at this point in the history
Conneg self canonical
  • Loading branch information
larsgsvensson committed Nov 19, 2019
2 parents 643295b + e09da2e commit dee69b7
Showing 1 changed file with 21 additions and 20 deletions.
41 changes: 21 additions & 20 deletions connegp/index.html
Expand Up @@ -550,7 +550,7 @@ <h4>list profiles</h4>
# &amp; XML Media Types.
Link:
&lt;http://example.org/resource/a?_profile=profile-x&amp;_mediatype=text/html>;
rel="self"; type="text/html";
rel="canonical"; type="text/html";
profile="http://otherexample.org/profile/x",
&lt;http://example.org/resource/a?_profile=profile-x&amp;_mediatype=text/xml>;
rel="alternate";
Expand Down Expand Up @@ -893,11 +893,12 @@ <h3>Hypertext Transfer Protocol Headers</h3>
<h3>list profiles</h3>
<p>
The preferred way to retrieve a list of profiles the server supports for a specific resource
is to issue a <code>GET</code> or <code>HEAD</code> request for that resource.
In either case, a server implementing
is to issue a <code>GET</code> or <code>HEAD</code> request for that resource.
In either case, a server implementing
content negotiation by profile SHOULD return an HTTP <code>Link</code> header containing information about the
default representation of that resource and information about any alternate representations of that
resource conforming to other profiles. The returned representation will be identified by <code>rel="self"</code>, other representations by
default and any alternate representations of that
resource including profiles they conform to. The default representation &ndash; the one that will be returned when no specific representation is requested &ndash;
will be identified by <code>rel="canonical"</code>, other representations by
<code>rel="alternate"</code>.
</p>
<p>As an example, consider the resource <code>http://example.org/resource/a</code> available
Expand All @@ -924,7 +925,7 @@ <h3>list profiles</h3>
Content-Profile: &lt;urn:example:profile:x&gt;
Link:
&lt;http://example.org/resource/a&gt;;
rel="self";
rel="canonical";
type="text/turtle";
profile="urn:example:profile:x",
&lt;http://example.org/resource/a&gt;;
Expand Down Expand Up @@ -968,7 +969,7 @@ <h3>list profiles</h3>
Content-Profile: &lt;urn:example:profile:x>
Link:
<strong>&lt;http://example.org/resource/a.prof1.ttl&gt;;</strong>
rel="self";
rel="canonical";
type="text/turtle";
profile="urn:example:profile:x",
&lt;http://example.org/resource/a&gt;;
Expand Down Expand Up @@ -1019,7 +1020,7 @@ <h4>HTTP Alternate Representations Data Model Implementation</h4>
</p>
<ul>
<li><em>link target</em> - <code>&lt;http://example.org/resource/a.prof1.ttl&gt;</code></li>
<li><em>relation type</em> - <code>rel="self"</code></li>
<li><em>relation type</em> - <code>rel="canonical"</code></li>
<li><em>target attributes</em> - <code>type="text/turtle"</code> &amp; <code>profile="urn:example:profile:x"</code></li>
</ul>
<p>
Expand Down Expand Up @@ -1054,7 +1055,7 @@ <h4>HTTP Alternate Representations Data Model Implementation</h4>
<td><code>altp:hasRepresentation</code></td><td>the implicit relation between the <em>link context</em> URI and the <em>link target</em> URI where a <em>relation type</em> of <code>alternate</code> is given</td>
</tr>
<tr>
<td><code>altp:hasDefaultRepresentation</code></td><td>the implicit relation between the <em>link context</em> URI and the <em>link target</em> URI where a <em>relation type</em> of <code>self</code> is given</td>
<td><code>altp:hasDefaultRepresentation</code></td><td>the implicit relation between the <em>link context</em> URI and the <em>link target</em> URI where a <em>relation type</em> of <code>canonical</code> is given</td>
</tr>
</table>
<figcaption>
Expand All @@ -1073,7 +1074,7 @@ <h4>HTTP Alternate Representations Data Model Implementation</h4>
# (&lt;http://example.org/resource/a&gt;; &rarr; &lt;http://example.org/resource/different&gt;;)
Link:
&lt;http://example.org/resource/a&gt;;
rel="self";
rel="canonical";
type="text/turtle";
profile="urn:example:profile:x",
&lt;http://example.org/resource/a&gt;;
Expand Down Expand Up @@ -1190,7 +1191,7 @@ <h3>Token mappings</h3>
Link:
&lt;http://www.w3.org/ns/dx/prof/Profile&gt;; rel="type"; token="dnb"; anchor=&lt;urn:example:profile:marc21-dnb&gt;,
&lt;http://www.w3.org/ns/dx/prof/Profile&gt;; rel="type"; token="loc"; anchor=&lt;http://example.org/profiles/marc21-loc&gt;,
&lt;http://example.org/resource/a.profdnb.ttl&gt;; rel="self"; type="text/turtle"; profile="urn:example:profile:marc21-dnb",
&lt;http://example.org/resource/a.profdnb.ttl&gt;; rel="canonical"; type="text/turtle"; profile="urn:example:profile:marc21-dnb",
&lt;http://example.org/resource/a.profloc.ttl&gt;; rel="alternate"; type="text/turtle"; profile="http://example.org/profiles/marc21-loc",
&lt;http://example.org/resource/a.profdnb.xml&gt;; rel="alternate"; type="application/xml"; profile="urn:example:profile:marc21-dnb",
&lt;http://example.org/resource/a.profloc.xml&gt;; rel="alternate"; type="application/xml"; profile="http://example.org/profiles/marc21-loc",
Expand Down Expand Up @@ -1402,7 +1403,7 @@ <h4>list profiles</h4>
Content-Profile: &lt;http://www.w3.org/ns/dx/conneg/profile/qsa>
Link:
&lt;http://example.org/resource/a?_profile=profile-x&amp;_mediatype=application/json>;
rel="self"; type="application/json";
rel="canonical"; type="application/json";
profile="http://otherexample.org/profile/x",
&lt;http://example.org/resource/a?_profile=profile-x&amp;_mediatype=text/xml>;
rel="alternate";
Expand Down Expand Up @@ -1456,7 +1457,7 @@ <h4>QSA Alternate Representations Data Model Implementation</h4>
# (&lt;http://example.org/resource/a&gt;; &rarr; &lt;http://example.org/resource/different&gt;;)
Link:
&lt;http://example.org/resource/a&gt;;
rel="self";
rel="canonical";
type="text/turtle";
profile="urn:example:profile:x",
&lt;http://example.org/resource/a&gt;;
Expand Down Expand Up @@ -1668,11 +1669,11 @@ <h4>QSA key discovery</h4>
HTTP/1.1 200 OK
Link:
&lt;http://example.org/resource/a?view=profile-x&format=text/html>;
rel="self";
rel="canonical";
type="text/html";
profile="http://otherexample.org/profile/x",
&lt;http://example.org/resource/a?view=profile-x&format=text/turtle>;
rel="self";
rel="canonical";
type="text/turtle";
profile="http://otherexample.org/profile/x",
&lt;http://example.org/resource/a?view=profile-y&amp;format=text/xml>;
Expand All @@ -1682,7 +1683,7 @@ <h4>QSA key discovery</h4>

# Note that here the server does not directly indicate the profile served
# (there is no Content-Profile header present) but this can be inferred
# by the link header with rel="self"
# by the link header with rel="canonical"
</pre>
<p>
While the Link header in <a href="#eg-qsa-keydiscovery"></a> above communicates all the information that a <em>list profiles</em> request
Expand All @@ -1709,11 +1710,11 @@ <h4>QSA key discovery</h4>
HTTP/1.1 200 OK
Link:
&lt;http://example.org/resource/a?view=profile-x&format=text/html>;
rel="self";
rel="canonical";
type="text/html";
profile="http://otherexample.org/profile/x",
&lt;http://example.org/resource/a?view=profile-x&format=text/turtle>;
rel="self";
rel="canonical";
type="text/turtle";
profile="http://otherexample.org/profile/x",
&lt;http://example.org/resource/a?view=profile-y&amp;format=text/xml>;
Expand Down Expand Up @@ -2340,7 +2341,7 @@ <h4>Examples of model use</h4>
title="Multiple format implementation of the previous example's content">
# The content of the previous example expressed as in an HTTP Link header
# as per the HTTP Application Profile of this Specification with the
# default Representation indicated by the use of rel="self". Note the
# default Representation indicated by the use of rel="canonical". Note the
# Representations are seen, one per Link result comma-separated, identified
# only by the combination of the Resource URI, the URI of the Standard to
# which they conform and the rel attribute - they do not have individual
Expand All @@ -2353,7 +2354,7 @@ <h4>Examples of model use</h4>
rel="alternate";
profile="http://otherexample.org/profile/y",
&lt;http://example.org/resource/a>;
rel="self";
rel="canonical";
profile="http://otherexample.org/profile/z"

---
Expand Down

0 comments on commit dee69b7

Please sign in to comment.