W3C home > Mailing lists > Public > public-rdf-wg@w3.org > January 2013

RE: JSON-LD grammar

From: Markus Lanthaler <markus.lanthaler@gmx.net>
Date: Wed, 9 Jan 2013 11:39:40 +0100
To: "'Pierre-Antoine Champin'" <pierre-antoine.champin@liris.cnrs.fr>
Cc: "'Gregg Kellogg'" <gregg@greggkellogg.net>, <public-linked-json@w3.org>, "'RDF WG'" <public-rdf-wg@w3.org>
Message-ID: <00fe01cdee55$a21c31c0$e6549540$@lanthaler@gmx.net>
On Wednesday, January 09, 2013 8:33 AM, Pierre-Antoine Champin wrote:

> > > AFAIK, W3C standard is EBNF, and I did make an attempt at an EBNF
> > > grammar some time ago, but the consensus of the group was that this
> > > wasn't too useful. The fact that it's JSON, and pretty much every
> > > implementation will use a JSON parser and iterate of the resulting
> > > objects, I still think this is probably not too useful for the 
> > > purposes of implementing a processor.
> >
> > Right. That's the reason why I didn't use EBNF. I wouldn't like to 
> > include rules to parse JSON itself, just the grammar on top of JSON 
> > but unfortunately there doesn't exist such a thing yet.
>
> Wouldn't it be relevant to use JSON-Schema [1], then? I've used it in
> the past and found it quite nice useful... However, it is not a finalized
> spec and has not evolved in the last two years, so that may be
> inappropriate for a W3 REC.

I considered JSON-Schema but as you say it's not standardized yet and thus
probably inappropriate. Furthermore, and that's the real deal-breaker, it
doesn't allow to express things such as, a JSON object which has *either* a
@language *or* a @type member (both are allowed but not at the same time).

Perhaps it would make sense to define the EBNF rules for JSON somewhere so
that other specs can build on top of that by simply referencing them!?


Regards,
Markus



--
Markus Lanthaler
@markuslanthaler
Received on Wednesday, 9 January 2013 10:40:12 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:25:53 GMT