什么是 link 格式资源的 CoAP 基础 uri

What is link format resources's base uri for CoAP

当我阅读 RFC6690 确定 link 格式的上下文 URI 的规则时

我无法理解“link 格式化资源的基本 uri”是什么意思

2.1. Target and Context URIs

Each link conveys one target URI as a URI-reference inside angle brackets ("<>"). The context URI of a link (also called the base URI in [RFC3986]) is determined by the following rules in this specification:

(a) The context URI is set to the anchor parameter, when specified.

我的理解:只需检查“锚点”属性

(b) Origin of the target URI, when specified.

我的理解:如果目标 URI 是绝对 uri(包含来源),则使用其来源(没有路径和查询)作为上下文

(c) Origin of the link format resource's base URI.

我的理解:我迷路了,我应该去哪里找这个base uri?

我知道原点是defined as a combination of URI scheme, host name, and port number

我也理解 Base URI 是一个绝对 URI,相对 URI 可以解析。

但我无法理解 "base uri" 在 RFC6690 第 2.1 节的上下文中的含义

如果资源目标 uri 不是绝对 uri 并且没有来源,那么如何找到 link 格式资源的基础 uri 的来源?

RFC6690 在这里混合了概念(“link 的上下文 URI(也称为基本 URI[...])”——上下文和基本 URI 是不同的概念)。他们在这里所说的基本 URI 的意思是锚点属性指向的 URI(当缺少时,默认为从中请求文档的 URI)。

普遍的解释似乎是 link 的 context 是根据请求的 URI 的来源解析的锚点属性(当没有锚点时,它 所请求 URI 的来源),而 link 的 目标 是 angular 之间的部分括号解决了上下文的起源。这与那里写的不完全一样,但至少它适用于同一文档中给出的示例。

那里列出的规则非常混乱(而且,最糟糕的是,与 Link header 中非常相似的规则不同),即使您严格遵守它们,你不能指望互操作性:在我为 CoRE mailing list, none considered the anchor properly in the resolution. I suggest you stick with Limited Link Format (defined in the Resource Directory Draft) 调查的所有实现中,它与 Link headers 和 RFC6690 的解析步骤兼容,并伴随着 walk-through.

(我确实非常希望所有 link-format 在长 运行 上被 CoRAL 取代,但进展还不够远,我会推荐它实施生产环境附近的任何地方。)