[Bio] / Sprout / AttributesDBD.xml Repository:
ViewVC logotype

Diff of /Sprout/AttributesDBD.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.10, Tue Aug 12 06:06:02 2008 UTC revision 1.11, Mon Jan 19 21:46:21 2009 UTC
# Line 1  Line 1 
1  <Database>  <Database>
2    <Title>Attributes Database</Title>    <Title>Attributes Database</Title>
3    <Notes>The Attributes Database allows applications to upload and retrieve      <Notes>The Attributes Database allows applications to upload and retrieve custom data for NMPDR data objects. It uses the ERDB database system (which is also used by the [[SproutDatabase]] and the [[SaplingDatabase]]) to store the attributes. Attributes differ from conventional data in that they are unstructured: new attributes can be added without modifying the database design. A single attribute database services the entire NMPDR complex. %BR%%BR% Attributes are organized by _attribute key_. Attribute values are assigned to _objects_. In the real world, objects have types and IDs; however, to the attribute database only the ID matters. In general, it is possible to determine the object type from the format of the ID, but it doesn't matter to the database. %BR%%BR% The actual attribute values are stored as a relationship between the attribute keys and the objects. There can be multiple values for a single key/object pair.</Notes>
 custom data for NMPDR data objects. It uses the ERDB database system (which  
 is also used by the [[SproutDatabase]] and the [[SaplingDatabase]]) to  
 store the attributes. Attributes differ from conventional data in that they  
 are unstructured: new attributes can be added without modifying the database  
 design. A single attribute database services the entire NMPDR complex.  
 %BR%%BR%  
 Attributes are organized by _attribute key_. Attribute values are  
 assigned to _objects_. In the real world, objects have types and IDs;  
 however, to the attribute database only the ID matters. In general, it  
 is possible to determine the object type from the format of the ID, but  
 it doesn't matter to the database.  
 %BR%%BR%  
 The actual attribute values are stored as a relationship between the attribute  
 keys and the objects. There can be multiple values for a single key/object pair.  
   
 </Notes>  
4    <Entities>    <Entities>
5      <Entity name="AttributeGroup" keyType="name-string">          <Entity name="AttributeGroup" keyType="string">
6        <DisplayInfo theme="seed" col="3" row="1" caption="Attribute Group" />        <DisplayInfo theme="seed" col="3" row="1" caption="Attribute Group" />
7        <Notes>A group is a named set of attribute keys. An attribute key can belong to              <Notes>A group is a named set of attribute keys. An attribute key
8        many groups or none at all.</Notes>              can belong to many groups or none at all.</Notes>
9        <Asides>Groups provide a useful mechanism for classifying certain types of attribute              <Asides>Groups provide a useful mechanism for classifying certain
10        keys. An attribute key's group membership is updated using a table of checkboxes              types of attribute keys. An attribute key's group membership is
11        in the attribute web interface. The interface also allows new groups to be created.              updated using a table of checkboxes in the attribute web interface.
12        There is a group for attributes that are only used for %FIG{ProteinEncodingGroups}%              The interface also allows new groups to be created. There is a group
13        and another for attributes that require NMPDR support. Groups can also be used              for attributes that are only used for %FIG{ProteinEncodingGroups}%
14        to specify attribute key white lists for individual applications.</Asides>              and another for attributes that require NMPDR support. Groups can
15                also be used to specify attribute key white lists for individual
16                applications.</Asides>
17      </Entity>      </Entity>
18      <Entity name="AttributeKey" keyType="name-string">          <Entity name="AttributeKey" keyType="string">
19        <DisplayInfo theme="seed" col="3" row="3" caption="Attribute Key" />        <DisplayInfo theme="seed" col="3" row="3" caption="Attribute Key" />
20        <Notes>An attribute key describes named values attached to a particular type of object.              <Notes>An attribute key describes named values attached to a
21        Each instance of this entity contains the attribute's description and its name. An attribute              particular type of object. Each instance of this entity contains the
22        key name must consist of letters, numbers, periods, underscores, and/or hyphens.</Notes>              attribute's description and its name. An attribute key name must
23                consist of letters, numbers, periods, underscores, and/or
24                hyphens.</Notes>
25        <Fields>        <Fields>
26          <Field name="description" type="text">          <Field name="description" type="text">
27            <Notes>Text describing the attribute. This should explain what the attribute means and                      <Notes>Text describing the attribute. This should explain
28            what kinds of values are appropriate.</Notes>                      what the attribute means and what kinds of values are
29          </Field>                      appropriate.</Notes>
30          <Field name="relationship-name" type="name-string">                  </Field>
31            <Notes>Name of the relationship containing the attribute data. This relationship                  <Field name="relationship-name" type="string">
32            must look exactly like HasValueFor. The only difference is the table name.</Notes>                      <Notes>Name of the relationship containing the attribute
33            <Asides>In order to improve performance of batch updates, some attributes                      data. This relationship must look exactly like HasValueFor.
34            are stored in private relationship tables. When retrieving attributes, we need                      The only difference is the table name.</Notes>
35            to check each attribute key's private table for the data. The tables have                      <Asides>In order to improve performance of batch updates,
36            the same structure as HasValueFor. They are separated solely for performance                      some attributes are stored in private relationship tables.
37            reasons.</Asides>                      When retrieving attributes, we need to check each attribute
38                        key's private table for the data. The tables have the same
39                        structure as HasValueFor. They are separated solely for
40                        performance reasons.</Asides>
41          </Field>          </Field>
42        </Fields>        </Fields>
43      </Entity>      </Entity>
44      <Entity name="TargetObject" keyType="string">      <Entity name="TargetObject" keyType="string">
45        <DisplayInfo theme="neutral" col="3" row="5" caption="Target Object" />        <DisplayInfo theme="neutral" col="3" row="5" caption="Target Object" />
46        <Notes>An object represents a keyed thing to which an attribute can be assigned.              <Notes>An object represents a keyed thing to which an attribute can
47        In order to improve performance, this table has no data in it. It is simply required by              be assigned. In order to improve performance, this table has no data
48        the semantics of the database.</Notes>              in it. It is simply required by the semantics of the
49                database.</Notes>
50      </Entity>      </Entity>
51    </Entities>    </Entities>
52    <Relationships>    <Relationships>
53      <Relationship name="IsEvidencedBy" to="TargetObject" from="AttributeKey" arity="MM" converse="HasEvidence">      <Relationship name="IsEvidencedBy" to="TargetObject" from="AttributeKey" arity="MM" converse="HasEvidence">
54        <DisplayInfo theme="seed" col="3.5" row="4" fixed="1" caption="Is\nEvidenced\nBy" />        <DisplayInfo theme="seed" col="3.5" row="4" fixed="1" caption="Is\nEvidenced\nBy" />
55        <Notes>This relationship connects a feature (target object) to its evidence              <Notes>This relationship connects a feature (target object) to its
56        attributes.</Notes>              evidence attributes.</Notes>
57        <Asides>This table exists to separate evidence codes from other attributes for              <Asides>This table exists to separate evidence codes from other
58        performance reasons. Evidence codes are built from scratch several times a week.              attributes for performance reasons. Evidence codes are built from
59        Erasing an entire table is faster than erasing individual rows, so putting the              scratch several times a week. Erasing an entire table is faster than
60        evidence codes in their own private table provides significant benefits.</Asides>              erasing individual rows, so putting the evidence codes in their own
61                private table provides significant benefits.</Asides>
62        <Fields>        <Fields>
63          <Field name="subkey" type="string">          <Field name="subkey" type="string">
64              <Notes>Some attribute keys are split into two parts. The real key is controlled and                      <Notes>Some attribute keys are split into two parts. The
65              must correspond to a key in the AttributeKey table. The second part of the key                      real key is controlled and must correspond to a key in the
66              resides in this field. When the attribute value is presented to the user, the two                      AttributeKey table. The second part of the key resides in
67              parts of the key are joined together around the splitter value.</Notes>                      this field. When the attribute value is presented to the
68                        user, the two parts of the key are joined together around
69                        the splitter value.</Notes>
70          </Field>          </Field>
71          <Field name="value" type="text">          <Field name="value" type="text">
72            <Notes>This is the actual attribute value. Note that a single key/object pair may in fact                      <Notes>This is the actual attribute value. Note that a
73            have many values, and therefore many entries in this table.</Notes>                      single key/object pair may in fact have many values, and
74                        therefore many entries in this table.</Notes>
75          </Field>          </Field>
76        </Fields>        </Fields>
77        <FromIndex>        <FromIndex>
78          <Notes>This index sorts all the values for a single attribute key by the subkey value.</Notes>                  <Notes>This index sorts all the values for a single attribute
79                    key by the subkey value.</Notes>
80          <IndexFields>          <IndexFields>
81              <IndexField name="subkey" order="ascending" />              <IndexField name="subkey" order="ascending" />
82          </IndexFields>          </IndexFields>
83        </FromIndex>        </FromIndex>
84        <ToIndex>        <ToIndex>
85          <Notes>This index sorts all the values for an object by attribute key and the subkey.</Notes>                  <Notes>This index sorts all the values for an object by
86                    attribute key and the subkey.</Notes>
87          <IndexFields>          <IndexFields>
88              <IndexField name="from-link" order="ascending" />              <IndexField name="from-link" order="ascending" />
89              <IndexField name="subkey" order="ascending" />              <IndexField name="subkey" order="ascending" />
# Line 93  Line 91 
91        </ToIndex>        </ToIndex>
92        <Indexes>        <Indexes>
93          <Index>          <Index>
94              <Notes>This index allows searching for an attribute value by its prefix.</Notes>                      <Notes>This index allows searching for an attribute value by
95                        its prefix.</Notes>
96              <IndexFields>              <IndexFields>
97                  <IndexField name="value" order="ascending" />                  <IndexField name="value" order="ascending" />
98              </IndexFields>              </IndexFields>
99          </Index>          </Index>
100          <Index>          <Index>
101              <Notes>This index allows searching for values within keys.</Notes>                      <Notes>This index allows searching for values within
102                        keys.</Notes>
103              <IndexFields>              <IndexFields>
104                  <IndexField name="from-link" order="ascending" />                  <IndexField name="from-link" order="ascending" />
105                  <IndexField name="value" order="ascending" />                  <IndexField name="value" order="ascending" />
106              </IndexFields>              </IndexFields>
107          </Index>          </Index>
108          <Index>          <Index>
109              <Notes>This index sorts all the values for a single attribute key by the target object ID.</Notes>                      <Notes>This index sorts all the values for a single
110                        attribute key by the target object ID.</Notes>
111              <IndexFields>              <IndexFields>
112                  <IndexField name="from-link" order="ascending" />                  <IndexField name="from-link" order="ascending" />
113                  <IndexField name="to-link" order="ascending" />                  <IndexField name="to-link" order="ascending" />
# Line 116  Line 117 
117      </Relationship>      </Relationship>
118      <Relationship name="IsInGroup" from="AttributeKey" to="AttributeGroup" arity="MM">      <Relationship name="IsInGroup" from="AttributeKey" to="AttributeGroup" arity="MM">
119        <DisplayInfo theme="seed" caption="Is\nGroup\nOf" />        <DisplayInfo theme="seed" caption="Is\nGroup\nOf" />
120        <Notes>This relationship connects an attribute key to the groups of which it is a member.</Notes>              <Notes>This relationship connects an attribute key to the groups of
121                which it is a member.</Notes>
122      </Relationship>      </Relationship>
123      <Relationship name="HasValueFor" from="AttributeKey" to="TargetObject" arity="MM" converse="HasValueOf">      <Relationship name="HasValueFor" from="AttributeKey" to="TargetObject" arity="MM" converse="HasValueOf">
124        <DisplayInfo theme="seed" col="2.5" row="4" fixed="1" caption="Has\nValue\nFor" />        <DisplayInfo theme="seed" col="2.5" row="4" fixed="1" caption="Has\nValue\nFor" />
125        <Notes>This relationship connects an attribute key to its objects. It contains the              <Notes>This relationship connects an attribute key to its objects.
126        attribute values, and is therefore the primary data repository for the database.</Notes>              It contains the attribute values, and is therefore the primary data
127                repository for the database.</Notes>
128        <Fields>        <Fields>
129          <Field name="subkey" type="string">          <Field name="subkey" type="string">
130              <Notes>Some attribute keys are split into two parts. The real key is controlled and                      <Notes>Some attribute keys are split into two parts. The
131              must correspond to a key in the AttributeKey table. The second part of the key                      real key is controlled and must correspond to a key in the
132              resides in this field. When the attribute value is presented to the user, the two                      AttributeKey table. The second part of the key resides in
133              parts of the key are joined together around the splitter value.</Notes>                      this field. When the attribute value is presented to the
134                        user, the two parts of the key are joined together around
135                        the splitter value.</Notes>
136          </Field>          </Field>
137          <Field name="value" type="text">          <Field name="value" type="text">
138            <Notes>This is the actual attribute value. Note that a single key/object pair may in fact                      <Notes>This is the actual attribute value. Note that a
139            have many values, and therefore many entries in this table.</Notes>                      single key/object pair may in fact have many values, and
140                        therefore many entries in this table.</Notes>
141          </Field>          </Field>
142        </Fields>        </Fields>
143        <FromIndex>        <FromIndex>
144          <Notes>This index sorts all the values for a single attribute key by the subkey value.</Notes>                  <Notes>This index sorts all the values for a single attribute
145                    key by the subkey value.</Notes>
146          <IndexFields>          <IndexFields>
147              <IndexField name="subkey" order="ascending" />              <IndexField name="subkey" order="ascending" />
148          </IndexFields>          </IndexFields>
149        </FromIndex>        </FromIndex>
150        <ToIndex>        <ToIndex>
151          <Notes>This index sorts all the values for an object by attribute key and the subkey.</Notes>                  <Notes>This index sorts all the values for an object by
152                    attribute key and the subkey.</Notes>
153          <IndexFields>          <IndexFields>
154              <IndexField name="from-link" order="ascending" />              <IndexField name="from-link" order="ascending" />
155              <IndexField name="subkey" order="ascending" />              <IndexField name="subkey" order="ascending" />
# Line 149  Line 157 
157        </ToIndex>        </ToIndex>
158        <Indexes>        <Indexes>
159          <Index>          <Index>
160              <Notes>This index allows searching for an attribute value by its prefix.</Notes>                      <Notes>This index allows searching for an attribute value by
161                        its prefix.</Notes>
162              <IndexFields>              <IndexFields>
163                  <IndexField name="value" order="ascending" />                  <IndexField name="value" order="ascending" />
164              </IndexFields>              </IndexFields>
165          </Index>          </Index>
166          <Index>          <Index>
167              <Notes>This index allows searching for values within keys.</Notes>                      <Notes>This index allows searching for values within
168                        keys.</Notes>
169              <IndexFields>              <IndexFields>
170                  <IndexField name="from-link" order="ascending" />                  <IndexField name="from-link" order="ascending" />
171                  <IndexField name="value" order="ascending" />                  <IndexField name="value" order="ascending" />
172              </IndexFields>              </IndexFields>
173          </Index>          </Index>
174          <Index>          <Index>
175              <Notes>This index sorts all the values for a single attribute key by the target object ID.</Notes>                      <Notes>This index sorts all the values for a single
176                        attribute key by the target object ID.</Notes>
177              <IndexFields>              <IndexFields>
178                  <IndexField name="from-link" order="ascending" />                  <IndexField name="from-link" order="ascending" />
179                  <IndexField name="to-link" order="ascending" />                  <IndexField name="to-link" order="ascending" />
# Line 171  Line 182 
182        </Indexes>        </Indexes>
183      </Relationship>      </Relationship>
184    </Relationships>    </Relationships>
185    <Shapes>      <Shapes></Shapes>
   </Shapes>  
186  </Database>  </Database>

Legend:
Removed from v.1.10  
changed lines
  Added in v.1.11

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3