RE: JSON Schema (json-schema.org) support?

On Thursday, August 15, 2013 12:55 PM, Edwin Shao wrote:
> It strikes me that JSON-LD and JSON Schema are quite complementary.
> The first provides context, metadata, and a standard graph traversal
> mechanism. The second provides a way to describe and validate a
> given JSON object.

Exactly


> What is the canonical or recommended way in a JSON document with
> JSON-LD properties to refer to the location of a JSON Schema
> document that validates it?
>
> For example:
>
> {
>   @id: "http://example.com/eshao",
>   @context: "http://example.com/Person.jsonld",
>   @schema: "http://example.com/Person_schema.json",
>   name: "Edwin",
> }
> 
> If there is no canonical way currently (which seems to be the case), I
> would suggest including one in the upcoming spec, perhaps creating a
> new @schema keyword. 

Currently there is no canonical or recommended way. It depends on your use
case. Why would you like link to the schema from the document? What value
would you get out of that?

I personally would link to the schema using an HTTP Link header but I
haven't come across a use case requiring that so far. A consumer of data
will know what data it can accept and thus also which schema to use. I don't
see much value in validating incoming data with a schema provided by the
creator of the data but maybe I'm missing something!?


--
Markus Lanthaler
@markuslanthaler

Received on Thursday, 15 August 2013 17:15:51 UTC