[Specifications] hydra:search with HTTP POST

elf-pavlik has just created a new issue for https://github.com/HydraCG/Specifications:

== hydra:search with HTTP POST ==
In various examples of `hydra:search` I always see it using 'a default operation` of the tempate- HTTP GET. Also currently its definition includes
```ttl
hydra:search a hydra:TemplatedLink ;
             rdfs:range hydra:IriTemplate .
```

I can think of a cases where service would choose to use HTTP POST to perform search for example with https://www.w3.org/TR/sparql11-protocol/#query-via-post-direct using `application/sparql-query` content type.

In that case it seems that we would have `hydra:Resource` accepting the POST, not `hydra:IriTemplate` and also `hydra:search` seems an instance of `hydra:Link` not `hydra:TemplatedLink`.

For collection that provides more then one search mechanism, we might get something like:
```json
{
  "@context": { ... },
  "@type": "hydra:Collection",
  "search": [{
    "@type": "IriTemplate",
    "template": "http://api.example.com/issues{?q}",
    "variableRepresentation": "BasicRepresentation",
    "mapping": [{
      "@type": "IriTemplateMapping",
      "variable": "q",
      "property": "hydra:freetextQuery",
      "required": true
    }]
  }, {
    "@id": "http://api.example.com/issues",
    "operation": [{
      "@type": ["Operation", "schema:SearchAction"],
      "method": "POST",
      "???:contentType": "application/sparql-query"
    }, {
      "@type": ["Operation", "schema:CreateAction"],
      "method": "POST",
      "expects": "foo:Issue",
      "???:contentType": "application/ld+json"
    }]
  }]
}
```

In this case, besides the `hydra:search`, `hydra:(Templated)Link` we also seem to need `schema:SearchAction` to select intended operation on the resource. We can't any more rely on 'a default operation' (HTTP GET) as we did with the `hydra:IriTemplate`.

@RubenVerborgh do you have any experience with using `hydra:search` via HTTP POST (possibly also `application/sparql-query`)?

Please view or discuss this issue at https://github.com/HydraCG/Specifications/issues/149 using your GitHub account

Received on Sunday, 5 November 2017 15:46:55 UTC