COMCIFS / Powder_Dictionary

CIF definitions for powder diffraction
4 stars 4 forks source link

How does `_type.purpose Link` work? #50

Closed rowlesmr closed 1 year ago

rowlesmr commented 1 year ago

I'm trying to figure out how _type.purpose Link works

For instance, in the definition (copied below) of _pd_calc_component.point_id, its value is linked to _pd_data.point_id. Does this mean that the value given to _pd_calc_component.point_id must also be a valid value of _pd_data.point_id? What is the scope? Must the valid _pd_data.point_id be in the same block as _pd_calc_component.point_id? I'm assuming that the link goes from _pd_calc_component.point_id to _pd_data.point_id; i.e. the presence of _pd_calc_component.point_id implies the existance of _pd_data.point_id, but not vice versa.

I'm just trying to figure out what (if any) links will need to be added to take advantage of the new _pd_phase.id and _pd_diffractogram.id.

save_pd_calc_component.point_id

    _definition.id                '_pd_calc_component.point_id'
    _definition.update            2022-10-12
    _description.text
;
    Arbitrary label identifying a calculated component data
    point. Used to identify a specific entry in a list of values
    forming the calculated component diffractogram.

    The value of _pd_calc_component.point_id must be the same as
    the value of _pd_data.point_id given to the equivalent data point
    in the measured/processed/calculated diffractogram to which
    this component belongs.
;
    _name.category_id             pd_calc_component
    _name.object_id               point_id
    _name.linked_item_id          '_pd_data.point_id'
    _type.purpose                 Link
    _type.source                  Assigned
    _type.container               Single
    _type.contents                Code

save_
jamesrhester commented 1 year ago

The information that is most important is _name.linked_item_id. The meaning of _type.purpose Link is given in the ddl dictionary.

The scope is the whole dataset, that is, all data blocks that form part of the data set. That is because data blocks are generally meant to be "invisible" when constructing the dictionary - except for deciding on the Set categories.

Generally all of the _diffractogram_id and _phase_id type data names should just have a _name.linked_item_id of _pd_diffractogram.id or _pd.phase.id respectively.

The whole _pd_data.point_id situation is a slightly hacky compromise to express that the pd_calc, pd_meas and pd_proc values can be tabulated together or apart. The view is taken that if _pd_data.point_id is missing, it can be reconstructed as the union of all points mentioned in the other three categories. It's probably better to study how _atom_site.label is used in cif_core to learn about linked data names.

rowlesmr commented 1 year ago

I think I have an understanding of it now.