url uri urn区别_URI,URL和URN之间的区别

url uri urn区别

Here you will learn about difference between URI, URL and URN.

在这里,您将了解URI,URL和URN之间的区别。

When it comes about accessing WebPages, data, files, audio, videos and other stuff, the foremost thing a programmer has to take care of is about URIs, URLs, and URNs.

当涉及访问网页,数据,文件,音频,视频和其他内容时,程序员最需要注意的就是URI,URL和URN。

So what are they? What roles do they play on the World Wide Web i.e. Internet? And how they differ?

那是什么 他们在万维网(即Internet)上扮演什么角色? 以及它们有何不同?

In this tutorial we are going to find answers about these questions and understand these three terms.

在本教程中,我们将找到有关这些问题的答案并理解这三个术语。

URI (URI)

Uniform Resource Identifier or URI (by definition as per Wikipedia), is a string of character that is used to identify a resource.

统一资源标识符或URI(根据Wikipedia的定义)是用于标识资源的字符串。

URI is actually used to provide an address to a resource on any system, whether over Internet or on your local machine. URI start with the protocol that should be used to access the resource which is followed by the actual address of the resource and other information or constraints parameters about the resource.

URI实际上用于为任何系统上的资源提供地址,无论是通过Internet还是在本地计算机上。 URI以应用于访问资源的协议开头,后跟资源的实际地址以及有关该资源的其他信息或约束参数。

URI consists of two main parts – URL and URN.

URI由两个主要部分组成-URL和URN。

网址 (URL)

Uniform Resource Locator (URL) is a subset of URI, which is the actual physical or logical address of the resource, starting with the protocol that will be used to access that resource and other parameters. URL take up a general form: protocol://host/address_to_file/key=value. Where key = value defines the parameters and constraints used.

统一资源定位符(URL)是URI的子集,它是资源的实际物理或逻辑地址,它始于用于访问该资源和其他参数的协议。 URL采用一般形式:protocol:// host / address_to_file / key = value。 其中key = value定义使用的参数和约束。

For Example – HTML WebPages are accessed using the HTTP (Hyper Text Transfer Protocol) protocol whereas files are accessed using the FTP (File Transfer Protocol) protocol.

例如,使用HTTP(超文本传输​​协议)协议访问HTML WebPage,而使用FTP(文件传输协议)协议访问文件。

(URN)

Uniform Resource Name (URN) is an item specific property of a resource. It doesn’t provide with the protocol used to access the resource neither any address to the resource, however, it give data about the resource itself. Its unique name, encoding used to define the resource, type of resource and other details.

统一资源名称(URN)是资源的项目特定属性。 它没有提供用于访问资源的协议,也没有提供资源的任何地址,但是,它提供了有关资源本身的数据。 它的唯一名称,用于定义资源的编码,资源类型和其他详细信息。

Example for a better understanding:

更好理解的示例:

Let’s take up an example of a man, named Arjun Gupta, living in New Delhi, at 405 B Gomti Nagar.

让我们举一个例子,一个叫Arjun Gupta的人,住在新德里,地址是405 B Gomti Nagar。

Here

这里

Arjun Gupta,

Arjun Gupta,

405 B Gomti Nagar

405 B Gomti Nagar

New Delhi, 266895

新德里266895

This is the URI for the man, the actual address to reach the person.

这是该人的URI,是到达该人的实际地址。

Arjun Gupta, a man – This is URN specific information about the person that will never change.

男人Arjun Gupta –这是有关永远不会改变的人的URN特定信息。

405 B Gomti Nagar, New Delhi, 266895 – This is the URL for the man that may change over time, if the resource (here, man) is moved to some other address.

405 B Gomti Nagar,新德里,266895 –如果资源(此处为人)被移至其他地址,则这是随时间变化的人的URL。

This is just an example, should not be compared in reality.

这只是一个例子,不应该在现实中进行比较。

URI,URL和URN之间的区别 (Difference between URI, URL and URN)

Uniform Resource IdentifierUniform Resource LocatorUniform Resource Name
Combination of URL and URN used to get access to a resource.Subset of URI.Subset of URI.
URI is the physical or logical address to the resource which also includes protocol related information with it.URL is the address of the resource with the protocol and resource specific information included.URN contains the resource specific information.
URI may change over time.URL may change over time.URN never changes for a resource.
Every URI in not URL or URN.Every URL is a URI.Every URN is a URI.
统一资源标识符 统一资源定位器 统一资源名称
URL和用于访问资源的URN的组合。 URI的子集。 URI的子集。
URI是资源的物理或逻辑地址,其中还包括协议相关信息。 URL是包含协议和资源特定信息的资源地址。 URN包含资源特定信息。
URI可能会随着时间而改变。 URL可能会随着时间而改变。 URN永远不会更改资源。
每个URI都不是URL或URN。 每个URL都是一个URI。 每个URN都是一个URI。

Example: 

例:

  • URI: https://en.wikipedia.org/wiki/Main_Page

    URI: https //en.wikipedia.org/wiki/Main_Page

  • URL: https://en.wikipedia.org/wiki/Main_Page

    网址: https //en.wikipedia.org/wiki/Main_Page

  • URN: ISBN number of book, urn:isbn:0451450523

    URN: ISBN图书编号,urn:isbn:0451450523

Comment below if you have queries related to difference between uri, url and urn.

如果您对uri,url和urn之间的差异有疑问,请在下面评论。

翻译自: https://www.thecrazyprogrammer.com/2018/04/difference-between-uri-url-and-urn.html

url uri urn区别

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值