Re: query language

hello ruben.

On 2014-09-10, 9:21 , Ruben Verborgh wrote:
> Here is an equivalent Hydra example:
> {
>    "@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",
>      }
>    ]
> }
> This is very similar to what Link Descriptions do, right?

it's a part of what they do, but less. and please keep in mind that the 
draft that's published is very rough and incomplete, so some of what i 
am saying is just what we wanted to do with the descriptions, but has 
not necessarily found its way into the draft.

what link descriptions also are supposed to do is to describe data types 
and value ranges. for example, when you have a page variable, then you 
want to represent the fact that it's integer, and the allowed value 
range. from what i can see, hydra does not support this kind of 
information, which, like you say, is going in the direction of forms 
(not the UI part, but the logical part).

i guess what hydra *could* do would be (and i am using XSD here because 
it conveniently exists as a simple datatype standard on the web, but 
sadly defines no URIs to identify its core concepts):

{
   "@context": "http://www.w3.org/ns/hydra/context.jsonld",
   "@type": "IriTemplate",
   "template": "http://api.example.com/issues{?page}",
   "mapping": [
     {
       "@type": "IriTemplateMapping",
       "variable": "page",
       "datatype": "http://www.w3.org/TR/xmlschema-2/#integer",
       "xs:minInclusive": "1",
       "xs:maxInclusive": "42",
       "property": "http://example.com/feedpaging/page",
     }
   ]
}

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 17:26:22 UTC