W3C home > Mailing lists > Public > public-hydra@w3.org > June 2014

RE: Should every hydra:Operation via HTTP GET have nothing to expect?

From: Markus Lanthaler <markus.lanthaler@gmx.net>
Date: Sun, 22 Jun 2014 21:48:52 +0200
To: <public-hydra@w3.org>
Message-ID: <06b901cf8e53$00230ac0$00692040$@gmx.net>
Hi Jindřich,

I haven't replied to a couple of your e-mails yet...

On 17 Jun 2014 at 11:15, Jindřich Mynarz wrote:
> should every hydra:Operation via HTTP GET have nothing to expect? For example:
> :get-operation a hydra:Operation ;
>   hydra:method "GET" ;
>   hydra:expects owl:Nothing . # or omit hydra:expects completely

Yeah. Generally, however, I wouldn't model GETs using Operations as they do not change state (at least they are not supposed to do so). There's an open issue, ISSUE-44 [1], to improve the spec in that regard.

> This is the case of the Issue tracker demo
> (http://www.markus-lanthaler.com/hydra/api-demo/vocab#), where every
> GET hydra:Operation has hydra:expects set to null (which I believe to
> be a JSON-LD way equivalent of omitting a triple).


> If that's not the case and GET hydra:Operation can expects something,
> then the question is how it should be serialized in an HTTP request.

>From an HTTP perspective, nothing prevents you to include a payload in a GET. You'll however experience a lot of problems if you do so in practice as you know.

> Is it always the case that a resource that a hydra:Operation expects
> should be provided in the request body? Now, while GET requests can

Let's say in most cases. "Always" and "never" are almost always too strong and thus almost never right :-)

> contain a body, I know it's not a recommended practice to do so. I'm
> wondering if there are alternative ways how to serialize a resource
> that a hydra:Operation expects, such as in GET parameters, but this
> seems clunky.

You could leverage IRI templates to do so. But as always (here it is again) it would be easier to discuss this based on a concrete example.

[1] https://github.com/HydraCG/Specifications/issues/44

Markus Lanthaler
Received on Sunday, 22 June 2014 19:49:24 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 15:53:59 UTC