Re: [Specifications] CreateAction with HTTP PUT

@tpluscode in your snippets the instance of `hydra:Resource` or `hydra:IriTemplate` on `object` position in a statement with `hydra:addMember`, advertised only single operation. In case when that resource or template advertises (references via `hydra:operation`) more than one instances of `hydra:Operation`, how the client knows which of those operations to choose?

It seems like clients needs to follow those two steps
1) starting from a collection follow `hydra:addMember` to discover a resource or template handling adding members to that collection
2) on that discovered resource or template follow all the `hydra:operation` and select the one with with `[] rdf:type hydra:Operation, schema:CreateAction .`

This seems pretty similar to what I have in mind
1) starting from a collection follow `schema:potentialAction` and select the one with `[] rdf:type schema:AddAction .`
2) from selected operation follow `schema:target` (or `hydra:operation but in reverse direction) to discover resource or template handling that action
3) on that discovered resource or template follow all the `hydra:operation` and select the one with with `[] rdf:type hydra:Operation, schema:CreateAction .`

so the last steps look exactly the same, it only differs on how client discovers the resource or template which handles intended action, and if we specify intended action using `schema:Action` (`rdfs:Class`) or `hydra:Link` (`rdf:Property`). I think we could try to see how those two approaches would work with #134

What I like about those both approaches, they don't rely on particular choice of HTTP method in the operation, which I understood @alien-mcl explores in https://github.com/HydraCG/Heracles.ts/pull/18
IMO we should only rely statements using terms from Hydra vocab and something like schema.org actions and don't try to infer things from some particular choice of HTTP methods.

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

Received on Saturday, 21 October 2017 18:12:44 UTC