KeyValues Class

Overview

The KeyValues class represents data types that can be conveniently represented (internally at least) in a {Key}={Value} format, i.e. a set of discrete key identifiers in no particular order, and an assignment for each. This paradigm is only really noticeable for UserKeyValues Properties.

ElementalAnalysis

The ElementalAnalysis Property encapsulates the following information: (1) the molecular formula of a particular species; (2) solvent of crystallisation; (3) calculated percentage values of selected elements; (4) data entry for actual values of these elements.

As much as possible of the tedious task of entering and calculating elemental analysis data is streamlined. The molecular formula is stored within the ElementalAnalysis Property, but it may be generated by inserting a link to a Formula Property (using the Lookup button), and periodically updated if necessary, using the Update button.

Solvent may be entered, and is done so manually; in the example shown, the solvent is benzene (C6H6), and the number of equivalents given as 0.5, i.e. one molecule of benzene appears in the solid state for every two occurrences of the main substrate.

To make the Property useful, the user must enter one or more elements in the columns on the left. The most common form of elemental analysis, the standard "CHN", is shown in this example. After determining the elements of interest, click the Recalc button, and the predicted percentages will be calculated and filled in, to the commonly desired 2 decimal places (any previous calculated data is replaced). Solvents are factored into this calculation.

Observed values must be entered manually (now only if there was a convenient software package to do that...!)

Literature

There are many ways to enter a literature citation, and several other CRK datatypes could be used, including obviously the Text Class based Properties. However, structured reference data has a lot to be said in its favour. Literature references could also be implemented readily enough with the UserKeyValues Property described below, but in order to try to impose a little bit of consistency, the preferred method is to use the hardcoded Property.

The fields are somewhat self-explanatory. Note that structure is only imposed with regard to breaking out the fields themselves; the format used to list the authors and journal name is not prescribed.

UserKeyValues

The UserKeyValues Property is quite flexible, and exposes the underlying data style for the KeyValue Class. This Property can accommodate dozens of individual fields, as long as each has an identifying name.

The example shown is a compact way of denoting multi-step dissociation constants. Note that there are other fairly convenient ways to represent data within CRK; although a single PhysicalProperty could not be used to hold the 4 numbers needed in this example, one could create a Collection, and place within it several Number Properties and some Text. They UserKeyValues approach is the least cumbersome and most elegant, however.

Although all keys are created equal, the values can be assigned as being of type Text or Number, which merely places restrictions on the data content in the latter case. For the example shown, the four pKa values are Numbers, while the description of conditions is text. Note that the ordering of Key/Values is preserved, so the order of addition/insertion may be important.

Unless disabled by use of Constraints, the user is free to add, insert, delete and rename the individual Key/Values, using the appropriate buttons. The functioning of these is simple enough. With the exception of Add, it is necessary to place the selection cursor in one of the Value fields to indicate the position (i.e. to be deleted/renamed/inserted before). Values are entered just like in any kind of ordinary data entry form. Note that the panel is scrollable, so if there are too many inputs for the available size, scroll bars will appear (vertical only, not horizontal).

UserKeyValues has several toggle Constraints, all of which are enabled by default. The first three "Permit ..." options allow the corresponding buttons to be disabled; disabling them all would make the individual Keys themselves fixed, and only the Values corresponding to them editable. If "Allow blank values" is turned off, it will cause an annoying warning to appear whenever the user tries to leave any of the Values blank, although it does not actually enforce this requirement, as such.


Prev: Scalar Class Back to Contents Next: Structure2D Class