This is an archive copy of the IUCr web site dating from 2008. For current content please visit https://www.iucr.org.
[IUCr Home Page] [CIF Home Page] [mmCIF Home Page]

Re: Coping with the units extension on core dictionary data names.

Murray-Rust Dr P (pmr1716@ggr.co.uk)
Mon, 20 Nov 1995 16:57:52 +0000 (GMT)


On Mon, 20 Nov 1995, Peter Keller wrote:

[...]
> 
> ### _item_aliases.name is determined implicitly for each row:
> loop_
>     _item_aliases.alias_name
>     _item_aliases.units_code
>     _item_aliases.dictionary
>     _item_aliases.version
>           '_cell_length_a'     'angstroms'   'cifdic.c94' '2.0'
>           '_cell_length_a_pm'  'picometres'  'cifdic.c94' '2.0'
>           '_cell_length_a_nm'  'nanometres'  'cifdic.c94' '2.0'
> 
	When developing code for core CIF I used to expand the 
possibilities out like this.  Note that this means 9 names for cell 
lengths (as _cell_length_ is used as a single 'parent' in the dictionary).
The 'parent' and the units, when combined can lead to a large number of 
additional terms.  This makes it potentially difficult unless there are 
levels of indirection as suggested here.

>    .....
>     _item_units.code             'angstroms'
> 
>    save_
> 
> Now, on finding 
> 
>    _cell_length_a_pm  1490.3
> 
> in a CIF, a mmCIF-based application can find out from the dictionary that the
> units of the data value _in_the_file_ are picometres. It can also determine
> that the units of _item_aliases.name ('_cell.length_a') are angstroms, and
> can find the appropriate conversion from the ITEM_UNITS_CONVERSION category: 
> 
>      loop_
>     _item_units_conversion.from_code
>     _item_units_conversion.to_code
>     _item_units_conversion.operator
>     _item_units_conversion.factor
>     ...
>      'picometres'               'angstroms'                '*'   1.0E-02
> 
> I think that this answers the semantic vs. s syntactic point, since the
> '_pm' suffix does not need to be 'noticed' at the time the data name is
> parsed - '_cell_length_a_pm' is just another data name at this point. The
> assignment of units to the following data value is cleanly separated from
> the syntax checking. 

This seems workable - again I hacked something along these lines.  
However, this is a very specific instance of associating methods with 
items.  
> 
> If it seems a little odd at first to put something about units in the 
> ITEM_ALIASES category, bear in mind that this category's raison d'etre is 
> compatability with the core CIF dictionary anyway.
> 
> Comments anyone?

One problem I have had in core CIF (I don't know about mmCIF) is the lack of 
attributes, and this clearly shows in the current example.  It would be 
nice to write something like:
	_cell_length_a(units=pm) 1490.3


	P.

Peter Murray-Rust   44-1438-763338 T  "Nothing exists except atoms and empty 
pmr1716@ggr.co.uk   44-1438-764918 F   space; all else is opinion" Democritos.
Biomolecular Structure, Glaxo Wellcome, Stevenage, Herts, SG1 2NY, UK