Discussion List Archives

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

RE: Draft JSON specification for CIF

It’s not just CIF2 that can express a string value consisting of a single dot or a single question mark.  CIF1 has always been able to do the same.  This is one of the areas where it matters whether the value is expressed in quoted form.


I considered suggesting "\u0000" as one of the null representations, but held back because although it is well-defined, it has the potential to be difficult to handle.  For example, in C, the UTF-8 or UTF-16 encoding of that string will be treated the same as an empty string by the standard library’s string functions.  This certainly *can* be handled, but why lay traps?


As for other possible null representations, U+FFFF has an advantage over U+FFFD, in that the former cannot appear in CIF2’s native serialization (the spec does not allow it), whereas the latter can do.





From: cif-developers [mailto:cif-developers-bounces@iucr.org] On Behalf Of Robert Hanson
Sent: Thursday, April 13, 2017 10:44 AM
To: Forum for CIF software developers <cif-developers@iucr.org>
Subject: Re: Draft JSON specification for CIF


You mean because in CIF2 you can put "." in, with quotes to mean an actual dot, or without quotes to mean NULL, is that the issue? I do like \u0000 (unicode NULL) for CIF ".' NULL. How about U+FFFD for "?" ?  Here's what they look like on my machine:

Inline image 1

What I meant by "not an issue" is that if everything is a string, then there isn't the issue that some "numerical" values are numbers and some are strings of some sort.




On Thu, Apr 13, 2017 at 10:13 AM, Marcin Wojdyr <wojdyr@gmail.com> wrote:


> - This adds the unnecessary complication of what to do with "." and "?"

I think you imply that . and ? should be expressed in JSON as "." and "?".
But this would be ambiguous: JSON "?" could mean either unknown or string "?".


cif-developers mailing list


Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN

If nature does not answer first what we want,
it is better to take what answer we get.

-- Josiah Willard Gibbs, Lecture XXX, Monday, February 5, 1900

Email Disclaimer: www.stjude.org/emaildisclaimer
Consultation Disclaimer: www.stjude.org/consultationdisclaimer
cif-developers mailing list

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.