为什么 URN 是用于唯一标识资源的更流行的格式之一?

发布于 2024-08-19 03:48:07 字数 501 浏览 15 评论 0 原文

我在某种程度上理解 URN 用于为资源提供唯一且与位置无关的名称。但我看不到它们的用处以及它们到底是如何工作的:

a)为了让 URN 真正具有唯一性,必须有一些中央机构(类似于域名机构),我们可以在其中注册 URN,从而确保它们是独一无二的。 既然没有这样的权威,我们如何确保我们的 URN 是唯一的呢?如果我们不能。那么拥有它们还有什么意义呢?

b) 另外,我不明白 URN 格式为 urn:NID:NSS 背后的原因。是什么让这种格式比 urn:NID:NID1:NSS 更高效/更有逻辑?

c) 最后,URN 如何帮助我们在互联网上定位资源?


编辑:

我不确定你的意思。 NID 是命名空间标识符,NSS 是命名空间特定字符串 您是否建议使用子命名空间系统?

我只是想理解为什么 URN 使用的格式比其他格式“出色”,例如 urn:NID:NID1:NSS

I somewhat understand that URNs are used to provide unique and location independent name for the resource. Yet I fail to see their usefulness and how exactly they work:

a) In order for URN to really be unique, there would have to be some central authority (similar to authority for domain names) where we could register URNs and that way ensure they are unique.
Since there isn’t any such authority, how else do we make sure that our URNs are unique? And if we can’t. then what’s the point of having them?

b) Also,I don’t understand the reasoning behind URNs having the format urn:NID:NSS. What makes this format more efficient/logical than for example urn:NID:NID1:NSS?

c) And finally, how can URN help us locate a resource on the internet?

EDIT:

I'm not sure what you mean. NID is the Namespace Identifier and NSS is the Namespace Specific String Are you proposing a system of sub-namespaces?

I’m just trying to make sense of why the format URN uses is “superb” to other formats, such as urn:NID:NID1:NSS

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

人疚 2024-08-26 03:48:07

a) 为了让 URN 真正唯一,必须有一些中央权威...既然没有任何这样的权威,我们如何确保我们的 URN 是唯一的?

有一个中央机构,称为 IANA,负责注册命名空间(NID部分),每个命名空间负责以确保唯一性。

b) 另外,我不明白 URN 格式为 urn:NID:NSS 背后的原因。是什么使得这种格式比 urn:NID:NID1:NSS 更高效/更有逻辑?

"urn:NID:NSS" 描述 指出 NSS 的解释取决于值的 NID。例如,如果 NID 是“isbn”,那么我们知道将 NSS 解释为 ISBN 编号,如“urn:isbn:0451450523”。

NSS 部分可以包含冒号,因此“urn:example:other:more”是有效的语法。 (事实上​​,这是一个有效的 URN 截至 2013 年 4 月 24 日。)例如,给定“urn:mpeg:mpeg7:schema:2001”,NSS 部分为“mpeg7:schema:2001”,我们根据 "mpeg" 命名空间

如果需要“urn:NID:NID1:NSS”,那么它将是多余的(某些命名空间不需要嵌套的 NID1)和多余的(命名空间的权限已经可以将 NSS 部分分开,如上面的 mpeg 所示)例子)。

c) 最后,URN 如何帮助我们在互联网上定位资源?

URN 与位置无关,而是一个 URL

a) In order for URN to really be unique, there would have to be some central authority... Since there isn’t any such authority, how else do we make sure that our URNs are unique?

There is a central authority, called IANA, to register namespaces (the NID part), and each namespace is responsible for ensuring uniqueness.

b) Also, I don’t understand the reasoning behind URNs having the format urn:NID:NSS. What makes this format more efficient/logical than for example urn:NID:NID1:NSS?

The "urn:NID:NSS" description states the interpretation of NSS depends on the value of NID. For example, if NID is "isbn", then we know to interpret the NSS as an ISBN number, as in "urn:isbn:0451450523".

The NSS part can contain colons, so "urn:example:other:more" is valid syntax. (And in-fact is a valid URN as of 2013-04-24.) For example, given "urn:mpeg:mpeg7:schema:2001", the NSS part is "mpeg7:schema:2001" and we interpret that according to the rules for the "mpeg" namespace.

Had "urn:NID:NID1:NSS" been required, it would have been redundant (some namespaces don't need a nested NID1) and superfluous (the authority for a namespace can already divide the NSS part up, as in the above mpeg example).

c) And finally, how can URN help us locate a resource on the internet?

URNs are not about location, that's a URL.

旧街凉风 2024-08-26 03:48:07

a) 为了让 URN 真正具有唯一性,必须有一些中央机构(类似于域名机构),我们可以在其中注册 URN,从而确保它们是唯一的。既然没有这样的权威,我们如何确保我们的 URN 是唯一的呢?如果我们不能。那么拥有它们还有什么意义呢?

ISBN 用作 URN,并由机构管理。

b) 另外,我不明白 URN 格式为 urn:NID:NSS 背后的原因。是什么使得这种格式比 urn:NID:NID1:NSS 更高效/更有逻辑?

我不确定你的意思。 NID 是命名空间标识符,NSS 是命名空间特定字符串 您是否提议使用子命名空间系统?

c) 最后,URN 如何帮助我们在互联网上定位资源?

URN(统一资源名称)不能帮助您在 Internet 上查找某些内容。 URL(统一资源定位器)可以。

另请参阅 URI 和 URL 之间有什么区别?< /a>

a) In order for URN to really be unique, there would have to be some central authority (similar to authority for domain names) where we could register URNs and that way ensure they are unique. Since there isn’t any such authority, how else do we make sure that our URNs are unique? And if we can’t. then what’s the point of having them?

An ISBN is used an a URN, and is managed by an agency.

b) Also,I don’t understand the reasoning behind URNs having the format urn:NID:NSS. What makes this format more efficient/logical than for example urn:NID:NID1:NSS?

I'm not sure what you mean. NID is the Namespace Identifier and NSS is the Namespace Specific String Are you proposing a system of sub-namespaces?

c) And finally, how can URN help us locate a resource on the internet?

A URN (Uniform Resource Name) doesn't help you locate something on the Internet. A URL (Uniform Resource Locator) does.

Also see What is the difference between URI and URL?

你爱我像她 2024-08-26 03:48:07

URN

URN ( 统一资源名称 ),在(时间和空间

一个URL\URI不能保证他的唯一性,不像URN可以同时是一个URI

也许路径 (Y) 中的 URI 资源 (X) 是有效的 URL ,因为路径可以是一个位置,但相同的整个标识符 (Z) 可以在许多物理、逻辑或虚拟位置< /em> 在世界上。

``

# Unique only in the same actual location

Z = [Y => X];
A = [B => Z];
C = [D => Z];

但是,如果我们在开头添加一个Uniform U(例如可以是域名),它可以更灵活,但不唯一(域名可能会过期)。

# Unique only in the same actual location

Z = [ U => Y => X ];

相同的格式可以通过其他变量来扩展和扩展,试图使其尽可能唯一

因此,我们必须确保这里有一种更复杂和真正独特的格式,可以跨时间和空间识别更多类型的资源

``

URN”不是“URL 例外用作唯一持久 URL一个名字 ,因为他们不是在定位资源,事实上他们比你想象的更多,他们可以识别[ *想法, UUID、虚拟或物理对象等等* ],但两者加上“URC/数据 URI”可以是“URI”。

注意:

在这里查看一个简单且更清晰的 URN 示例:

https://stackoverflow.com /a/1984274/5405973

这是一个信息非常丰富的链接:

https://stackoverflow.com/a/28865728/ 5405973

URNs

a URN ( Uniform Resource Name ), is supposed to be unique across both ( time and space ).

a URL\URI cannot guarantee his uniqueness, unlike a URN that can be a URI in the same time.

Maybe a URI Resource (X) in path (Y) is a valid URL, because the path can be a location, but the same whole Identifier (Z) can be duplicated in many physical, logical or virtual locations in the world.

``

# Unique only in the same actual location

Z = [Y => X];
A = [B => Z];
C = [D => Z];

But if we add A Uniform U (could be a domain name for example) at the beginning it can be more flexible but not unique (domains can get expired).

# Unique only in the same actual location

Z = [ U => Y => X ];

The same format can be extended and extended by other variables trying to make it as Unique as possible.

Because of this last, we have to make sure a more sophisticated and real unique format is here, that can identify more type of Resources across time and space.

``

"URNs" are not a "URLs" ( exception ofUnique persistant URL used as a name ), because they are not locating a resource, in fact they are more then what your think, they can identify [ *ideas, UUIDs, virtual or physical Objects and more* ], but both of them plus "URCs/data URIs" can be "URIs".

Note :

Take a look into a simple and more clear example of URNs here :

https://stackoverflow.com/a/1984274/5405973

And here is a very informative link :

https://stackoverflow.com/a/28865728/5405973

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文