logoalt Hacker News

Matrix URIs, a URL syntax from Tim Berners-Lee that never shipped (1996)

26 pointsby napoluxlast Friday at 3:15 PM13 commentsview on HN

Comments

ljnelsontoday at 8:31 PM

Many comments so far seem to imply (perhaps not intentionally) that this syntax was intended only on the "right side" of the URI, but you can think of it more as adding qualifier-like information to (potentially) each path segment. So in /com/foo/bar you could further qualify foo (perhaps as /com/foo;color=yellow/bar). This can be combined with a (definitionally trailing) query string as well. Someone noted that Spring implements some support for this; the Eclipse Foundation's Jersey (Java REST toolkit) does as well if I remember right.

jamesharttoday at 8:01 PM

The generic URI syntax actually specifies that any path segment within a URI can be divided up into parts by semicolons (or commas), and suggests using key=value as parameters within that segment.

http://tools.ietf.org/html/rfc3986#section-3.3

   For
   example, the semicolon (";") and equals ("=") reserved characters are
   often used to delimit parameters and parameter values applicable to
   that segment.  The comma (",") reserved character is often used for
   similar purposes.  For example, one URI producer might use a segment
   such as "name;v=1.1" to indicate a reference to version 1.1 of
   "name", whereas another might use a segment such as "name,1.1" to
   indicate the same
There’s no thought given as far as I can see to the relative URL concepts this matrix proposal covers, but the idea of adding key=value data in this format is supported by the RFC, and indeed in a way that supports further adding sub resources below the current one.

Which, by the way, this matrix relative URL proposal seems to ignore - how is ./subpage resolved relative to /map;x=250;y=582 ?

jacques_chestertoday at 8:00 PM

It did, in at least one way: https://docs.spring.io/spring-framework/reference/web/webmvc...

show 1 reply
namegulftoday at 7:52 PM

Semicolon is also nice on the eyes compared to '&' we're used to today.

Why in the world this didn't gain traction?

drcongotoday at 7:16 PM

I quite like the semi-colons. I wonder how we ended up with the slightly unwieldy ?foo=bar&some=thing

show 4 replies