1 05/15/80  mrds.cmdsm_source
 2 
 3 Function:  This describes the syntax of the source text for the create_mrds_dsm
 4 command that defines the makeup of a mrds database submodel.  The source
 5 segment must have the suffix .cmdsm on it.
 6 
 7 
 8 Syntax:
 9 The basic syntax of the submodel definition source is as follows:
10 
11 relation: submodel_rel_name1 { = model_rel_name1 }
12                     ( submodel_attr_name1 { = model_attr_name1 }
13                       submodel_attr_name2 { = model_attr_name2 }
14                               .
15                               .
16                       submodel_attr_nameN { = model_attr_nameN } ) {,
17           . . . . . . . . . . . ,
18           submodel_rel_nameN { = model_rel_nameN}
19                     ( submodel_attr_name1 { = model_attr_name1 }
20                               .
21                               .
22                       submodel_attr_nameN { = model_attr_nameN  }  )  }  ;
23 
24 default relation access: (relation_access_list) ;
25 
26 default attribute access: (attribute_access_list) ;
27 
28 relation access: submodel_rel_name1 (relation_access_list),
29                     .
30                     .
31                    submodel_rel_nameN (relation_access_list)
32                     with attribute access (attribute_access_list) ;
33 
34 attribute access: submodel_attr_name1 (attribute_access_list),
35                     .
36                     .
37                   submodel_attr_nameN in submodel_rel_nameI
38                     (attribute_access_list) ;
39 
40 
41 Semantics:
42 The purpose of the submodel view is to allow renaming, reordering, and
43 elimination of relations and attributes from the view as seen in the database
44 model.
45 
46 The submodel_name = model_name allows for this renaming convention, where
47 model_name refers to the name of the attribute or relation as it appears in the
48 database model, and the submodel_name is the proposed alias for this submodel.
49 
50 If not all attributes within a relation, or all relations in the model are
51 present, then a partial view of the model is seen from the submodel.
52 
53 Since the attribute and relation names can be given in any order, the submodel
54 defines its own order for the view it sees.
55 
56 If the { = model_name } option is not used, the submodel name will be that of
57 the model, and the submodel_names must then agree with the model relation or
58 attribute name they are meant to reference.
59 
60 Access control statements are optional.  They only have effect if the database
61 has been secured and the submodel is installed in the databases
62 secure.submodels directory.
63 
64 The relation_access_list may have access modes of append_tuple (append tuple,
65 or a), delete_tuple (delete tuple, or d), null or n.  The attribute_access_list
66 may have access modes of read_attr (read attr, or r), modify_attr (modify attr,
67 or m), or null or n.
68 
69 Default access statements refer to all relations or attributes in the submodel.
70 They may be overridden with an explicit relation or attribute access statement.
71 The "with" option of the relation access statement is a per relation default
72 attribute access mechanism that may also be overriden.  The "in" option of the
73 attribute access statement allows specifying access for an attribute within a
74 particular relation, rather than all attributes of that name.
75 
76 Default access is null for all relations, and read attr for all attributes.
77 
78 
79 Example:  If the model source looks like the following
80 
81      domain: code fixed bin, address char(20) ; relation: zip(code* address) ;
82 
83 and the submodel source looks as follows
84 
85      relation: zip_code = zip ( number = code ) ;
86 
87      attribute access: number in zip_code (modify attr) ;
88 
89 Then the meaning of the submodel definition is to first remove the attribute
90 address from the submodel view, second to rename the attribute code as number,
91 and finally to rename the relation zip as zip_code.
92 
93 If there had been no { = name } option for the relation name, then the relation
94 would have been known as zip, and that name would have to be used in the
95 submodel definition name for the relation.
96 
97 The overall access allowed for the user of this submodel in a secured database
98 is null on the relation zip_code, and read and modify operations on the
99 attribute number.