Matrix URI:蒂姆·伯纳斯-李(Tim Berners-Lee)提出但从未发布过的 URL 语法(1996 年)
Matrix URIs, a URL syntax from Tim Berners-Lee that never shipped (1996)

原始链接: https://www.w3.org/DesignIssues/MatrixURIs.html

在这份 1996 年的设计笔记中,蒂姆·伯纳斯-李(Tim Berners-Lee)探讨了“矩阵 URI”(Matrix URIs)这一概念,将其作为在网址中处理多维数据的一种方法。虽然标准的 URL 路径代表层级树结构(使用斜杠分隔),但他提出使用以分号分隔的参数(例如 `;lat=50;long=20`)来导航“矩阵”空间,从而实现对变量的独立调整。 通过类比程序过程调用,伯纳斯-李指出,这种语法可以实现高效的相对 URI 解析。通过将参数附加到基础 URL 上,用户无需重定义整个路径即可修改特定属性(例如更改地图比例)。他讨论了该系统的理论需求,并指出要使该模型有效运作,这些参数必须是无序且唯一的,并需具备明确的移除或修改方法。 尽管伯纳斯-李将其视为 Web 架构的一种自然演进,但他承认这种语法从未得到统一的定义,也未在浏览器中得到广泛实现。因此,该文档始终是对 URI 结构如何被利用以更动态地管理复杂、非层级数据的一种理论探索。

Hacker News 最新 | 过往 | 评论 | 提问 | 展示 | 招聘 | 提交 登录 Matrix URI:Tim Berners-Lee 提出但从未发布的 URL 语法 (1996) (w3.org) 12 分,由 napolux 发布于 1 小时前 | 隐藏 | 过往 | 收藏 | 2 条评论 | 帮助 drcongo 17 分钟前 [–] 我挺喜欢分号的。我很好奇我们是怎么用上现在这种略显笨重的 ?foo=bar&some=thing 的。 回复 pavlov 6 分钟前 | 父评论 [–] 试想一下:“我该如何实现一个能在浏览器地址栏中显示界面的搜索引擎?”在早期的互联网上,这是一个合理的问题。这就是为什么它们被称为“查询参数”(query params)。问号表示你正在进行查询,而“&”是一个布尔运算符。你可以想象查询参数除了“&”之外还可以实现“|”。 回复 准则 | 常见问题 | 列表 | API | 安全 | 法律 | 加入 YC | 联系 搜索:
相关文章

原文
Matrix URIs - Ideas about Web Architecture
Tim Berners-Lee

Date: December 19, 1996

Status: personal view. Editing status: Italic text is rough. Reques complete edit and possibly massaging, but content is basically there. Words such as "axiom" and "theorem" are used with gay abandon and the reverse of rigour here. This file was split off from Axioms.html on 2001/1/15 as matric URI parsing is not a feature of the web. This is just something which could have been.

Up to Design Issues

Matrix URIs - Ideas about Web Architecture


Matrix spaces and Semicolons

It is maybe obvious to note that there are many, many hierarchical systems. An interesting analogy with a hierarchical power is, in a programming language, a sequence of parameters supplied to a command or a procedure. For example, in some languages a procedure may take positional parameters which may be optional so that any parameters from a certain point on may be omitted. This syntax can be compared with a hierarchical slash separated URL path. This is an interesting analogy because looking at the alternative representation for procedure parameters which consists of a list of procedure name and value pairs. This leads us naturally to a discussion of the use of the semi-colon in URLs and the matrix syntax. Just as the slash separated set of elements is useful for representing a tree, so a set of names and equally significant parameter can represent a space more like a (possible sparse) matrix. In this case navigation to "close" locations is done by varying one or more parameters which form the dimensions of the matrix. This is the purpose of the a=b; parts of URL syntax which was added later in the URL's history. The initial need was to put qualifiers onto URLs which were themselves hierarchical.

The analogy with procedure call holds still when looking at combined forms: The hierarchical part of the URL is paused first, and then the semi-colon separated qualifiers are paused as indicating positions in some matrix. As an example let's imagine the URL of an automatically generated map in which the parameters for latitude, longitude and scale are given separately. Each may be named, and each if omitted may take a default. So, for example,

         //moremaps.com/map/color;lat=50;long=20;scale=32000

might be the URL of an automatically generated map.

Parsing matrix URLs: issues

How should one pause relative URLs in this context? Clearly the most convenient is to be able to select a similar map of a different scale simply by specifying ;scale=64000 as a relative URL. The pausing of the syntax has not been well defined in the URL circles and to my knowledge, has not been consistently used. So, in January 1997, whereas this might be a good idea, it is not currently implemented. However, this is the natural way to pause relative URLs which contain named parameter values. Another unresolved question is whether the order of such parameters should be significant, as logically expressing the same set of parameters in a different order normally has the same semantics. When a relative URL starts with a semi-colon, one can imagine the significance of that to be that all parts of the URL other than the parameters remain unchanged; that the parameters which have not been specified in the relative URL remain unchanged and that the parameter given in the URL takes its given value in place of any GET value in the original URL. Clearly, when adding another parameter value, this does not allow one to specify where it takes its place in the set of parameter values, which then implies that the order of the parameters must be immaterial. There is also the question of how to logically, in a relative URL, remove a parameter, but this could clearly be done if the convention is that a missing parameter has the same significance as a present perimeter with the now string as its value. It is not at all evident that this is what is most wise, so perhaps a special syntax should be used for deleting perimeters.

Parsing matrix URLs

Note: relative Matrix URLs are notgenerally implemented so this is just a theoretical discussion.

It is only sensible for relative URls which start with ";" to take a set of attribute values which are different from those of the base URL. This implies:

  1. attributes can only occur once (unless you have a syntax for identifying and removing a particular occurrence, which is very messy) and
  2. there must be a syntax for removing an attribute, hopefully distinguishing a removed attribute from one whose value if the empty string; and
  3. attributes are unordered

So, by these rules, relative to

        //moremaps.com/us/ma/cambridge;scale=50000;roads=main
 

or the equivalent

        //moremaps.com/us/ma/cambridge;roads=main;scale=50000
 

relative URLs would be parsed as follows.

Relative URI should be interpreted as
; //moremaps.com/us/ma/cambridge;scale=50000;roads=main
;scale=25000 //moremaps.com/us/ma/cambridge;scale=25000;roads=main
;roads //moremaps.com/us/ma/cambridge;scale=50000
;roads= //moremaps.com/us/ma/cambridge;scale=50000;roads=
;rivers=all //moremaps.com/us/ma/cambridge;scale=50000;roads=main;rivers=all

This is worth insituting (1996) if it can be deployed without crisis, though it clearly cannot be relied on today in browsers.


$Id: MatrixURIs.html,v 1.2 2001/02/15 21:02:49 timbl Exp $

Back up to "URIs"

Up to Design Issues

htm
联系我们 contact @ memedata.com