URI,URL和URN有什么区别? [英] What is the difference between URI, URL and URN?

查看:147
本文介绍了URI,URL和URN有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

URI,URL和URN之间有什么区别?我已经阅读了很多网站(甚至维基百科),但我不明白。

What's the difference between an URI, URL and URN? I have read a lot of sites (even Wikipedia) but I don't understand it.

URI: http://www.foo.com/bar.html

网址: http://www.foo.com/bar.html

URN:bar.html

URI: http://www.foo.com/bar.html
URL: http://www.foo.com/bar.html
URN: bar.html

这是正确的吗?

推荐答案

统一资源标识符( URI )是用于标识Internet上的名称或资源的字符串

Uniform Resource Identifier (URI) is a string of characters used to identify a name or a resource on the Internet

URI按位置或名称或两者标识资源。 URI有两种称为URL和URN的特殊化。

A URI identifies a resource either by location, or a name, or both. A URI has two specializations known as URL and URN.

统一资源定位器( URL )是统一资源标识符(URI)的子集,它指定了已识别资源的可用位置以及检索它的机制。 URL定义了如何获取资源。它不必是HTTP URL(http://),URL也可以是(ftp://)或(smb://)。

A Uniform Resource Locator (URL) is a subset of the Uniform Resource Identifier (URI) that specifies where an identified resource is available and the mechanism for retrieving it. A URL defines how the resource can be obtained. It does not have to be HTTP URL (http://), a URL can also be (ftp://) or (smb://).

A统一资源名称( URN )是使用URN方案的统一资源标识符(URI),并不意味着已识别资源的可用性。 URN(名称)和URL(定位符)都是URI,特定URI可以同时是名称和定位器。

A Uniform Resource Name (URN) is a Uniform Resource Identifier (URI) that uses the URN scheme, and does not imply availability of the identified resource. Both URNs (names) and URLs (locators) are URIs, and a particular URI may be both a name and a locator at the same time.

URN是一个更大的互联网信息架构,由URN,URC和URL组成。

The URNs are part of a larger Internet information architecture which is composed of URNs, URCs and URLs.

bar.html不是URN 。 URN类似于人名,而URL就像街道地址。 URN定义了某些东西的身份,而URL则提供了一个位置。基本上,什么与何处。 URN必须是这种形式< URN> :: =urn:< NID> :< NSS> 其中< NID> 是命名空间标识符,< NSS> 是命名空间特定字符串。

bar.html is not a URN. A URN is similar to a person's name, while a URL is like a street address. The URN defines something's identity, while the URL provides a location. Essentially, "what" vs. "where". A URN has to be of this form <URN> ::= "urn:" <NID> ":" <NSS> where <NID> is the Namespace Identifier, and <NSS> is the Namespace Specific String.

换一种说法:



  • URL是一个标识资源的URI,还提供了通过描述访问资源的方式来查找资源的方法

  • 网址是URI

  • URI不一定是网址

我要说的唯一让它100%清晰的事情就是拥有一个不是URL的URI示例。我们可以使用 RFC3986 中的示例:

I'd say the only thing left to make it 100% clear would be to have an example of an URI that is not an URL. We can use the examples in the RFC3986:

URL: ftp://ftp.is.co.za/rfc/rfc1808.txt
URL: http://www.ietf.org/rfc/rfc2396.txt
URL: ldap://[2001:db8::7]/c=GB?objectClass?one
URL: mailto:John.Doe@example.com
URL: news:comp.infosystems.www.servers.unix
URL: telnet://192.0.2.16:80/
URN (not URL): urn:oasis:names:specification:docbook:dtd:xml:4.1.2
URN (not URL): tel:+1-816-555-1212 (?)

同时检查一下 - https://quintupledev.wordpress.com/2016/02/29/difference-between-uri-url-and-urn/

Also check this out - https://quintupledev.wordpress.com/2016/02/29/difference-between-uri-url-and-urn/

这篇关于URI,URL和URN有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆