Re: query language

hello lászló

On 2014-09-10, 11:26 , László Lajos Jánszky wrote:
>> my suggestion would be to embrace diversity and make sure that there is a way how specific capabilities and interaction modalities can be represented and communicated, so that clients understand that a certain resource does support a certain query language.
>> loose coupling does allow you to do that, and media types would be a good way to accomplish this.
> I can agree with that, but there is still the question, how would we
> give media type to a queryString? Should we do that in the link
> descriptors? GET request cannot have body (and I don't think this will
> and should change). (Sorry, but I don't had time to read your draft
> yet, maybe it contains all the answers for these questions.)

media types cover representations, and not URI structure. if you think 
you need a different/better way how to construct URIs, then you 
basically need to do what URI template did, only for your requirements. 
from the hydra point of view, this here:

{
   "@context": "http://www.w3.org/ns/hydra/context.jsonld",
   "@type": "IriTemplate",
   "template": "http://api.example.com/issues{?page}",
   "mapping": [
     {
       "@type": "IriTemplateMapping",
       "variable": "page",
       "property": "http://example.com/feedpaging/page",
     }
   ]
}

then would become:

{
   "@context": "http://www.w3.org/ns/hydra/context.jsonld",
   "@type": "LaszloTemplate",
   "template": "http://api.example.com/issues{?query}",
   "mapping": [
     {
       "@type": "LaszloTemplateMapping",
       "variable": "query"
     }
   ]
}

this is assuming you also would have variables in your language.

On 2014-09-10, 11:35 , László Lajos Jánszky wrote:
> I think possible workaround could be to add a single "q" parameter to
> the URI template, and describe that parameter with a query specific
> vocab, which we could use to describe restrictions about the appliable
> operators and sub-parameters in q. This might work with the current
> hydra mapping...

yup, that's the hacky tunneling way of doing it. you'd end up with this:

{
   "@context": "http://www.w3.org/ns/hydra/context.jsonld",
   "@type": "IriTemplate",
   "template": "http://api.example.com/issues{?q}",
   "mapping": [
     {
       "@type": "IriTemplateMapping",
       "variable": "q",
       "property": "http://laszlo.com/myquerylanguage",
     }
   ]
}

and then clients would need to understand your query language or just 
understand that there is some "q" that takes some value that has a type 
that they don't understand.

cheers,

dret.

-- 
erik wilde | mailto:dret@berkeley.edu  -  tel:+1-510-2061079 |
            | UC Berkeley  -  School of Information (ISchool) |
            | http://dret.net/netdret http://twitter.com/dret |

Received on Wednesday, 10 September 2014 18:44:18 UTC