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.

 

 

John

 

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.

 

Bob

 

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

Bob,

> - 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 "?".

Marcin

_______________________________________________
cif-developers mailing list
cif-developers@iucr.org
http://mailman.iucr.org/cgi-bin/mailman/listinfo/cif-developers




--

Robert M. Hanson
Larson-Anderson Professor of Chemistry
St. Olaf College
Northfield, MN
http://www.stolaf.edu/people/hansonr


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
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 Council for Science (admitted 1947). Member of CODATA, the ICSU Committee on Data. Member of ICSTI, the International Council for Scientific and Technical Information. Partner with UNESCO, the United Nations Educational, Scientific and Cultural Organization in the International Year of Crystallography 2014.

ICSU 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.