learn,no end

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

或许你知道URL是什么,但是你知道什么是URI、URN吗?我以前是只知道URL的。

关于URI vs URN vs URL我没有更简单明了的解释,就直接翻译一段Wikipeia上最主要的一段话吧。

翻译之前:先看一下这个图,我们就明白七八分了。

  首先需要交代的是,这三组缩写代表的是什么:

   URI:Uniform Resource Identifier

         URL:Uniform Resource Locator

         URN:Uniform Resource Name

     

    人们一般把URI简称为URL或URN,有时也同时使用URL和URN。其实,URN类似于一个人的名字,而URL就相当于这个人的地址。简单地说,在网络系统中,URN来确定资源的身份,与此相应得URL提供一种找得到这个资源的地址。

     ISBN系统特意提供了一个很典型的例子。比如说我们想引用某一版本的莎士比亚戏剧Romeo and Juliet(注意这里的Romeo and Juliet就是我们要获取的资源的URI)。为了能得到这个"Romeo and Juliet",我们还需要一个地址,即一个URL,这时候还需要确定的是这本书的电子资源已经以文件的形式存储在某一台服务器的硬盘中了,我们假设这一条件已经满足,并且这个文件的URL为:file:///home/username/RomeoAndJuliet.pdf 。所以,如此看来在我们日常的应用中往往是将资源的URN和URL联合起来使用的。

下面是Wikipedia的原文:

"One can classify URIs as locators (URLs), or as names (URNs), or as both. A Uniform Resource Name (URN) functions like a person's name, while a Uniform Resource Locator (URL) resembles that person's street address. In other words: the URN defines an item's identity, while the URL provides a method for finding it.

The ISBN system for uniquely identifying books provides a typical example of the use of URNs. ISBN 0486275574 (urn:isbn:0-486-27557-4) cites unambiguously a specific edition of Shakespeare's play Romeo and Juliet. To gain access to this object and read the book, one needs its location: a URL address. A typical URL for this book on a Unix-like operating system would be a file path such as file:///home/username/RomeoAndJuliet.pdf, identifying the electronic book saved in a file on a local hard disk. So URNs and URLs have complementary purposes.  "

 

进一步了解URI vs URN vs URL:

http://www.davidarno.org/2008/01/31/url-vs-uri-vs-urn/

http://en.wikipedia.org/wiki/Uniform_Resource_Identifier

posted on 2010-06-04 16:35  知足长乐  阅读(397)  评论(0编辑  收藏  举报