OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

xdi message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Fwd: [Json] Small ABNF change to do some semantic separation

I agree with this argument. Our spec should refer to the coming JSON spec for the JSON definition in BNF, rather than forking our own copy of the JSON ABNF that could become obsolete.

Begin forwarded message:

From: Barry Leiba <barryleiba@computer.org>
Subject: [Json] Small ABNF change to do some semantic separation
Date: September 22, 2013 8:16:27 AM PDT

The repute working group has defined a response object in JSON.[1]  At
first they did it using ABNF.  That means that it (badly) duplicated
the ABNF that's already in 4627, trying to say where "ws" can go,
defining what has to have DQUOTE around it (for which the repute doc
used "%x22"), worrying about when to use value-separator and when to
use name-separator (and sometimes using "," instead, in some
versions), using "{" instead of citing begin-object, and so on.  It
was messy, error-prone, and subject to deviations from JSON ABNF if
that should change.

In the -13 version of the repute document, at my instigation, Murray
changed it to use a definition based on primitives from JSON -- not
ABNF primitives, but JSON primitives, objects and members and arrays,
names and values, strings and ints.  See
draft-ietf-repute-media-type-13, Section 6.2.

I intend, eventually, to write a document suggesting a consistent way
to do this, so others who come to the same place to the same thing in
the same(-ish) way.  The only hassle was that there are some semantic
gaps in the ABNF, which don't affect the grammar per se, but which do
affect how we can refer to the grammar for the semantic elements.  In
particular, "member" is defined as a "string" and a "value", not as a
member name and member value.  And "array" is defined as a set of
"value", losing the semantic distinction between a member value and an
array value.  There's no way to refer to the semantic element that is
the member name, for instance -- the fact that it's syntactically
represented by a "string" is fine, but there's a step missing.

I strongly suggest making a small editorial change to the JSON ABNF,
to separate these semantic entities from their type definitions:

member = string name-separator value
member = member-name name-separator member-value
member-name = string
member-value = value

array = begin-array [ value *( value-separator value ) ] end-array
array = begin-array [ array-value *( value-separator array-value ) ] end-array
array-value = value

This doesn't change how JSON is represented in the ABNF, but it allows
us to better use the ABNF to refer to the semantic elements.


[1] See https://datatracker.ietf.org/doc/draft-ietf-repute-media-type/
json mailing list

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]