RE: URI Templates - optional variables?

For array types like this:
     E.g. friend = [ "name1", "name2", "name3" ]

would you have:
     {,&:name} = "friend=name1&friend=name2&friend=name3"

OR
     {,&:name} = "friend=name1,name2,name3"
?

Also, is there any scenario where I might want the "=" to be a different character?

-----Original Message-----
From: uri-request@w3.org [mailto:uri-request@w3.org] On Behalf Of Roy T. Fielding
Sent: Wednesday, August 01, 2007 5:32 PM
To: uri@w3.org
Cc: Joe Gregorio
Subject: Re: URI Templates - optional variables?


On Aug 1, 2007, at 3:02 PM, Roy T. Fielding wrote:
>    {%separator:hashvar}
>         For each variable named in the value of hashvar (which could
>         be a space-separated string or some context-dependent hash
>         mechanism), if the named variable is defined and non-empty,
>         then substitute the concatenation of variable name, "=",
>         variable value.  If more than one substitution is made,
>         separate each substitution with the string of non-colon
>         separator characters between the '%' and ':'.
>            E.g.,   myhash = "name age sex location"
>                      name = "Fred"
>                       age = "41"
>                       sex = ""
>                  location = "USA"
>
>            then  {%&:myhash} = "name=Fred&age=41&location=USA"

Actually, that one isn't very useful for resource description.
An explicit list would be better:

    {,separator:var1,var2,var3,...}
         For each variable named in the comma-separated list,
         if the named variable is defined and non-empty, then
         substitute the concatenation of variable name, "=",
         variable value.  If more than one substitution is made,
         separate each substitution with the string of non-colon
         separator characters between the ',' and ':'.
            E.g., name     = "Fred"
                  age      = "41"
                  sex      = ""
                  location = "USA"
         {,&:name,age,sex,location} = "name=Fred&age=41&location=USA"

I hope it is clear what the use cases for that would be.

.....Roy

Received on Thursday, 2 August 2007 11:04:25 UTC