Discussion List Archives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CIF-JSON draft 2017-05-15

I had misunderstood Bob's proposal. Yes, I can see the benefit of an outer object with a single "CIF-JSON" key.  I'll add that to the next draft if there are no objections.

Concatenation: The CCDC (I speculate) are simply physically concatenating CIF files, which produces a syntactically correct file and is really efficient as there is no need to parse the contents. Of course, this fails to meet the standards if data blocks happen to have the same names, and could only be fixed by completely parsing every file to identify and possibly change data block names.  In contrast, concatenation of JSON objects does not produce a syntactically correct string, so would not be attempted in the first place and is not something we need to guard against.  Our concatenator is more likely to attempt "[" + A + "," + B +"]" to produce an array of objects. Now, the concept "a JSON array of CIF-JSON objects" is perfectly well-defined, and so is a viable method of data transfer without any intervention from us.  Therefore, I don't think we need to include it in the standard, but we could comment that such an array would be the preferred way to transfer multiple CIF-JSON objects (to state the obvious).

James.


On 17 May 2017 at 22:11, Robert Hanson <hansonr@stolaf.edu> wrote:
My proposal is that everything we have been talking about {...} be wrapped by a self-identifying object with the single item "CIF-JSON":

{"CIF-JSON":{....}}

So while it is possible that there will be white-space:

{
  "CIF-JSON":

{....}


}

it is highly probable that this white space would be minimal, and that certainly within the first N finite number of characters we would see "CIF-JSON".

Or, if a reader does need to read the entire file to process any JSON data of any sort instead of streaming the data (Jmol might do this, too), then at least we know that the outer object will have a single key, and that key will be "CIF-JSON".

It occurs to me that we could then also allow concatenation such as:

[
{"CIF-JSON":{...}}
,

{"CIF-JSON":{...}}
,

{"CIF-JSON":{...}}
,
...
]

This would allow services such as COD to easily deliver multiple CIF-JSON structures without worrying about what the CCDC fails to do -- modify the data_ lines when concatenating.



Bob



_______________________________________________
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
_______________________________________________
cif-developers mailing list
cif-developers@iucr.org
http://mailman.iucr.org/cgi-bin/mailman/listinfo/cif-developers

Reply to: [list | sender only]
International Union of Crystallography

Scientific Union Member of the International Science Council (admitted 1947). Member of CODATA, the ISC Committee on Data. Partner with UNESCO, the United Nations Educational, Scientific and Cultural Organization in the International Year of Crystallography 2014.

International Science Council Scientific Freedom Policy

The IUCr observes the basic policy of non-discrimination and affirms the right and freedom of scientists to associate in international scientific activity without regard to such factors as ethnic origin, religion, citizenship, language, political stance, gender, sex or age, in accordance with the Statutes of the International Council for Science.