Re: Updated URI Template proposal

On Nov 8, 2007 2:06 PM, James M Snell <jasnell@gmail.com> wrote:
>
>
> Joe Gregorio wrote:
> > On 11/5/07, James M Snell <jasnell@gmail.com> wrote:
> >> Lastly, you had previously mentioned that the cardinality of vars with
> >> the join op was an issue.  Could we not use +, * and ? for that?
> >
> > I think cardinality can be solved at a more
> > granular level by choosing between
> > listjoin and join.
> >
> >     {-listjoin|&num=|numbers}
> >     {-join|&|num}
> >
>
> Ok, so what I want to achieve is a url structure like:
>
> ?tag=tag1&tag=tag2&tag=tag3&start=0&count=10
>
> Using listjoin and join, that would come out to:
>
> {-opt|?|tags,start,count}{-listjoin|&tag=|tags}{-opt|&|start,count}{-join|&|start,count}
>
> Alternatively, if we went with *, it would come out to:
>
> {-opt|?|tags,start,count}{-join|&|start,count,tag*}

The use of '-opt' seems awkward just to inject the '?' character.
Could a lot of cases be combined if 'join' also took a
prefix string? Then your example comes down to a single expansion:

   {-join|?|&|start,count,tag*}

This would also help with listjoin:

    {-listjoin|/-/|/|categories}

If we did this then we could probably drop -prefix and -append since
they can be done with -opt, and the most likely uses of -prefix and
-append would be subsumed by -join and -list.

One of the things we don't have at this point is an agreed upon
corpus of URIs that we would want to be able to cover
with URI Templates.

   -joe

-- 
Joe Gregorio        http://bitworking.org

Received on Friday, 9 November 2007 06:14:45 UTC