[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
--
Reply to: [list | sender only]
Re: CIF-JSON new draft
- Subject: Re: CIF-JSON new draft
- From: James Hester <jamesrhester@xxxxxxxxx>
- Date: Fri, 5 May 2017 16:27:25 +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=lUHk2r7hHbKzUyyHClHA1bZwUTa5ElgFwwgsONEroGA=;b=gbEiswF4IQl/f7Fgq8kPd682aGAOgFtIqY1FiEyMcndXyS9w0Ojsl3pB2kUjdKE1mXpog3tDHKef36pK5iSIF7nGv3cl2uwy7vd19w1YT6/+TaPLkcmKcYOl7fj/LgiSkiAgujMoxkf+039zWoapS3XMTGOq4ce7qS2jVtRKuFDj2zTZUxwqyzKXugBQZoWWeGWfAuI6dosGJmc/2CluHQErXm9V7s0gJmH4q2X2L6Su775pTLxhy3azSig7AOxJy0bKELWyAT7YyH4tJRX0iax1thxSTvqnu20xx502DuI/gHuSIxBjIMqzqx7rr59tDeJOY55F+uC3I0noDL10Ew==
- In-Reply-To: <MWHPR04MB05128E59CEA91A5A4A05C707E0EA0@MWHPR04MB0512.namprd04.prod.outlook.com>
- References: <CAM+dB2ey9kKLoZY=WE7Uy-fiWTGhQaFx7fcgODcYfhrNPwXkQw@mail.gmail.com><MWHPR04MB05123A9F46812A3372A252FCE0160@MWHPR04MB0512.namprd04.prod.outlook.com><MWHPR04MB051249D1082721C51E84232FE0160@MWHPR04MB0512.namprd04.prod.outlook.com><CAF_YUvVjKTmCC18=pNGgANU25phE8Gij9=boT=nw8vUZQKPHmw@mail.gmail.com><MWHPR04MB05128E59CEA91A5A4A05C707E0EA0@MWHPR04MB0512.namprd04.prod.outlook.com>
Hello again,
"loop tags" is optional on the basis that dictionaries will provide the needed information on which datanames belong together in a loop, as well as on the type of dataitem to expect. In other words, the programmer manipulating JSON-derived data already knows which dataitems belong together when writing the program, and so never needs the "loop tag" entry (counterexample?). A potential issue does arise with DDLm child loops, which can be presented either separately from the parent loop, or together in a single loop with their parent datanames. However, in this case the presence or absence of the child loop key dataname(s) is sufficient to determine which datanames go into which loops.
That said, I support John's suggestion to put all datanames in lists, as it nicely unifies datavalue representation, making programming easier. mmCIF is a case in point because in CIF syntax every mmCIF dataname can be looped, or if there is only a single value a dataname can instead appear unlooped. Semantically (i.e. in the mmCIF dictionary) this just corresponds to "everything looped", so every single mmCIF dataname in JSON should be list-valued in any case. I suppose you could also assert that a non-list-valued dataname is just syntactic sugar for 'a single-element potentially looped dataname', but how useful is this syntactic sugar?"loop tags" is optional on the basis that dictionaries will provide the needed information on which datanames belong together in a loop, as well as on the type of dataitem to expect. In other words, the programmer manipulating JSON-derived data already knows which dataitems belong together when writing the program, and so never needs the "loop tag" entry (counterexample?). A potential issue does arise with DDLm child loops, which can be presented either separately from the parent loop, or together in a single loop with their parent datanames. However, in this case the presence or absence of the child loop key dataname(s) is sufficient to determine which datanames go into which loops.
James.
On 4 May 2017 at 23:48, Bollinger, John C <John.Bollinger@stjude.org> wrote:
On Wednesday, May 03, 2017 5:42 PM, Robert Hanson wrote:
> On Wed, May 3, 2017 at 4:03 PM, Bollinger, John C <John.Bollinger@stjude.org> wrote:
>> Dear CIF Developers,
>>
>> I additionally think that the current version of the specification is too lax about use of the "loop tags" item. If the CIF version is unspecified among the metadata or if it is specified with value 2.0, and if the data block being represented contains either at least one loop or at least one unlooped item whose value is a CIF2 list, then the meaning of some values is ambiguous without the "loop tags". It is undesirable to allow such ambiguity.
>
>
> John, I don't see that. Can you give a concrete example?
Sure. Consider this JSON:
{
"block": {
"_xyz": [ 0.1, 0.2, 0.3 ]
}
}
It appears to me that it corresponds both to
#\#CIF_2.0
data_block
_xyz [ 0.1 0.2 0.3 ]
# end of CIF
and to
#\#CIF_2.0
data_block
loop_
_xyz
0.1
0.2
0.3
# end of CIF
Of course, the latter could trivially be converted to CIF 1.1, with that result also corresponding to the given JSON.
On the other hand, only the latter corresponds to this JSON:
{
"block": {
"_xyz": [ 0.1, 0.2, 0.3 ],
"loop tags": [["_xyz"]]
}
}
and only the former corresponds to this JSON:
{
"block": {
"_xyz": [ 0.1, 0.2, 0.3 ],
"loop tags": []
}
}
The problem arises from the similarity between items 5.v and 5.vii in the draft spec: CIF 2.0 list values are presented as JSON lists / arrays, and the multiple values of a looped item are also presented as JSON lists / arrays. As I read the draft, however, the values of unlooped items are presented bare, as opposed to, for example, as single-element arrays. Therefore, some form of metadata is required to distinguish whether an array presented as an item's value represents a single CIF list value or multiple distinct values taken by the item in a loop. The appropriate "loop tags" field can provide the needed metadata if it is present, given the requirement that if it appears at all then it must describe all loops in the data block. I had supposed that the ability to use it for that purpose was the reason for that constraint.
However, inasmuch as CIF does not make an inherent semantic distinction between items presented as scalars and the same items presented in a single-packet loop (and mmCIF in particular denies any significance to such differences), an alternative to requiring that loop tags be provided would be to present every item as if it were looped -- i.e. regardless of whether an item is presented syntactically in a loop in the CIF format, its one or many values are presented in an array in CIF-JSON. In that case, the "loop tags" field would not need to carry the burden, and the constraints on it could even be relaxed a bit. Such a representation is consistent with CIF's underlying data model as I conceive it (http://forums.iucr.org/viewtopic.php?f=27&t=77 ).
John
________________________________
Email Disclaimer: www.stjude.org/emaildisclaimer
Consultation Disclaimer: www.stjude.org/consultationdisclaimer
_______________________________________________
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]
- References:
- CIF-JSON new draft (James Hester)
- RE: CIF-JSON new draft (Bollinger, John C)
- RE: CIF-JSON new draft (Bollinger, John C)
- Re: CIF-JSON new draft (Robert Hanson)
- RE: CIF-JSON new draft (Bollinger, John C)
- Prev by Date: RE: CIF-JSON new draft
- Next by Date: Re: CIF-JSON new draft
- Prev by thread: RE: CIF-JSON new draft
- Next by thread: Treatment of Greek characters in CIF2
- Index(es):