- From: James Langley <jdhlangley@gmail.com>
- Date: Fri, 24 Jan 2014 23:52:06 +0000
- To: Markus Lanthaler <markus.lanthaler@gmx.net>
- Cc: public-hydra@w3.org
- Message-ID: <CAFa8FOFW4N5W3J4atCKjz3hrpD_qC+Py=WEFXbb=ew8uDs4KYg@mail.gmail.com>
> So you want to manipulate the JSON representation directly instead of mapping it to domain POJOs, right? Exactly. We have the concept of the client being able to call the API, and the API having to invoke multiple calls to other areas of the API to satisfy the client's request. Each of these internal calls will return JSON and so we would rather merge the JSON directly, not convert into POJOs, merge POJOs, then convert back from POJO -> JSON. > The general approach would be to either define a property or a class that you include/exclude based on the resource state. Something like { "@id": "just-an-entity", "@type": [ "BlogPost", "PublishedBlogPost" ], "comments": "just-an-entity/comments" } > In this case, the operations that are supported on all posts are associated to the "BlogPost" class. The operations only applicable to published posts are associated to the "PublishedBlogPost" class. Can we associate an entity with multiple classes if the classes are not hierarchical? (In this example PublishedBlogPost would seem to be a subclass of BlogPost.) > Do you need to document the circumstances under which each class is returned or is it enough to know that you may get different responses? Good question. I need to think a little more about this. > Btw. please don't conflate a JSON-LD context (which maps JSON elements to URLs) with a Hydra description (which describes your service). I think I need to go back and do some re-reading to make sure I've got that 100% straight in my own mind.
Received on Friday, 24 January 2014 23:52:34 UTC