Re: Draft JSON specification for CIF
- Subject: Re: Draft JSON specification for CIF
- From: Andrius Merkys <andrius.merkys@xxxxxxxxx>
- Date: Thu, 13 Apr 2017 13:52:20 +0300
- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;h=subject:to:references:from:message-id:date:user-agent:mime-version:in-reply-to; bh=mMJ/y+YIIL5xtu1G6uaUFgfwwamBucClyuegOPeHwNk=;b=FK6U6ngz9/r2xmXsiN4dYvlhN30v3Ds1EbZE54b4OBcL7mUmmTskPo6VJAdnIWUlXSC0Gdu+Qd5Lghmd0T6NqHV7s7/54ueHSP+b6x1S0DqESsiAY7jF7FKfJeLzqgo1vmSAb09nvIobKle3BA2WSiUgEfQModLJ7ivDUBZXTomLlD8Z1nn0nqPwyynODaFeIwIVDcNcldPv0Wao33gES0DnR/U6LHO0w8bX+/DrFox8xEQWZWf0zVHdKDo3FIz6S8CnLqyobXTeyVeSwkDSSFFxPyXFl4WVtBnfgslp4Xsv6Xjqr2XPAscQbUPpSYsntzmxs77+HXErh01G32elTA==
- In-Reply-To: <CAF_YUvWYYDuDRvuDN1k=T0Ym8M3enEBPr45KNWF9m1Wng21rEw@mail.gmail.com>
- References: <CAM+dB2fszww=4A_w6evqg=5O9KKLnujajmg_SPSX=hCRQiBPtg@mail.gmail.com><CAF_YUvWYYDuDRvuDN1k=T0Ym8M3enEBPr45KNWF9m1Wng21rEw@mail.gmail.com>
Dear all, we at the Crystallography Open Database (COD) have been experimenting with CIF <-> JSON conversion for a while. We have arrived at a decision to map the internal representation of CIF files used by our software package 'cod-tools' (http://wiki.crystallography.net/cod-tools/) directly into JSON. We have been using 'cod-tools' internal representation (described in Merkys et al., 2016, http://dx.doi.org/10.1107/S1600576715022396) for some time and though it includes some redundant information, it has proven itself useful in automatically handling CIFs at the COD. I have generated an example of CIF2 file (from proposal by
James, https://github.com/merkys/CIF2JSON/blob/master/test.cif)
converted to JSON and put it here:
https://github.com/merkys/CIF2JSON/blob/master/test-pp.json. I
believe our conversion method solves at least a part of the
concerns voiced in this discussion: 1) Top level container is an array instead of an object, thus, order of CIF datablocks (represented as objects) in an input file is retained; uniqueness of datablock names are not enforced; 2) Data items are keys of 'values' sub-object, thus uniqueness of
data names within a data block / save frame are enforced; 3) Values are *always* represented as strings exactly as given in
CIF file, without losing any precisions; 3) Types of values are stored alongside in a sub-object 'types' of datablock. Thus, '?' value of type 'unquoted string' is easily distinguishable from '?' value of type 'quoted string' or 'textfield', reducing the need of methods to escape '?' and '.' values with special meanings; 4) Values of a tag are always put in an array; there is a sub-object 'inloop' of datablock, which tells whether a tag is looped or not; 5) Loops, their tags and order are described in sub-array 'loops' of datablock (same purpose as "loop tags"). In addition, SUs are extracted and presented alongside in
sub-object 'precisions'. Version of CIF parsed is stored in
sub-object 'cifversion' and version of cod-tools internal
representation is put in 'version'. Backwards conversion JSON
-> CIF is currently possible for CIF1.1 only, but we are going
to implement it for CIF2 in the nearest future. Best wishes, On 12/04/17 14:36, Robert Hanson wrote:
CAF_YUvWYYDuDRvuDN1k=T0Ym8M3enEBPr45KNWF9m1Wng21rEw@mail.gmail.com" type="cite"> -- Andrius Merkys PhD student at Vilnius University Institute of Biotechnology, Saulėtekio al. 7, V325 LT-10257 Vilnius, Lithuania Lecturer at Vilnius University Faculty of Mathematics and Informatics, Naugarduko g. 24 LT-03225 Vilnius, Lithuania |
_______________________________________________ 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 (Robert Hanson)
- Prev by Date: Re: Standard uncertainties (SU) in the DDLm dictionary
- Next by Date: RE: Standard uncertainties (SU) in the DDLm dictionary
- Prev by thread: Re: Draft JSON specification for CIF
- Next by thread: RE: Draft JSON specification for CIF
- Index(es):