<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>brettdargan.com &#187; uri</title>
	<atom:link href="http://brettdargan.com/blog/tag/uri/feed/" rel="self" type="application/rss+xml" />
	<link>http://brettdargan.com/blog</link>
	<description>&#955; Thoughts and rants</description>
	<lastBuildDate>Fri, 28 May 2010 01:35:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>link and self; rel=&#8221;canonical&#8221; and rev=&#8221;canonical&#8221;</title>
		<link>http://brettdargan.com/blog/2009/01/22/link-and-self/</link>
		<comments>http://brettdargan.com/blog/2009/01/22/link-and-self/#comments</comments>
		<pubDate>Wed, 21 Jan 2009 23:26:37 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[RESTful]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[uri]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=285</guid>
		<description><![CDATA[This is based on a cross post from http://www.innoq.com/blog/st/2009/01/link_and_self.html. Subbu and &#60;Stefan Tilkov have been discussing URI Equivalence, linking to self and Resource Identities, so here is my view. Subbu's last remark asks the question &#62;&#62;&#62; On January 18, 2009 4:32 AM, Subbu Allamaraju said: Here is a longer response that is longer than a [...]]]></description>
			<content:encoded><![CDATA[
<div class="document">


<!-- -*- mode: rst -*- -->
<p>This is based on a cross post from <a class="reference external" href="http://www.innoq.com/blog/st/2009/01/link_and_self.html">http://www.innoq.com/blog/st/2009/01/link_and_self.html</a>.</p>
<p><a class="reference external" href="http://www.subbu.org/blog/2008/12/resource-identity-and-cool-uris">Subbu</a> and <a class="reference external" href="http://www.innoq.com/blog/st/2009/01/link_and_self.html">&lt;Stefan Tilkov</a> have been discussing URI  Equivalence, linking to self and Resource Identities, so here is my view.</p>
<p><a class="reference external" href="http://www.innoq.com/blog/st/2009/01/link_and_self.html#comment-1926">Subbu's last remark asks the question</a></p>
<pre class="doctest-block">
&gt;&gt;&gt;
On January 18, 2009 4:32 AM, Subbu Allamaraju said:
Here is a longer response that is longer than a comment &lt;img src='http://brettdargan.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /&gt;
</pre>
<p><a class="reference external" href="http://www.subbu.org/blog/2009/01/uris-vs-identifiers-take-two">http://www.subbu.org/blog/2009/01/uris-vs-identifiers-take-two</a></p>
<p>IMHO URI non-equivalence does not imply resource non-equivalence.
And if that is really important to your application there SHOULD be ways to handle it.</p>
<p>I agree with Stefan on providing a canonical resource.</p>
<p>You can argue both ways that person and person with address book are either two representations of a person resource, or two different resources, that is the great thing about the Web.</p>
<p>For this case in the atom self link what about using the &lt;b&gt;rev tag&lt;/b&gt; to identify the canonical resource that makes sense for your application.</p>
<p>Since rev also accepts space separated list of link-types you could mark it with both the type and the uri of the canonical resource.</p>
<!-- code-block: html -->
<p>&lt;link href=&quot;<a class="reference external" href="http://www.example.org/person/abc?include=addressBook">http://www.example.org/person/abc?include=addressBook</a>&quot; rel=&quot;self&quot; rev=&quot;canonical <a class="reference external" href="http://www.example.org/person/abc">http://www.example.org/person/abc</a>&quot;/&gt;</p>
<p>As to whether or not <strong>two different entities that returned from different URI</strong> are based on the <strong>same version of the canonical resource or not</strong>:</p>
<p>I would use an EntityTag that encoded some value of resource state and some value of the representation.
Eg. template for xhtml representation may change without resource state and the ETag must change in order to reflect that.</p>
<p>To KISS.</p>
<p>If you had an ETag consisted of something like <strong>&quot;resourceVersion=20,reprVersion={date}&quot;</strong>
Then your application could extract out the self links with <strong>identical rev tags</strong> and extract from the ETag the resourceVersion.</p>
</div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=link+and+self%3B+rel%3D%E2%80%9Dcanonical%E2%80%9D+and+rev%3D%E2%80%9Dcanonical%E2%80%9D+http%3A%2F%2Ftinyurl.com%2F62ppdrq" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=link+and+self%3B+rel%3D%E2%80%9Dcanonical%E2%80%9D+and+rev%3D%E2%80%9Dcanonical%E2%80%9D+http%3A%2F%2Ftinyurl.com%2F62ppdrq" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2009/01/22/link-and-self/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>URI Design &#8211; Matrix Params for cross-cutting concerns</title>
		<link>http://brettdargan.com/blog/2009/01/16/uri-design-matrix-params-for-cross-cutting-concerns/</link>
		<comments>http://brettdargan.com/blog/2009/01/16/uri-design-matrix-params-for-cross-cutting-concerns/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 14:54:31 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[RESTful]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[uri]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=217</guid>
		<description><![CDATA[Looking at URI design, there are a lot of cross-cutting concerns across many a resource. It would be great to come up with some conventions for the most common. These are some of the ones I've been percolating on. You can see there are a broad range, including: different views or representations of a resource, [...]]]></description>
			<content:encoded><![CDATA[
<div class="document">


<!-- -*- mode: rst -*- -->
<p>Looking at URI design, there are a lot of cross-cutting concerns across many a resource.
It would be great to come up with some conventions for the most common.</p>
<p>These are some of the ones I've been percolating on.</p>
<dl class="docutils">
<dt>You can see there are a broad range, including:</dt>
<dd><ul class="first last simple">
<li>different views or representations of a resource, around breadth/depth of it's data and relations</li>
<li>user request based affects on a representation</li>
<li>resource version</li>
<li>application supporting mechanisms, returning fragments and forms or form fragments</li>
<li>temporality</li>
</ul>
</dd>
</dl>
<p>There are a few more, but the trick is having less, right.</p>
<table border="1" class="docutils">
<colgroup>
<col width="6%" />
<col width="94%" />
</colgroup>
<tbody valign="top">
<tr><td>;version</td>
<td>entity version that is</td>
</tr>
<tr><td>;_for_edit ;_for_inline_edit</td>
<td>return html fragment</td>
</tr>
<tr><td>;_at_instant={utc_milliseconds}</td>
<td>get this resource as it would be represented at this point in time</td>
</tr>
<tr><td>;_for_period=iso8601 format</td>
<td>holidays during these periods/durations. die to start and end date ranges. or ;_for_interval</td>
</tr>
<tr><td>;_role=admin</td>
<td>&nbsp;</td>
</tr>
<tr><td>;_repr=code_value</td>
<td>representation of code_value. May also need numcode_value and maybe a triple for code,short name and description</td>
</tr>
<tr><td>;_repr=summary|detail|depth</td>
<td>you get the idea</td>
</tr>
<tr><td>;_repr=no_ambiguity</td>
<td>return a 300 Multiple Choices, if there must be no ambiguity in the request. If the request can not fully determine the intended resource. Often in practice a convention will be followed, like the latest version of the resource. If you support multiple versions do you do what wikipedia does and offers a disambiguity page (as a standard OK response). Although disambiguity pages could cause issues in situations where you expect all particular requests of a resource to return same formatted representation ie. no ambiguity.</td>
</tr>
<tr><td>;additional_param=xyz</td>
<td>#ambiguity resolution</td>
</tr>
<tr><td>;fragment</td>
<td>&nbsp;</td>
</tr>
</tbody>
</table>
<p>See also <a class="reference external" href="http://wikipedia.com/ISO_8601">ISO8601</a></p>
</div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=URI+Design+%E2%80%93+Matrix+Params+for+cross-cutting+concerns+http%3A%2F%2Ftinyurl.com%2F6hknpzf" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=URI+Design+%E2%80%93+Matrix+Params+for+cross-cutting+concerns+http%3A%2F%2Ftinyurl.com%2F6hknpzf" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2009/01/16/uri-design-matrix-params-for-cross-cutting-concerns/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Query vs. Matrix Params or Path Params</title>
		<link>http://brettdargan.com/blog/2009/01/16/query-vs-matrix-params/</link>
		<comments>http://brettdargan.com/blog/2009/01/16/query-vs-matrix-params/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 14:09:30 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[RESTful]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[rest]]></category>
		<category><![CDATA[uri]]></category>

		<guid isPermaLink="false">http://brettdargan.com/blog/?p=211</guid>
		<description><![CDATA[I've come across a few posts about Matrix Parameters recently and there is a lot of misunderstanding. There are several old posts that discuss and describe these things: Query Strings Considered Harmful w3c MatrixURIs I've summarised what I think is important: urls with query params won't have their response cached by intermediaries/proxies (at present) matrix [...]]]></description>
			<content:encoded><![CDATA[
<div class="document">


<!-- -*- mode: rst -*- -->
<p>I've come across a few posts about Matrix Parameters recently and there is a lot of misunderstanding.</p>
<p>There are several old posts that discuss and describe these things:</p>
<ul class="simple">
<li><a class="reference external" href="http://rest.blueoxen.net/cgi-bin/wiki.pl?QueryStringsConsideredHarmful">Query Strings Considered Harmful</a></li>
<li><a class="reference external" href="http://www.w3.org/DesignIssues/MatrixURIs.html">w3c MatrixURIs</a></li>
</ul>
<dl class="docutils">
<dt>I've summarised what I think is important:</dt>
<dd><ul class="first last simple">
<li>urls with query params <a class="reference internal" href="#won-t-have-their-response-cached-by-intermediaries-proxies-at-present">won't have their response cached by intermediaries/proxies (at present)</a></li>
<li>matrix parameters may appear anywhere in path</li>
<li><a class="reference internal" href="#calculating-the-relative-uri">calculating the relative uri</a> is different</li>
<li>much more than uri convention</li>
<li>query params are generally abused to add new verbs instead of using existing methods on resources</li>
<li>matrix parameters are not resources, they are aspects that help reference a resource in an information space that is difficult to represent within a hierarchy</li>
</ul>
</dd>
</dl>
<p><strong>Tip: If you're not sure if you should use them then don't.</strong></p>
<dl class="docutils">
<dt>Matrix parameters are used with</dt>
<dd><ul class="first last simple">
<li><a class="reference external" href="http://developer.yahoo.com/yui">YUI paging widgets</a></li>
<li><a class="reference external" href="http://rails.org">RoR</a> /some/resource/id;edit</li>
<li>J2ee fallsback to ;jsessionid=xxx when no cookies can be set.</li>
<li><a class="reference external" href="http://jersey.dev.java.net">Jersey (JAX-RS RefImpl) has good support</a></li>
</ul>
</dd>
</dl>
<div class="section" id="caching-issues">
<span id="won-t-have-their-response-cached-by-intermediaries-proxies-at-present"></span><h3>Caching Issues</h3>
<dl class="docutils">
<dt>Intermediaries (proxies) won't cache any url with a query parameter in the url</dt>
<dd><ul class="first last simple">
<li>this is because in the early days of the web, they didn't trust the Cache control information from dynamically generated pages.</li>
<li>Freshness and Validation information are very important pieces of information and the proxy admins took a cautious stance and didn't cache any of it.</li>
</ul>
</dd>
</dl>
<p>As the web has matured the views of devs/admins are changing, the new versions of Squid will default to cache any urls with query parameters</p>
<p>Obviously this could have a very large impact, I've heard google maps image tiles had this issue with some proxies at one time.</p>
</div>
<div class="section" id="relative-uri-calculations">
<span id="calculating-the-relative-uri"></span><h3>Relative URI calculations</h3>
<p>Relative URIs have different affects, as relatives URLs are determined by appending to the Base URI. For Query Parameter requests they are stripped from the Base.</p>
<p>For those still interested I would recommend checking out the following in addition to the <a class="reference external" href="http://tools.ietf.org/html/rfc2616">RFC-2616</a> of course.</p>
<blockquote>
<ul class="simple">
<li><a class="reference external" href="http://www.oreillynet.com/xml/blog/2006/12/the_matrix_revisited.html">the matrix revisited</a></li>
<li><a class="reference external" href="http://rest.blueoxen.net/cgi-bin/wiki.pl?PathsAndQueryStrings">PathsAndQueryStrings</a></li>
<li><a class="reference external" href="http://doriantaylor.com/policy/http-url-path-parameter-syntax">http url path parameter syntax</a></li>
<li><a class="reference external" href="http://blogs.sun.com/sandoz/entry/building_uris">Building URIs</a></li>
</ul>
</blockquote>
</div>
</div>
<div class="tweetthis" style="text-align:left;"><p> <a class="tt" href="http://twitter.com/home/?status=Query+vs.+Matrix+Params+or+Path+Params+http%3A%2F%2Ftinyurl.com%2F6bfbq7g" title="Post to Twitter"><img class="nothumb" src="http://brettdargan.com/blog/wp-content/plugins/tweet-this/icons/en/twitter/tt-twitter-big2.png" alt="Post to Twitter" /></a> <a class="tt" href="http://twitter.com/home/?status=Query+vs.+Matrix+Params+or+Path+Params+http%3A%2F%2Ftinyurl.com%2F6bfbq7g" title="Post to Twitter">Tweet This Post</a></p></div>]]></content:encoded>
			<wfw:commentRss>http://brettdargan.com/blog/2009/01/16/query-vs-matrix-params/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

