Re: Questions about new collection design

Hi Dietrich

February 6 2015 8:36 PM, "Dietrich Schulten" <ds@escalon.de> wrote: 
> 
> Is it not possible to say
> 
> {
> "@id" : "/alice"
> "foaf:knows" : { "@id": "/alice/friends" }
> }
> 
> if the target resource returned from /alice/friends is a json-ld set of
> foaf:Person, as shown below?
> 
> [
> {"@id":"/bob",
> "@type": "http://xmlns.com/foaf/0.1/Person",
> "http://xmlns.com/foaf/0.1/name": "Robert Rumbaugh"
> },
> {"@id":"/zelda",
> "@type": "http://xmlns.com/foaf/0.1/Person",
> "http://xmlns.com/foaf/0.1/name": "Zelda Zackney"
> }
> ]
> 
> So far I thought the problem were that we return a hydra:Collection as
> value of foaf:knows, effectively making a :Collection a foaf:Person by
> inference.
> 
> But here we return individuals who are really foaf:Person.
> 
> Not legitimate?
> 

I agree with the idea. Definitely feels more like non-LD JSON. However the problem is that you can't define paging controls this way to the entire response, because there is no root object. One solution could be HTTP headers, but that's a big change.

As per defense of the current design, it is in fact very much similar to other non-LD approaches including HAL, SIREN and Collection+JSON. They all specify some artificial collection construct. Hence Hydra will likely not feel that much alien to people who strive implement good hypermedia APIs using the available options. However Hydra is still a step ahead, because the underlying RDF and JSON-LD model empowers us to declare more rich semantics. An example could be the @reverse keyword as discussed in the other thread.

Regards,
Tom

Received on Tuesday, 10 February 2015 16:14:57 UTC