Discussion List Archives

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

DDL2 parent-child question

  • Subject: DDL2 parent-child question
  • From: James Hester <jrh@xxxxxxxxxxxx>
  • Date: Tue, 19 Jul 2005 18:23:17 +0900
I have a question regarding the appropriate model to use when validating
a DDL2 dictionary against the DDL2 spec.  This question doesn't arise in
a file that doesn't contain save frames.

Consider the following bit of the DDL2 spec:
=================== 
save__category.id

    _item_description.description
;
     The identity of the data category. Data items may only be looped
     with items of the same category.
;
     loop_
    _item.name
    _item.category_id
    _item.mandatory_code
         '_category.id'                   category          yes
         '_category_examples.id'          category_examples implicit
         '_category_key.id'               category_key      implicit
         '_category_group.category_id'    category_group    implicit
         '_category_methods.category_id'  category_methods  implicit
         '_item.category_id'              item              implicit

   _item_type.code                        idname

    loop_
    _item_linked.child_name
    _item_linked.parent_name
         '_category_examples.id'          '_category.id'
         '_category_group.category_id'    '_category.id'
         '_category_key.id'               '_category.id'
         '_category_methods.category_id'  '_category.id'
         '_item.category_id'              '_category.id'
     save_
============
This means that _item.category_id is a child of _category.id.  Although
the DDL2 spec is unforthcoming on what requirements this might impose,
in DDL1 it means that (1) the parent must exist in the same data block
and (2) the child can only take values that the parent takes.

Now consider a dictionary file, with lots of save frames inside an
enclosing data block.  Some of those save frames have a _category.id
attribute, and some have an _item.category_id.  The only way I can see
to make sure that _item.category_id satisfies the parent-child
requirements is to go through the entire set of save frames, collect all
values of _category.id, and compare them to the value of
_item.category_id.  Note also that _category.id is a mandatory
attribute, rather than an implicit one, so can't be considered to be
magically present.

So my question is, is this the "official" way that such a validation
process should work?  That is, in some cases save frames should be
visible to one another?  Or is my mental model flawed?

James.

_______________________________________________
cif-developers mailing list
cif-developers@iucr.org
http://scripts.iucr.org/mailman/listinfo/cif-developers

Reply to: [list | sender only]
International Union of Crystallography

Scientific Union Member of the International Science Council (admitted 1947). Member of CODATA, the ISC Committee on Data. Partner with UNESCO, the United Nations Educational, Scientific and Cultural Organization in the International Year of Crystallography 2014.

International Science Council Scientific Freedom Policy

The IUCr observes the basic policy of non-discrimination and affirms the right and freedom of scientists to associate in international scientific activity without regard to such factors as ethnic origin, religion, citizenship, language, political stance, gender, sex or age, in accordance with the Statutes of the International Council for Science.