RE: Finalizing the IriTemplate design - serialization (ISSUE-30 & ISSUE-17)

On Wednesday, October 08, 2014 9:53 AM, Dietrich Schulten wrote:
> As long as it is still valid to expect and pass an urlencoded scalar
> for a placeholder, I have no objections. Scalars are what is used in
> the rfc examples, so that should be a perfectly normal case. IOW, an
> expansion http://example.com/events?scheduled=true&age=50&price=180.0&
> place=concert+hall should still be OK.

Yes, that will be the "default". This is for applications that need to be able to accurately distinguish between the URL http://example.com/ and the string "http://example.com/" which isn't possible otherwise. Linked Data Fragments is such an application e.g.


> Also, it should be clear that we are not squeezing something into an
> Uri which should rather be a POST or PUT request body. A sign for that
> could be that we post an empty body to an elaborated Uri which looks
> very much like a request body :)

We can't enforce that. It's a decision the API provider has to make.


> The fact that the rfc specifically shows an example where {lang} is a
> template parameter makes me wary that we are overspecifying a bit by
> introducing a syntax for parameter values which intrinsically tells
> the language of a value. If the server needs a language to identify a
> resource, the idea of Uritemplate seems to be that the server would be
> explicit about it.

For some applications it is important to be able to express this explicitly for each variable. Have a look at how Linked Data Fragments work for instance. That being said, I agree that for most applications this won't be necessary and thus the "default" would be the mechanism you describe.

 
> Another question, this time about the type syntax: are we still
> identifying a resource if we encode the xsd type of a value into the
> value? Because that is what UriTemplate does, it describes a range of
> resource identifiers, not a general means to send data. Is the xsd
> type really needed to identify the target resource in a Uri
> http://example.com/offers?price= %225.5%22%5E%5Exsd%3Axsd%3Adecimal.

In your example it is difficult to see but assume that instead of using xsd:decimal you would use more specialized datatypes to distinguish between currencies (Euro, US Dollar, etc.).


--
Markus Lanthaler
@markuslanthaler

Received on Wednesday, 8 October 2014 09:33:51 UTC