Re: Target URL of Operations

Hi Thomas,

I see this as a deliberate constraint which comes from the fact that you need to say what it is you are operating on. Either it is the current resource, or a related resource. For the current resource, its @id  seems the obvious choice. If it is a related resource, you need a property which expresses the relationship, and in that case the related item again has an @id, which is of course different from the @id of the current resource. I couldn't find an example where a PUT or DELETE would not work under this constraint.

For collections you want to POST to, the situation is different. Here we have the new collection design, where the @id identifies the collection and the hydra:collection property expresses an all-purpose relationship with the current resource. That allows to use pretty much everything as a POST target, and the property in the manages block can be an arc between the collection items and a thing which is not the current resource; maybe even a thing which doesn't exist yet. I have found that this gives me the freedom I needed so far.

Do you have an example which cannot be expressed within the constraints of the current design?

Best regards,
Dietrich


Am 13.04.2015 11:57 schrieb Thomas Hoppe <thomas.hoppe@n-fuse.de>:
>
> Hi, 
>
> Thinking about how to model operations in an API, I encountered the 
> following question: 
> What is the target URL (I'm specifically not using the term IRI here) 
> for a hydra:operation? 
> Looking at Example 6 in the spec it is obviously the URL which can be 
> constructed 
> from the complete resource IRI (context base URL + "/an-issue") 
> according to what is describe in the JSON-LD spec [1]. 
> I have two issues with that: 
>
> 1.) Is this only an implicit assumption that it has to work like this or 
> is this specified somewhere? 
> 1.1) Is this also true if operations are nested like in the Restbucks 
> examples [2]? 
>
> 2.) What if we wanted to tell the client that the target for the request 
> to form is a different one? 
> For the second point, there is https://schema.org/target but maybe hydra 
> should have this 
> essential property on its own. 
>
> Greets, Thomas 
>
> [1] http://www.w3.org/TR/json-ld/#base-iri 
> [2] 
> https://www.w3.org/community/hydra/wiki/Restbucks_with_Hydra#Telling_the_Client_Where_to_Order 
>

Received on Monday, 13 April 2015 19:39:46 UTC