W3C home > Mailing lists > Public > public-linked-json@w3.org > May 2016

JSON-LD context boilerplate from JSON Schema

From: Colin Maudry <colin@maudry.com>
Date: Wed, 4 May 2016 15:00:00 +0200
To: public-linked-json@w3.org
Message-ID: <5729F250.8090905@maudry.com>
Hello,

I first [pinged][1] Markus and Manu on Twitter, but my question will 
make more sense with more than 140 characters.

I am a consultant for the French Open Data Task Force, Etalab, and we 
are doing pre-study to improve how public contracting data is published. 
Looking for existing models, the [Open Contracting Data Schema][2] 
caught our attention for its completeness.

Currently, this model is documented with a [JSON Schema][3] that 
describes what a complying JSON object looks like (datatype, valid 
values, global structure). The purpose of a JSON Schema is similar to 
the purpose of XML Schemas (XSD): specifying and validating the 
structure and content of a JSON object.

In order to anchor contracting data in the Web and promote Linked Data, 
I would like to test our data with JSON that would comply with this 
schema, and add a @context that would turn properties and objects into 
Web resources identified with URIs to have an RDF version of the data.

This JSON Schema contains a lot of information that would be added in 
this @context:

- labels
- comments
- data types
- properties-object relationships

This schema is quite big (988 lines), and writing manually a context 
that would include all this information would be time consuming.

Furthermore, as we are dealing with two standards, I would expect my use 
case not to be unique (is it?). I consequently think it would make sense 
to develop a tool that would, from a JSON Schema, produce the 
foundations of a JSON-LD context, so that all this redundant information 
is not retyped manually. Then, some things like @base, @valueUrl, etc. 
would be added (manually or not) for the context to do its job.

I started a repo [here][4], meaning I volunteer (favouring NodeJS), but 
first, I'd like to be sure I'm not doing something stupid :-)

In parallel, I'm also thinking of making an RDFS ontology out of this 
schema, to complete the "Linked Open Contracting Data" picture (see 
discussion [here][5]).

So... do you think this use case is isolated and that developing such 
tool would be a waste of time?

Thanks for your attention,
Colin Maudry
@CMaudry

   [1]: https://twitter.com/CMaudry/status/727505821291151360
   [2]: http://standard.open-contracting.org/latest/en/schema/
   [3]: http://standard.open-contracting.org/latest/en/schema/release/
   [4]: https://github.com/ColinMaudry/schema2ld
   [5]: https://github.com/open-contracting/standard/issues/190
Received on Wednesday, 4 May 2016 13:02:46 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 4 May 2016 13:02:47 UTC