RE: Hydra + JSON-LD design question

Hi Jay,

On Wednesday, December 14, 2016 8:59 AM, Jay Zawar wrote:
> I m looking for a way to specify an operation on a particular resource
> instance: the operation's URL and HTTP method should be specifiable.
> Example (please check the last 3 lines):
> 
> {
>
"@context":"https://contexts.dictionary.mycompany-group.com/person.jsonld",
>
"@id":"https://myapi.mycompany.com/persons/BE14A7269802498F992813885546D058"
,
>   "@type":"https://schema.org/Person",
>   "name": "Mustermann",
>   "operation": [
>       {"@type": "DeleteResourceOperation","method": "DELETE"},
>       {"@type": "ReplaceResourceOperation","method": "PUT"}
>       ],
> 
> 	// now how would one specify this with JSON-LD augmented by HYDRA?

You need to reference the other " some_special_operation " from the node
above or create a new top-level node with that operation

> 
>   {
>     "@type": "some_special_operation",
>     "method": "POST",
>
URL:"https://myapi.mycompany.com/persons/BE14A7269802498F992813885546D058/so
me_special_operation"
>   }
> }


So either

  BE14A7269802498F992813885546D058
    - operation: delete + put
  
  5546D058/some_special_operation
    - operation: post

or

  BE14A7269802498F992813885546D058
    - operation: delete + put
    - relationshipProperty:
      ... 5546D058/some_special_operation
         - operation: post

where you would pick some property for "relationshipProperty" that describes
the relationship between the two resources.


HTH,
Markus

--
Markus Lanthaler
@markuslanthaler

Received on Tuesday, 20 December 2016 22:38:31 UTC