Re: Proposal to regulate markup in CIF files
- To: "Discussion list of the IUCr Committee for the Maintenance of the CIFStandard (COMCIFS)" <email@example.com>
- Subject: Re: Proposal to regulate markup in CIF files
- From: James Hester <firstname.lastname@example.org>
- Date: Thu, 21 Sep 2017 10:59:47 +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=aLwn72i/ppSZCks5Ij6DGbsFszN6ZCLGccrploWLkrM=;b=ApvRBGDSE35ug0BJ9WCeLOvmWumd+WZOMoVrpSdN/4qUMNDFZI/Bt6GSOFSHlEaz/honwXFLUHkCiAQJw8xtGwQNanR/aToRGNGm6brJ/BHAFzDPMdAnZzHLN1lSr/ExDGXKpt5eCUkh0Czsn0cJebMhzl8HC1JCaeW5QZn8Tquay2VQ7SvNsXXuR6CVP2dORTkLOpEV+4YI4VC9AuJfRmJIeDSYJP2tL5bPaUxzLjSk2ctZg+OVY1BJ33Opn2TlPqdLVyTlYR9CTZVX/rBU3usRqpEuUZME+OkM+lIyprhv3pv/T5FlhWPvP5UpidwWG9Vx1EH/hx3oXpcde0Cy5Q==
- In-Reply-To: <DM2PR0401MB145300C788489D6130483DA9E06E0@DM2PR0401MB1453.namprd04.prod.outlook.com>
- References: <CAM+dB2cSRx=68QpdH5nQMuwWYU_pCwDmf2YVM7caU4vcw3fDsQ@mail.gmail.com><DM2PR0401MB145300C788489D6130483DA9E06E0@DM2PR0401MB1453.namprd04.prod.outlook.com>
I've also inserted replies to John's comments inline below.
I think the proposed approach of allowing markup convention to be specified in data files could be useful.¬† Moreover, the proposal would provide a mechanism for formalizing the specification of which items are subject to markup in the first place.¬† Supposedly, that is determined by items‚Äô definitions, but in practice, few, if any, current dictionaries or definitions actually address the topic explicitly.
1. To the extent that the proposal envisions data files being enabled to self-specify a particular markup convention from among several choices, it seems to violate the principle that the meaning of an item should not depend on the value of a different item.
2. Since the codes for various supported markup conventions would be defined in domain dictionaries, it seems we might be setting ourselves up for future issues in the event that dictionary maintainers want to support new markup conventions, for then we will need to change existing definitions (which, granted, we have lately afforded ourselves some freedom to do).
3. Additionally, the proposal seems to imply that each domain dictionary would need to either specify its own analogue(s) of `_publ.markup_convention`, or else to explicitly depend on the Core item.¬† I am uncertain whether this is a good or bad thing.
4. The proposal does not preclude individual items from being defined to have whatever content type is desired for them, as long as the definitions are not flagged as carrying `Marked-up` data.¬† That‚Äôs good, but I can imagine hypothetical cases in which it would be confusing to dictionary authors.¬† For example, if an item were defined to contain HTML markup, it would be necessary for its definition to specify that its values were NOT `Marked-up`.
5. Although we call the existing CIF conventions ‚Äúmarkup‚ÄĚ ‚Äď and that‚Äôs fitting ‚Äď for the most part they don‚Äôt serve the same purpose as Markdown, reStructured text, etc..¬† Almost all of our markup is aimed at encoding specific characters, whereas the other markup conventions mentioned are focused on document structure and styling.¬† These are largely orthogonal considerations, so perhaps we should approach them separately.
6. The discussion accompanying the proposal distinguishes between items that are intended to be machine-actionable and those intended purely for human consumption, with the assertion that only the latter kind should be subject to markup.¬† I would accept that if it referred to structural markup only, but it is not so clear that such a rule is appropriate for markup that serves to encode characters.¬† Consider, for example, `_atom_site.label`.¬† As a key data name, it certainly has machine significance, but its values are also meant to identify atoms to humans.¬† Should CIFs, then, be forbidden from using `CőĪ` (i.e. `C\a`) as or in atom labels?¬† Forbidding use of markup would prevent literal `CőĪ` from being expressed in an atom label in a CIF 1.1 document, but not in a CIF 2.0 document, so that sets up a pathway wherein markup gets introduced into data values through format transliteration from CIF2 to CIF1.¬† If only the original document were considered valid in such cases, then that would constitute a rather nasty trap to set for ourselves.
As presented, the proposal‚Äôs largest impact would probably be to provide for DDLm dictionaries to specify which items are primarily (or exclusively) intended for human consumption: those that are defined to have `Marked-up` content, regardless of whether any markup is actually present in their values.¬† Initially, at least, this would establish in which values to interpret the standard CIF markup conventions.¬† That would be worthwhile.
I am less certain about the prospects for or usefulness of enabling data files to select alternative markup conventions.¬† Perhaps that could be used to good effect to support revisions to the markup conventions.¬† Perhaps it would be more broadly applicable.¬† But perhaps we should avoid making any items‚Äô meanings depend on other items‚Äô values.
Revised discussion paper for regulating markup of CIF text items
1. Data values containing backslash escapes for indicating non-ASCII
¬†¬† characters are to be considered entirely equivalent to values
¬†¬† obtained after all such substitutions and escapes have been applied.
2. Other mark-up (superscripts, subscripts, italic etc.) is given a
¬†¬† new type, but is otherwise unspecified and needs to be discussed.
From the very first publication describing CIF, markup conventions
have been provided in order to extend the range of characters and font
effects representable in ASCII.¬† Which data values these conventions
might apply to, and whether or not this is more properly a CIF syntax
or dictionary (semantic) issue, has been left implicit.
Marked-up text according to the ad-hoc definitions described in Vol G
appears both in CIF data files and in dictionary definitions. While
COMCIFS has control over the conventions applying within dictionaries,
it has far less control over data values in data files, which are
produced both by dedicated software, such as publCIF, and hand-editing
or local ad-hoc solutions.¬† Marked-up text in data files plays an
important role in the publication workflow.
Vol G (First Edition) notes in section 22.214.171.124: "It is hoped that in
future different types of such markup may be permitted so long as the
data values affected can be tagged with an indication of their content
type that allows the appropriate content handlers to be invoked". It is
not, however, clear that multiple alternative markups are desirable.
The markup in use can be divided into two classes: 'character encoding'
and 'font effects'.¬† Under this proposal, each class is treated differently.
1. Character encoding
¬†¬† Character encoding markup represents non-ASCII letters using a
¬†¬† backslash followed by one or more ASCII characters, for example,
¬†¬† '\a' is 'greek letter alpha'.¬† This is a format-specific method of
¬†¬† allowing access to the full characterset used by the DDL textual
¬†¬† types. From the point of view of the (format-agnostic) dictionary
¬†¬† data model, how a particular format wishes to encode characters is
¬†¬† irrelevant. Therefore, the set of character escapes is most
¬†¬† appropriately documented as part of the description of CIF syntax,
¬†¬† not within a DDL dictionary.¬† In other words, CIF1/2 data values with
¬†¬† backslash character escapes are semantically identical to CIF2 data
¬†¬† values where those escapes have had their Unicode equivalents
2. Font effects
¬†¬† Font effects differ from character encodings in not having a DDLm
¬†¬† type that they are a concrete realisation of. By analogy, then, we
¬†¬† could create a DDLm type 'Marked-up text', whose contents contain
¬†¬† marked-up text.¬† Particular implementations and syntaxes might then
¬†¬† specify what particular convention(s) 'Marked up text' should
¬†¬† conform to.
1. An important function of the 'Marked-up text' type is to
¬†¬† designate data values that are not intended to be machine-actionable.
¬†¬† No DDLm functions or attributes are envisioned for manipulating the
¬†¬† markup. The type could alternatively be something like 'Rich text'.
2. Enumerated values and identifiers must not be of type marked-up text.
3. The 'marked-up text' data value is obtained from a CIF syntax
¬†¬† file after backslash character codes have been substituted.
The above proposal does not specify a particular markup convention. Leaving
anything unspecified is dangerous for a standard, as it invites the appearance
of multiple, incompatible solutions.¬† We should as a matter of urgency answer
the following questions:
(1) Should alternative markup conventions be possible?
(2) If yes, should the markup convention in use be
¬†¬†¬† (i) per dataname?
¬†¬†¬† (ii) per datavalue (maybe via an embedded flag)?
¬†¬†¬† (iii) per data block?
¬†¬†¬† (iv) per dictionary?
¬†¬†¬† (v) per syntax? (e.g. CIF/CIF-JSON/HDF5 etc.)
(3) If no, the current convention is the only possible one for reasons of
¬†¬†¬† backward compatibility. Should it be:
¬†¬†¬† (i) a feature of CIF syntax?
¬†¬†¬† (ii) a feature of CIF syntax when combined with a DDLm dictionary?
¬†¬†¬† (iii) defined in DDLm?
My answers to these questions would be
(1) No alternatives should be possible, in order to simplify publishing
¬†¬†¬† workflows and maintain the publCIF investment
Some explanation regarding (ii), which possibly sounds a bit
abstruse. A CIF syntax file can be used (in theory) with an
alternative dictionary language and associated data model. Likewise,
DDLm dictionaries can be used to describe non-CIF files.¬† In each
case, the way in which syntactical data values are constructed to
match the dictionary types may differ (for example, numbers may be a
text string or binary).¬† Each combination of syntax and dictionary
must explicitly state how each dictionary type is represented in that
syntax. So I am suggesting that for the combination 'CIF + DDLm' that
we specify the current markup conventions to represent type 'Marked-up
Reply to: [list | sender only]