Re: Updated URI Template proposal

Looks good.  I will update my experimental java implementation of this
by the end of the week.  Comments below.

Joe Gregorio wrote:
> [snip]
> There are two issues that are outstanding:
> 
> 1. Seven operations is a bit much. Prefix and append are both
>     convenience operators that can be done using 'opt'. Is it worth
>     dropping them to reduce the count to five?

I don't think it's a problem.  The operations defined are useful and clear.

The spec will likely need to indicate how new op codes are defined.  How
should unknown codes be handled?  Are applications free to create their
own op codes?  Is an iana registry needed? etc.

> 2. The 'sub' operator could either be defined to operate on
>     the octets of the variables value, or on the unicode character points
>     of the equivalent utf-8 decoded string. Both have their pros and cons.
> 

I would think that unicode codepoints would be what folks would
typically expect.  If we need to support both, different op codes can be
used...

  octets     = {-sub|0-1|username}
  codepoints = {-subc|0-1|username}

Next, regarding the varname definition,

  token varname    '[a-zA-Z0-9][a-zA-Z0-9\_\.\-]*' ;

I'm curious as to why these additional characters should not be allowed
in a varname?

  !@#$%^&()\/:;'[]"

For instance, allowing : and / would allow us to do...

  {-prefix|foo/|http://example.org/text/username}

Also, there had been mention of an escape/quote character for varnames,
for instance:

  {-join|&|"a,b",c}

There are two varnames "a,b" and c.  This would allow things like:

  {-join|&|"tag:example.org,2007:foo","tag:example.org,2007:bar"}

Which is, of course, quite a bit more difficult to parse but provides
for interesting directions in extensibility and reuse/disambiguation of
varnames.

Lastly, you had previously mentioned that the cardinality of vars with
the join op was an issue.  Could we not use +, * and ? for that?

Examples:

  ? = 0 or 1 times (default)
  + = 1 or more times
  * = 0 or more times

  {-join|&|num} = num can be used 0 or 1 times
  {-join|&|num?} = num can be used 0 or 1 times
  {-join|&|num*} = num can be used 0 or more times
  {-join|&|num+} = num can be used 1 or more times

- James

>    Thanks,
>    -joe
> 

Received on Monday, 5 November 2007 18:36:47 UTC