Skip to content

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

Comments

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.

That's how I use matrix params in one of my Angular projects - these are very handy to put segment filter params into instead of query params. When you have parallel routes (page/dialog) and filtering everywhere, URLs stay much easier to reason about.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.