[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Reply to: [list | sender only]
RE: Anyone want to write a JSON schema for CIF-JSON?
- Subject: RE: Anyone want to write a JSON schema for CIF-JSON?
- From: "Bollinger, John C" <John.Bollinger@xxxxxxxxxx>
- Date: Wed, 21 Jun 2017 18:21:53 +0000
- Accept-Language: en-US
- authentication-results: iucr.org; dkim=none (message not signed)header.d=none;iucr.org; dmarc=none action=none header.from=STJUDE.ORG;
- DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=SJCRH.onmicrosoft.com; s=selector1-stjude-org;h=From:Date:Subject:Message-ID:Content-Type:MIME-Version;bh=R6L/rvlyVHzUmbLtFMv/6SKtIVg1FvzDNWVYdIxaAlk=;b=B/HCzSt4UjYHQES1rkbDDlA+oGDY97a2HGWkfw3bj9Iwvu0Sa5wcW+e8b6GXqwDeeTnnvTI+krChakJrQtaupiaE41iQsrFKrQ8WvIOVyWNX9kC0wjMrgJT7cWFYdV2GXIsAJd81Gu0r5+ehwdpzGkAoHUApuso3ri9Jl4nMwVw=
- In-Reply-To: <CACaHzQUjjo4orpjQA3inqYd3_6N3WX9VLV8N5SBWgXFN5DfHqA@mail.gmail.com>
- References: <CAM+dB2fYaa-cWgSsygz9G5ZgQpCtoZyCdamk0umE0FLnEOPoWQ@mail.gmail.com><MWHPR04MB05129807DEA569D0FFEDB023E0C20@MWHPR04MB0512.namprd04.prod.outlook.com><CAM+dB2dgmm9bwY_TKMD=ijis+ReUvi69YK-h_2xkXXgCZGo+uQ@mail.gmail.com><CACaHzQUjjo4orpjQA3inqYd3_6N3WX9VLV8N5SBWgXFN5DfHqA@mail.gmail.com>
- spamdiagnosticmetadata: NSPM
- spamdiagnosticoutput: 1:99
On Wednesday, June 21, 2017 12:16 PM, Marcin Wojdyr wrote: > I modified my converter to conform to the current CIF-JSON draft and tested the schema a bit. I got one error: > > Message:Array item count 0 is less than minimum count of 1. > > This was for empty loop: > > loop_ > _nop > > which I assumed should be converted to empty array: > > "_nop":  Empty loops are not valid in CIF, so every data name in a valid CIF has at least one corresponding value, even if that value is the unknown-value placeholder (?). The draft schema validates this. > OTOH empty loops could be just skipped, this is not explicit in the draft. That is a question of how your particular CIF-to-JSON conversion software handles this invalid form, supposing it accepts the CIF at all. For what it's worth, when the CIF API's parser is instructed to recover from that particular error, it will accept the invalid empty loop. Its internal data model can accommodate it, and accepting it serves the purpose of detecting duplicate names. Data can be added to such loops afterward to make them valid, and in case that's not done, the API has a function specifically for finding and removing data-less loops. I'd have to check what my own CIF API based CIF-to-JSON converter does in this case, but I suspect that at the moment, it does as yours does. I consider that a flaw, which I will fix presently. > Apart from this the schema works for me. Thanks for checking it out. I think there's at least one validation it should perform but doesn't, and it is on my agenda to write some automated tests. I'm not sure when those tests will be realized, however. > Just note that the draft has URI ending with cif-json.txt and in the schema it's cif-json.json. Yes, I noted this in my comments accompanying the draft. The URI in the JSON schema document seems more appropriate to me because we are in fact using a formal JSON-schema schema, and I suppose that detail is still flexible at this point. We *do* need to reach a resolution on this, however, and to make corrections to schema and/or example as needed. Cheers, John -- John C. Bollinger, Ph.D. Computing and X-Ray Scientist Department of Structural Biology St. Jude Children's Research Hospital John.Bollinger@StJude.org (901) 595-3166 [office] www.stjude.org ________________________________ Email Disclaimer: www.stjude.org/emaildisclaimer Consultation Disclaimer: www.stjude.org/consultationdisclaimer _______________________________________________cif-developers mailing email@example.com://mailman.iucr.org/cgi-bin/mailman/listinfo/cif-developers
Reply to: [list | sender only]
- Anyone want to write a JSON schema for CIF-JSON? (James Hester)
- RE: Anyone want to write a JSON schema for CIF-JSON? (Bollinger, John C)
- Re: Anyone want to write a JSON schema for CIF-JSON? (James Hester)
- Re: Anyone want to write a JSON schema for CIF-JSON? (Marcin Wojdyr)
- Prev by Date: Re: Anyone want to write a JSON schema for CIF-JSON?
- Next by Date: Re: Anyone want to write a JSON schema for CIF-JSON?
- Prev by thread: Re: Anyone want to write a JSON schema for CIF-JSON?
- Next by thread: Re: Anyone want to write a JSON schema for CIF-JSON?