你能举一个供私人使用的 URN 的例子吗
Can you give an example of a URN for private-use
根据维基百科,
urn:<NID>:<NSS>
The leading urn: sequence is case-insensitive. <NID>
is the namespace identifier, which determines the syntactic
interpretation of <NSS>
, the namespace-specific string. The functional
requirements for uniform resource names are described in RFC 1737.[5]
来源:http://en.wikipedia.org/wiki/Uniform_resource_name
然后它继续说实验性 NID 是前缀 X-
但接着说:
RFC 6648 deprecates the use of "X-" notation for new ID names, but
makes no recommendation on substituting existing "X-" names, and does
not override existing specifications that require the use of "X-". [7]
那么现在呢?
如果我想为私有系统中的一些标识符补一个URN,如何正确命名它们?
我的直觉说 x-
前缀没有任何好处,因为两个开发人员可以很容易地开始使用 urn:x-foo
,这与他们刚刚选择的没有任何不同urn:foo
,除了很明显它没有在 IANA 正式注册。
所以我们应该尝试制作一些独特的东西,并尽最大努力检查它是否是。对吗?
As far as I know, RFC 6648 does not make experimental NIDs (as defined by RFC 3406)无效。
draft for the next RFC about URNs(目前)已按照 RFC 6648 的建议删除了实验性 NID(使使用 x-
的 URN 无效)。
My gut says that the x-
prefix doesn't gain anything because two developers could just as easily start using urn:x-foo
and it wouldn't be any different to if they'd just chosen urn:foo
, except perhaps that it'd be clear that it wasn't officially registered with IANA.
好吧,RFC 3406 defines 那
No provision is made for avoiding collision of experimental NIDs
而且他们是
intended for use within internal or limited experimental contexts.
因此,首先,您不应该以其他方(不了解您的 use/definition 这些实验性 NID)会遇到它们的方式使用实验性 NID。
或者换句话说:实验性 NID 的冲突应该没有问题,因为每一方都应该只在内部或实验性地使用它们,并且不应该期望能够对不受他们控制的实验性 NID 做任何有用的事情。
所以……
如果您只想将 URN 用于私人目的,您仍然可以使用 X-
NID(遵循 RFC 3406),直到它被新的 RFC 废弃。或者,您可以从 example
NID.
生成 URN
如果您想使用 URN publicly/seriously,您希望它们是唯一的(避免冲突)和定义的(使它们对其他作者和消费者有用)。这就是 URN 的全部意义,对吧?为此,您必须注册您的 NID。
不想注册就不要用URN。还有许多其他 URI schemes available (e.g., Tag URIs 浮现在脑海中)。
根据维基百科,
urn:<NID>:<NSS>
The leading urn: sequence is case-insensitive.
<NID>
is the namespace identifier, which determines the syntactic interpretation of<NSS>
, the namespace-specific string. The functional requirements for uniform resource names are described in RFC 1737.[5]
来源:http://en.wikipedia.org/wiki/Uniform_resource_name
然后它继续说实验性 NID 是前缀 X-
但接着说:
RFC 6648 deprecates the use of "X-" notation for new ID names, but makes no recommendation on substituting existing "X-" names, and does not override existing specifications that require the use of "X-". [7]
那么现在呢?
如果我想为私有系统中的一些标识符补一个URN,如何正确命名它们?
我的直觉说 x-
前缀没有任何好处,因为两个开发人员可以很容易地开始使用 urn:x-foo
,这与他们刚刚选择的没有任何不同urn:foo
,除了很明显它没有在 IANA 正式注册。
所以我们应该尝试制作一些独特的东西,并尽最大努力检查它是否是。对吗?
As far as I know, RFC 6648 does not make experimental NIDs (as defined by RFC 3406)无效。
draft for the next RFC about URNs(目前)已按照 RFC 6648 的建议删除了实验性 NID(使使用 x-
的 URN 无效)。
My gut says that the
x-
prefix doesn't gain anything because two developers could just as easily start usingurn:x-foo
and it wouldn't be any different to if they'd just chosenurn:foo
, except perhaps that it'd be clear that it wasn't officially registered with IANA.
好吧,RFC 3406 defines 那
No provision is made for avoiding collision of experimental NIDs
而且他们是
intended for use within internal or limited experimental contexts.
因此,首先,您不应该以其他方(不了解您的 use/definition 这些实验性 NID)会遇到它们的方式使用实验性 NID。
或者换句话说:实验性 NID 的冲突应该没有问题,因为每一方都应该只在内部或实验性地使用它们,并且不应该期望能够对不受他们控制的实验性 NID 做任何有用的事情。
所以……
如果您只想将 URN 用于私人目的,您仍然可以使用
生成 URNX-
NID(遵循 RFC 3406),直到它被新的 RFC 废弃。或者,您可以从example
NID.如果您想使用 URN publicly/seriously,您希望它们是唯一的(避免冲突)和定义的(使它们对其他作者和消费者有用)。这就是 URN 的全部意义,对吧?为此,您必须注册您的 NID。
不想注册就不要用URN。还有许多其他 URI schemes available (e.g., Tag URIs 浮现在脑海中)。