Re: [Specifications] CreateAction with HTTP PUT

> To address the issue of how the client "knows" that the said PUT operation actually adds members to the parent collection, there are two hints: "schema:CreateAction" and the hypothetical link relation hydra:addMember.

I would really like to find a way that client will discover specific action in the same way, and description of the action will instruct it what operation (and on which resource) it has to perform to accomplish given action. IMO client shouldn't have to understand anything like `hydra:addMember` in addition to `schema:CreateAction` just because PUT on another resource *handles* this action instead of POST on the same resource (the collection).

In approach where I suggested, we could define
```ttl
hydra:operation rdfs:subPropertyOf hydra:action
```
Which makes  `hydra:operation` a more specific action, where the subject in the statement using it acts also as a `target` of that operation.

In JSON-LD the `@context` could in addition include alias
```json
"target": { "@reverse": "hydra:operation" }
```
We could also consider optional

This way, client will just need to:
1. look at all the instances of  `hydra:Operation` which resource references via `hydra:action` (which automatically includes all the resources referenced by more specific `hydra:operation`).
2. select desired action based on `@type`, `hydra:expects` and other possible criteria
3. perform operation (handle action) based on `hydra:method` and `target` identified by:
  * reverse direction of `hydra:operation` if resource used more specific `hydra:operation`
  * `target` (reverse use of `hydra:resource`) providing IRI for operation if resource used broader `hydra:action`
  * `hydra-pr:targetTemplate` providing `hydra:IriTemplate` based on which client can construct IRI which will serve as `target` of the operation.

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

Received on Monday, 16 October 2017 20:42:30 UTC