[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
--
Reply to: [list | sender only]
Re: CIF-JSON draft 2017-05-15
- Subject: Re: CIF-JSON draft 2017-05-15
- From: James Hester <jamesrhester@xxxxxxxxx>
- Date: Tue, 16 May 2017 16:00:41 +1000
- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;h=mime-version:in-reply-to:references:from:date:message-id:subject:to;bh=Q1famOL5Whl1Xt6P/w4Gu50Yb2lo366/WQnoouocKSA=;b=bpIWKPgS3hSz3T5RlrnjX6nUU3RqT+okWc+tPdWI5D2q8jP1O2leznu1ha0w/5Ypz+fO+t5w+LoDCVrMoKNA83VYm/+xjIayJce/vvH/IOG0T5oZrIR/QkEegg/PePFT+u1wFiMgFvx+LKyWEqvl1HaBBkndFqySadXlv/p/zEbnKtgK3ZzBpewgzZgDKolWLi91s4EHFzEuO3wP1EXfWaFgsCp5cvJVPeb1wkeVjAbbgtjzuAYUGVgJcFidk2NYjRL6z1Qy+DTmKDU+CiFguhgWskFMTCmagYiLR4S1NQEntQLRvQIg+da1dlPAUKTMADCZdU1M1rsrxA882hMWdQ==
- In-Reply-To: <CAF_YUvW01EL98PYcAq0fADvF9BK6oJTdhe4Ju9byg5x5bmGc2Q@mail.gmail.com>
- References: <CAM+dB2cAAY3CjC741WU0GqaWmAi2iGHtwZ82iA1bCwuNoG6nQg@mail.gmail.com><CAF_YUvVa0JXgAN9Bec6fjd6Nmco5W7EHWLN=Ba=daRR9U-2PzQ@mail.gmail.com><CACaHzQVYeOfS9zTe4gDJMVNCTgxtat0zhMAd2EMX=etXj5g2Gw@mail.gmail.com><CAF_YUvWV3huhwoBuCOkKXqCcYH+8kjFCPjoa=j_v61JC4H32Jg@mail.gmail.com><CAF_YUvUMbVz2j5=XXD5WD3G+0XB4tY=r1zwXuADB14qQNZTPvg@mail.gmail.com><CAF_YUvXPj9g6CEnsKmwZwrp7p550nyykrnQY9iN5wpEnDzrrYQ@mail.gmail.com><CAF_YUvUaJM0bwV4vKZwARQw4Q44LN+TOyr4Ghge3P_qn90tUHQ@mail.gmail.com><CAF_YUvUGexW-7iSfJWQ_c=WZNnbzBJeFaNfzKRVK4DKmdydp+A@mail.gmail.com><CAM+dB2dY8xEp8BeSJfXD5E9+H6-qkBCodMV_gc-fetLNp=x_WA@mail.gmail.com><CAF_YUvU+O3yb-JG_zZWvTW0i7EuzA1_J3c0Q8drWqb6rScSkEw@mail.gmail.com><CAF_YUvWT4ZGT_BbpmB2G3Ya7ttzj70qXD7UofyAsPb010W_XJw@mail.gmail.com><CAF_YUvXb4jbKxSh=Q9Q76Zay-RMi8xXU_geQ5FB76cj5iozkOQ@mail.gmail.com><CAF_YUvW01EL98PYcAq0fADvF9BK6oJTdhe4Ju9byg5x5bmGc2Q@mail.gmail.com>
On 16 May 2017 at 14:30, Robert Hanson <hansonr@stolaf.edu> wrote:
Two last comments:suggests that CIF-JSON absolutely cannot be round-tripped back to CIF format.
1. This comment in the CIF1 spec:
13. The base CIF specification distinguishes between character and numeric values (see paragraph 15 of the document Common semantic features). Particular CIF applications may make more finely-grained distinctions within these types. The paragraphs immediately above have the corollary that a data value such as 12 that appears within a CIF may be quoted (e.g. '12') if, and only if it is to be interpreted and stored in computer memory as a character string and not a numeric value. For example '12' might legitimately appear as a label for an atomic site, where another alphabetic or alphanumeric string such as 'C12' is also acceptable; but it may not legitimately be used to represent an integer quantity twelve.
It can be round-tripped, if you have access to dictionary definitions for every data name appearing in every data block of the JSON object. This is not true in general, but is probably true e.g. for a lot of the curated CIFs that are provided by structural databases.
{"CIF-JSON":{....}}2. One thing we are missing here is a magic number. I know, transport should not need that. But before you know it, someone is going to put a CIF-JSON data stream into a file and then pass that file to another program such as Jmol, expecting the program to know what it is reading. This has always been a nightmare for Jmol. The #\#CIF_2.0 header takes care of that for CIF. In the past all too often people have created formats that don't quickly identify themselves, causing all sorts of headaches. What would you think of this?This way a reader could always know that it is reading CIF-JSON data immediately with just a 10-byte stream read. It would allow file saving and retrieval of the data.
Interesting idea. We could change the 'Metadata' top-level JSON name to 'CIF-JSON' and recommend that this name appears first in the serialised stream, where possible. I don't think it is possible to make this stronger and mandate an order for keys in JSON objects, however.
_______________________________________________
cif-developers mailing list
cif-developers@iucr.org
http://mailman.iucr.org/cgi-bin/mailman/listinfo/cif- developers
--
T +61 (02) 9717 9907
F +61 (02) 9717 3145
M +61 (04) 0249 4148
F +61 (02) 9717 3145
M +61 (04) 0249 4148
_______________________________________________ cif-developers mailing list cif-developers@iucr.org http://mailman.iucr.org/cgi-bin/mailman/listinfo/cif-developers
Reply to: [list | sender only]
- Follow-Ups:
- Re: CIF-JSON draft 2017-05-15 (Robert Hanson)
- References:
- CIF-JSON draft 2017-05-15 (James Hester)
- Re: CIF-JSON draft 2017-05-15 (Robert Hanson)
- Re: CIF-JSON draft 2017-05-15 (Marcin Wojdyr)
- Re: CIF-JSON draft 2017-05-15 (Robert Hanson)
- Re: CIF-JSON draft 2017-05-15 (Robert Hanson)
- Re: CIF-JSON draft 2017-05-15 (Robert Hanson)
- Re: CIF-JSON draft 2017-05-15 (Robert Hanson)
- Re: CIF-JSON draft 2017-05-15 (Robert Hanson)
- Re: CIF-JSON draft 2017-05-15 (James Hester)
- Re: CIF-JSON draft 2017-05-15 (Robert Hanson)
- Re: CIF-JSON draft 2017-05-15 (Robert Hanson)
- Re: CIF-JSON draft 2017-05-15 (Robert Hanson)
- Re: CIF-JSON draft 2017-05-15 (Robert Hanson)
- Prev by Date: Re: CIF-JSON draft 2017-05-15
- Next by Date: Re: CIF-JSON draft 2017-05-15
- Prev by thread: Re: CIF-JSON draft 2017-05-15
- Next by thread: Re: CIF-JSON draft 2017-05-15
- Index(es):