[Specifications] managing @id and/or @base for newly created resources / named graphs

elf-pavlik has just created a new issue for https://github.com/HydraCG/Specifications:

== managing @id and/or @base for newly created resources / named graphs ==
Versions of [UC5](https://github.com/elf-pavlik/Specifications/blob/9e3402cc074e35309aabdc346fdb6775403d91c6/drafts/use-cases/5.creating-new-event.md) and [UC5.1](https://github.com/elf-pavlik/Specifications/blob/9e3402cc074e35309aabdc346fdb6775403d91c6/drafts/use-cases/5.1.creating-event-with-put.md) in #154 both create a new resource, using HTTP POST and HTTP PUT accordingly.

Current version of [UC3](https://github.com/HydraCG/Specifications/blob/c654efb76e8005d4e0978e46b770ec8dc78f5cbe/drafts/use-cases/3.obtaining-events.md) shows how to retrieve a collection with events representations embedded. In this use case, all the events have `@id` but based UC5 and UC5.1 one can't really tell how do those `@id` appear in the representation.

In UC5.1 client controls the IRI of newly created resource (using HTTP PUT) and could easily include `@id` in the payload. In UC5, the server controls the IRI of newly created resource (it can respect HTTP `Slug:` header but client can't assume it will), so client can't include `@id` in the payload. Payload in UC5, which client POST to the server currently uses a *Blank Node* with no `@id`.

In a case where payload includes only single blank node, possibly server could replace it with a *Named Node* based on IRI it assigns to the resource. IMO we should also anticipate payloads which will use `@graph` with multiple named nodes and blank nodes. In that case server could set [`@base`](https://json-ld.org/spec/latest/json-ld/#base-iri) or name the graph itself (given payload includes only one default graph).

While we don't have to address various possible scenarios right away. I think we should at least make all the use cases presenting consistent and reproducible scenario. Which means UC5 and UC5.1 should clearly explain how does each event get its `@id`.

Please view or discuss this issue at https://github.com/HydraCG/Specifications/issues/162 using your GitHub account

Received on Sunday, 15 April 2018 16:58:21 UTC