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

Dear All,

Kudos to @Edwin for asking exactly the question I had.
Some time ago I tried to wrap my mind around this and came up with
the following idea and I would like to ask the community for critique:

Say I have a JSON schma backed address resource like this:

   {
     "id": "123",
     "street": "Street",
     "postcode": "000",
     "city": "Somecity",
     "country": "DE",
     "latitude": 0,
     "longitude": 0
   }

And that it's schema is https://meta.example.de/schemas/address

I would suggest to enrich it with the following
to make it a JSON-LD document with a reference to a JSON schema:

{
     "@context": {
       "@vocab": "https://meta.example.de/schemas/"     <-- Prefix IRI 
for rest of the node
     },
     "@id": "123",
     "@type": "address",                                           <-- 
Node-type
     "street": "Street",
     "postcode": "000",
     "city": "Somecity",
     "country": "DE",
     "latitude": 0,
     "longitude": 0
   }

I make use the schema's URI as an IRI of the node type.
This should be valid as to my best knowledge, JSON-LD does not mandate what
to be expect if node type is dereferenced (correct me if I'm wrong). 
What do you thin about this approach?

On important thing to note about JSON schema is that it defines 
validation rules only for properties
which are defined in the schema but this does not restrict the existence 
of further properties!
For example say the schema for the address above only describes the 
properties in the instance,
this does not mean that the additional properties for JSON-LD render the 
object invalid.

Please forgive me if I'm totally wrong but I'm new to JSON-LD.

Greets, Thomas

Received on Thursday, 26 September 2013 14:52:22 UTC