The Meaning of URL, URI, URN
Many people know that a URI is “something like a URL” but do not properly understand the relationship between URI and URL, or indeed its relationship with other acronyms such as IRI and URN.
许多人都知道URI是一种很像URL的东西,但这不清晰的描述把URI和URL的联系到一起是一种不合适的表达,同理,如果把URI混淆于IRI和URN也是不正确的。
Most people are familiar with URLs (uniform resource locators), such as “http://…”, “ftp://…”, “mailto:…”. Put simply, a URL specifies the location of a resource.
我们对于URL(统一资源定位符)非常熟悉,因为我们经常见到诸如“http://..”,“ftp://..”,”maito:..”,所以简而言之,URL就是表示一种特殊的资源定位符。
A URI (uniform resource identifier) is a URL or a URN. So, to fully understand what URI means, you need to first understand what is a URN.
URI(统一资源标识符)要么是URL要么是URN(也就是说URL和URN是URI的子集,举例:这里有一个URN,那么可以肯定的是它就是一种URI),所以,为了更加完全的理解什么URI,你需要首先明白什么是URN。*
URN is an acronym for uniform resource name. There are may “unique identifier” schemes in the world, for example, ISBNs (globally unique for books), social security numbers (unique within a country), customer numbers (unique within a company’s customers database) and telephone numbers. Each “unique identifier” scheme has its own notation.
URN是uniform resource name的首字母缩写,通俗表达:统一资源名称。在世界上有许多的特殊标识符,例如,ISBN(International Standard Book Number 国际标准书名序列号),社会安全号码(美国是这个东西,他们没有户口的概念,人可以自由流动,和我们国情不符,类似于我们这里的身份证号码),客户号码,电话号码等等。每一种特殊标识方法都有其独有的标识规则和描述。
A URN is a wrapper for different “unique identifier” schemes. The syntax of a URN is “urn:<scheme-name>:<unique-identifier>
“. A URN uniquely identifies a resource, such as a book, person or piece of equipment. By itself, a URN does not specify the location of the resource. Instead, it is assumed that a registry provides a mapping from a resource’s URN to its location. The URN specification does not state what form a registry takes, but it might be a database, a server application, a wall chart or anything else that is convenient. Some hypothetical examples of URNs are “urn08765245”, “urn
uk
hul8” and “urn
0000-0000-9E59-0000-5E-2”. The
<scheme-name>
(“employee”, “customer” and “foo” in these examples) part of a URN implicitly defines how to parse and interpret the <unique-identifier>
that follows it. An arbitrary URN is meaningless unless: (1) you know the semantics implied by the <scheme-name>
, and (2) you have access to the registry appropriate for the <scheme-name>
. A registry does not have to be public or globally accessible. For example, “urn08765245” might be meaningful only within a specific company.
URN就是一个相对于不同的特殊标识符提供到规则的映射(URN是一种映射,关于标识符到标识符本身含义或规则的映射),URN语法规则是:urn:<scheme-name>:<unique-identifier>
,URN的作用是标识一个独有的资源,例如可以标识一本书,一个人或者一种装备,但是URN却不是用来定位一个资源,相反,它指出的关于此类标识符总所周知的一个映射:资源的URN和其位置的映射,(也就是说URN会告诉你what is the thing,不会告诉你where the thing,他们之间不存在名字到位置的直接联系,但存在一种关系)。URN的说明书并不意味着我们只能用URN标识注册者提供的一些东西,它可以标识一个数据库、一个服务器应用程序,一个墙上的图表,甚至你想简单化表达的任何东西。
一些假定的关于URN的例子有:”urn08765245”,”urn
uk
hul8”,”“urn
0000-0000-9E59-0000-5E-2”,在以上例子中(”employee”,”customer”,”foo”)代表的是URN标识名
<scheme-name>
的一部分,这些名字含蓄的定义了怎样去解析和理解紧跟在URN标识名后面的特殊标识符<unique-identifier>
。一个标准的的URN结构必须至少含有以下几种含义:(1)人们知道格式中标识名<scheme-name>
所代表的含义(2)您可以访问注册表中相应的标识符名称<scheme-name>
。这个注册没有必要必须是公共的或者全球访问,例如”urn08765245”或许仅仅在一个公司内部具有实用性。
To date, URNs are not (yet) as popular as URLs. For this reason, URI is widely misused as a synonym for URL.
今天,URN并没有URL流行,基于这个原因,URI和URL一样具有广泛的知名度和使用率。
原文地址:The Meaning of URL, URI, URN and IRI
翻译捉襟见肘,只是为了加深自己的理解,错误地方 ,烦请指证,感激不尽。
关于URI和URL和URN的探讨推荐一下比较好的两个链接:
(1)URL 和 URI 有什么不同? 知乎用户biaodianfu.com
(2)URL和URI的区别
还没有评论,来说两句吧...