W3C home > Mailing lists > Public > uri@w3.org > November 2007

Re: Updated URI Template proposal

From: Joe Gregorio <joe@bitworking.org>
Date: Thu, 8 Nov 2007 13:28:24 -0500
Message-ID: <3f1451f50711081028v93bb6a0l5a3ece4b497deae4@mail.gmail.com>
To: "James M Snell" <jasnell@gmail.com>
Cc: URI <uri@w3.org>

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.


What I do think can be done is indicate if a variable is optional or required.
Maybe append the variable name with '+' if the variable is required?

    {num+}                     // num is required
    {-join|&|num,start-index,q+}   // q is required, num and
start-index are optional

Note that setting a default value for a required element is
redundant, since if you don't supply a value the default will be
used. So this could probably be allowed, since it doesn't hurt
anything, but it doesn't add much:


Allowing it keeps the parsing simple, as you don't have to add
a rule to forbid it. And this now allows you to neatly cover all the
cardinality cases you mentioned using a combination of
join, listjoin, and requiredness:

    {num}               // 0 or 1
    {num+}             // 1
    {-join|&|num}     // 0 or more
    {-join|&|num+}   // 1 or more


Joe Gregorio        http://bitworking.org
Received on Thursday, 8 November 2007 18:28:43 UTC

This archive was generated by hypermail 2.4.0 : Sunday, 10 October 2021 22:17:50 UTC