- From: Markus Lanthaler <markus.lanthaler@gmx.net>
- Date: Mon, 3 Feb 2014 20:28:52 +0100
- To: <public-hydra@w3.org>
On Saturday, February 01, 2014 4:17 PM, Ryan J. McDonough wrote:
> You kind of bring up a point I raised in another thread on this list
> which is do we even need IriTemplate when Operation could work for GETs
> as well? If you squint a little bit, this Hyrda definition:
>
> {
> "@context": "http://www.w3.org/ns/hydra/context.jsonld",
> "@type": "IriTemplate",
> "template": "http://api.example.com/issues{?query}",
> "mappings": [
> {
> "@type": "IriTemplateMapping",
> "variable": "query",
> "property": "#SearchCriteria",
> "required": true
> }
> ]
> }
>
> Now starts to look a lot like an hydra:Operation with was hydra:method
> value of GET. Thus, we could express it as:
>
> {
> "@context": "http://www.w3.org/ns/hydra/context.jsonld",
> "@id": "/issues",
> "operations": [
> {
> "@type": "ReadResourceOperation",
> "method": "GET",
> "expects" : "#SearchCriteria"
> }
> ]
> }
>
> As I stated in the other thread, I'm glossing over the fact that Hydra
> doesn't (yet?) define a mechanism to take something like
> #SearchCriteria and send it as query string on a URL. But assuming we
> went that route, it'd provide consistency with other Hyrda Operation
> instances. It becomes a but more analogous to HTML forms whereby the
> same mechanism can be used for GET and POST. In Hyrda's case, it'd also
> support the other HTTP Methods as well.
That's certainly something we should look into. The main concern I have is
that URL construction will either become too complex or not flexible enough.
It's kind of trivial to say that a property should be mapped to a URL query
parameter but sometimes you need it to be part of the path. Similarly, if
you have more than 1 value you need to define a way to flatten all the
values into the URL.
I'm definitely interested in this as it indeed seems to simplify things but
I can't see how we can keep it simple while yet making it flexible enough.
Concrete examples/proposals would help to see if that's possible.
--
Markus Lanthaler
@markuslanthaler
Received on Monday, 3 February 2014 19:29:27 UTC