Re: [Specifications] IriTemplate should have a way to describe variable as UUID etc.

I need a way to instruct client to generate a collision save unique identifier, for example [UUID](https://tools.ietf.org/html/rfc4122) or [CUID](https://github.com/ericelliott/cuid), and substitute with it a particular variable in the URI Template.

In case of slug HTTP header AFAIK server does NOT guarantee that it will use that slug in generated IRI. With [UC#5.1 creating event with PUT](https://github.com/HydraCG/Specifications/blob/master/drafts/use-cases/5.1.creating-event-with-put.md), which relies on `schema:name`. Client most likely has to implement mechanism to recover from failed conditional put - when collision happens. So in practice client may find itself in a position that it simply can not use the value of `schema:name` in the payload because of collision. I find unique identifiers like UUID or CUID convenient because they stay collision safe and allow applications working offline to mint IRIs and interlinking that data before syncing it up with the service. During the sync, payloads of PUT requests will already have `@id` (which includes that unique identifier component) and will not include that component as value of any property in the payload.

> What’s the use case for this? Why does it need to be part of Hydra and not the domain vocabulary (e.g. schema.org)?

How would you answer those questions for [`hydra:freetextQuery`](http://www.hydra-cg.com/spec/latest/core/#hydra:freetextQuery) ?
> hydra:freetextQuery
A property representing a freetext query.
Range: undefined
Status: testing

For this case, we could actually use [`schema:query`](http://schema.org/query)

For GUID / UUID / CUID I could actually propose to schema.org adding them as sub-properties of [`schema:identifier`](http://schema.org/identifier)

-- 
GitHub Notification of comment by elf-pavlik
Please view or discuss this issue at https://github.com/HydraCG/Specifications/issues/145#issuecomment-342035721 using your GitHub account

Received on Monday, 6 November 2017 03:13:01 UTC