COMCIFS / Powder_Dictionary

CIF definitions for powder diffraction
4 stars 4 forks source link

Do we need to change some dataitem's `_type.purpose` to `Link`? #67

Closed rowlesmr closed 1 year ago

rowlesmr commented 1 year ago

A little bit of a mind dump, trying to figure out what things should be Links:

PD_BLOCK's category key is _pd_block.id, which is of purpose Encode, as the value can be machine-parseable (although "not intended to be parsed"). I can handle this, as this is the base definition of this data item.

PD_BLOCK_DIFFRACTOGRAM's key is _pd_block_diffractogram.id which is of purpose Link, and is linked to _pd_block.id. I can grok this, as you're referring to another block so I think it should act as a foreign key, but:

(one of) PD_CALIB_STD's keys is _pd_calib_std.external_block_id which is of purpose Encode, but is described as "identifying the _pd_block.id used as an external standard". Should this be a link? As far as I can tell, this is acting in the same fashion as _pd_block_diffractogram.id

PD_PHASE_BLOCK has _pd_phase_block.id as it's key, which is just Encode, but described as a block ID code.

but categories can also contain things that look like foriegn keys that aren't category keys:

PD_PREF_ORIENT_MARCH_DOLLASE has _pd_pref_orient_March_Dollase.diffractogram_block_id & *.phase_block_id which are both Encode and described as a block ID code identifying the diffractogram\phase. Should these be Links?

.

In general, should instances of _category_name.something_block_id be Links to _pd_block.id? Should instances of _category_name.phase_id and .diffractogram.id be Links to _pd_phase.id and _pd_diffractogram.id? Or does it depend?

briantoby commented 1 year ago

I will make one explanation on calibration blocks. My thinking here was based on neutron and synchrotron work where one needs a wavelength and perhaps more (a spectrum for TOF for example) to make any sense of a dataset, so one might want (IMHO should have) a link to an external file with calibration dataset(s). HTH.

On Jan 6, 2023, at 2:43 AM, Matthew Rowles @.**@.>> wrote:

(one of) PD_CALIB_STD's keys is _pd_calib_std.external_block_id which is of purpose Encode, but is described as "identifying the _pd_block.idhttp://pd_block.id/ used as an external standard". Should this be a link? As far as I can tell, this is acting in the same fashion as _pd_block_diffractogram.idhttp://pd_block_diffractogram.id/

rowlesmr commented 1 year ago

I will make one explanation on calibration blocks. My thinking here was based on neutron and synchrotron work where one needs a wavelength and perhaps more (a spectrum for TOF for example) to make any sense of a dataset, so one might want (IMHO should have) a link to an external file with calibration dataset(s). HTH.

I agree exactly. I'm just trying to figure out the formal, DDLm way of how the dataitems should be defined in order to formalise the process of linking between/within blocks.

jamesrhester commented 1 year ago

PD_BLOCK_DIFFRACTOGRAM's key is _pd_block_diffractogram.id which is of purpose Link, and is linked to _pd_block.id. I can grok this, as you're referring to another block so I think it should act as a foreign key, but:

The reason it is a foreign key is that its value will be drawn from a value of _pd_block.id. Blocks are generally invisible to DDLm, except for the Set attribute, and thinking in terms of blocks and relational model simultaneously can be confusing.

(one of) PD_CALIB_STD's keys is _pd_calib_std.external_block_id which is of purpose Encode, but is described as "identifying the _pd_block.id used as an external standard". Should this be a link? As far as I can tell, this is acting in the same fashion as _pd_block_diffractogram.id

Yes, you are correct, it should be Link.

PD_PHASE_BLOCK has _pd_phase_block.id as it's key, which is just Encode, but described as a block ID code.

Yes, this should be Link if it points to a _pd_block.id, and _name.linked_item_id should be set appropriately.

but categories can also contain things that look like foriegn keys that aren't category keys:

PD_PREF_ORIENT_MARCH_DOLLASE has _pd_pref_orient_March_Dollase.diffractogram_block_id & *.phase_block_id which are both Encode and described as a block ID code identifying the diffractogram\phase. Should these be Links?

Yes they should.

In general, should instances of _category_name.something_block_id be Links to _pd_block.id? Should instances of _category_name.phase_id and .diffractogram.id be Links to _pd_phase.id and _pd_diffractogram.id? Or does it depend?

Yes they should in all cases, and _name.linked_item_id should be set as well.

rowlesmr commented 1 year ago

Roger. Right after I fix PD_BACKGROUND...