RE: URI Templates - optional variables?

Marc Hadley wrote:
> I'd be interested to hear more about the use case for a URI 
> template that behaves in this way. E.g. I'd expect that:
> would identify two quite different resources, whereas:
> *could* identify two instances of particular kind of 
> resource. I'd like to understand what is the planned use for 
> a URI template that can resolve to either of the first pair - 
> why wouldn't you use two different URI templates ?

>From the exploration I've been doing the examples for benefit of optional
parameters are more in the area of parameters and fragments, but it is still
applicable for in path segments and if the use of the question mark were
allowed to define optional parameters and fragments then it shouldn't be
undefined when found in a path segment.

Where it would be most useful in path segments is when you view the URL path
segments as a generalized query mechanism:{make?}/{model?}/{year?}/
For make=bmw, model=, and year=2004 you would have:
For make=, model=m5, and year= you would have:
Now perchance you object to the fact that we could have a make or model with
the same name, or two models with the same name I will say 1.) that's an
orthogonal issue and should be debated seperately from the the URI template
spec, and 2.) you would list them all using id tags that would identify them
as unique:

Or in the case a hypothetical new car make came on the market that had the
same name as a model from another make:

Of course that begs the question of how to represent the fragments in the
URI template, but I'll let this sink in first before I try to tackle that.

-Mike Schinkel -

P.S. And yes, I am actively designing websites with these concepts.  One
concern others may have is it can result in equivalent content on multiple
URIs and some people don't like this for various reasons (caching, other?),
but I think that concern conflicts with URI opacity, i.e. the URI
authority's right to be able to design their own URL structure.  And like
how URI Templates is addressing the issues some people like me have with the
limits URI Opacity previously placed on system design, I think other
initiatives could be presented to address the issues of equivalent content
on multiple URIs. 

Received on Wednesday, 1 August 2007 19:55:42 UTC