Re: JSON Hyper-Schema

Hi Miguel,

the concern of Json Schema and Hyperschema is to constrain data types of json attributes, and to describe expected json objects for http method request bodies which can be used on certain resources. E.g. "In order to post to that resource, always use this object type with such and such attributes".

The concern of json-ld is to assign linked data names to json attributes, effectively underlaying an RDF model to a json object. Plus, optionally, to apply type information which allows a jsonld processor to interpret json types as RDF literals.

I do not see that json-schema integrates RDF and I think it would be difficult to integrate linked data names right into json schema - it has no notion of that. But both can be applied independently to a given json.
The @context could say "firstname is schema.org/givenName" and the json schema could say it must appear etc.

One limitation of hyperschema is that supported operations and request types are statically defined. That means, the server cannot take away a transition because the application state would require it. Not a good match for HATEOAS. Hydra is more flexible in that regard.

The descriptive power for expected request objects in hydra is limited. For that we need help from an external vocab.

Compared to json-schema, the SHACL draft from the RDF shapes WG aims at describing constraints specifically for RDF. I tend to see that as a better match than json-schema in the mid-term. If you are into schema.org, http://schema.org/PropertyValueSpecification is officially out there and may be used.

Which language or platform is your existing service running on?

Best regards,
Dietrich

Am 22.03.2015 03:52 schrieb Miguel <miguel.ceriani@gmail.com>:
>
> Hi, 
> I stumbled upon JSON Hyper-Schema [1], a module defined on top of JSON 
> Schema [2]. 
> It seems to me a sort of JSON-LD (with a more powerful templating 
> mechanism) + Hydra Core Vocabulary (without description of available 
> operations). 
> Possibly it could be used to build an LD (maybe even Hydra) front-end 
> to existing JSON-based Web APIs (at least simple ones). The REST 
> support is quite limited (just GET and POST) but that could be 
> extended somehow. 
> What do you think of it? 
>
> Have you considered some form of integration or reference to that spec? 
> Do you know if there is work going on on that? 
>
> Thanks, 
> Miguel 
>
> [1] http://json-schema.org/latest/json-schema-hypermedia.html 
> [2] http://json-schema.org/latest/json-schema-core.html 
>

Received on Tuesday, 24 March 2015 16:48:59 UTC