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

Re: JSON-LD context boilerplate from JSON Schema

From: Peter Amstutz <peter.amstutz@curoverse.com>
Date: Wed, 4 May 2016 09:27:39 -0400
Message-ID: <CAEXjzRu+C2OyB6GR=rqxd+p7isCxhrozMgq9Pm0vCc6PbmZ_nQ@mail.gmail.com>
To: Colin Maudry <colin@maudry.com>
Cc: public-linked-json@w3.org
Hi Colin,

We've developed a tool that sounds like it would fit your use case:

https://github.com/common-workflow-language/schema_salad

It's based on Apache Avro schema rather than JSON-Schema, but the gist is
that you write a structured document schema and add additional markup to
instruct it on how to generate the JSON-LD context and RDFS directly.  It
also supports documentation generation, YAML, and additional markup
features that make it easier to write idiomatic JSON that, while not
straight JSON-LD, is easily transformed to JSON-LD.  It's been developed to
support a specific project (the common workflow language) but we'd very
much like to see it get more use by the linked data community.  Let me know
if you have any questions.

Thanks,
Peter

On Wed, May 4, 2016 at 9:00 AM, Colin Maudry <colin@maudry.com> wrote:

> 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:28:09 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:18:47 UTC