Re: Draft JSON specification for CIF
- Subject: Re: Draft JSON specification for CIF
- From: Robert Hanson <hansonr@xxxxxxxxxx>
- Date: Wed, 12 Apr 2017 10:33:52 -0500
- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=stolaf.edu; s=stolaf;h=mime-version:in-reply-to:references:from:date:message-id:subject:to;bh=DFIwGdqEjhbcPFGSRTNEOfe48O22MYJXBAFVqWAFamA=;b=jj5ZMIZwj9w3TM158dUtiinlPPPUjveAH6wBd2VaxvKLTjojQx+liNXY2yFXmMzeKDhLDs4tXEKAZpdJMYVUlgWa3sJrY8TuXQGfiGa3BspJIYuotTw4RCEG6rQUzOFpGJiJ8Eqp2IbF4Ri9JNKPiEpD8Wdv0QB1afE6TXRwzVU=
- In-Reply-To: <DM5PR04MB05083823C1CEDFD693DD1638E0030@DM5PR04MB0508.namprd04.prod.outlook.com>
- References: <CAM+dB2fszww=4A_w6evqg=5O9KKLnujajmg_SPSX=hCRQiBPtg@mail.gmail.com><DM5PR04MB05083823C1CEDFD693DD1638E0030@DM5PR04MB0508.namprd04.prod.outlook.com>
I'm going to go ahead and call this
JSON-CIF2
because I'm pretty sure that is implied, right?
Dear CIF-developers,
A JSON representation of CIF is absolutely something that can and should be done, and the proposal seems viable and fairly complete. Nevertheless, there are some aspects of the proposal that bear discussion:
1. Which JSON are we talking about? The one described within ECMA-262? The one described by ECMA-404? Presumably not RFC4627, but maybe its successor, RFC7159? In fact, my vote would be for I-JSON, as described by RFC7493 (a restricted profile of RFC7159 JSON). I-JSON handles several interoperability issues that otherwise we would either suffer or have to handle explicitly.
For applications that require the exact interchange of numbers with greater magnitude or precision, it is RECOMMENDED to encode them in JSON string values. This requires that the receiving program understand the intended semantic of the value.
b) CIF requires not just that block names, frame names, and data names be unique within their respective scopes, but that their *normalized forms* be unique within their scopes. That stronger constraint is alien to JSON; do we care about JSON-CIF enforcing that as an (I-)JSON constraint?
c) I don’t see a particular value in placing stronger character encoding constraints on JSON-CIF than the underlying JSON standard places. Selection of I-JSON would make this moot, however, for I-JSON in fact requires UTF-8 encoding, just as is proposed for JSON-CIF.
3. We have again run into the CIF quirk of having two distinct null values, whereas JSON has only one. Although the two-character string "\\?" is certainly reminiscent of the special CIF ? value (as "\\." would be reminiscent of the . value), why not instead choose a value such as "\u0001" or "\uFFFF", which will never appear in a conforming instance of CIF’s native serialization?
_______________________________________________ cif-developers mailing list cif-developers@iucr.org http://mailman.iucr.org/cgi-bin/mailman/listinfo/cif-developers
Reply to: [list | sender only]
- References:
- Draft JSON specification for CIF (James Hester)
- RE: Draft JSON specification for CIF (Bollinger, John C)
- Prev by Date: RE: Draft JSON specification for CIF
- Next by Date: Re: Draft JSON specification for CIF
- Prev by thread: RE: Draft JSON specification for CIF
- Next by thread: Re: Draft JSON specification for CIF
- Index(es):