[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.9, Wed Jul 2 04:56:16 2008 UTC revision 1.11, Mon Jan 19 21:46:21 2009 UTC
# Line 1  Line 1 
 <?xml version='1.0' standalone='yes'?>  
1  <Database>  <Database>
2    <Title>Attributes Database</Title>    <Title>Attributes Database</Title>
3        <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>
4    <Entities>    <Entities>
5      <Entity name="AttributeGroup" keyType="name-string">          <Entity name="AttributeGroup" keyType="string">
6        <Notes>A _group_ is a named set of attribute keys. An attribute key can belong to              <DisplayInfo theme="seed" col="3" row="1" caption="Attribute Group" />
7        many groups or none at all.</Notes>              <Notes>A group is a named set of attribute keys. An attribute key
8                can belong to many groups or none at all.</Notes>
9                <Asides>Groups provide a useful mechanism for classifying certain
10                types of attribute keys. An attribute key's group membership is
11                updated using a table of checkboxes in the attribute web interface.
12                The interface also allows new groups to be created. There is a group
13                for attributes that are only used for %FIG{ProteinEncodingGroups}%
14                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        <Notes>An _attribute key_ describes named values attached to a particular type of object.              <DisplayInfo theme="seed" col="3" row="3" caption="Attribute Key" />
20        Each instance of this entity contains the attribute's description and its name. An attribute              <Notes>An attribute key describes named values attached to a
21        key name must consist of letters, numbers, periods, underscores, and hyphens.</Notes>              particular type of object. Each instance of this entity contains the
22                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="data-type" type="name-string">                  </Field>
31            <Notes>ERDB data type for the attribute. This serves as documentation only, but                  <Field name="relationship-name" type="string">
32            that may change at some future point.</Notes>                      <Notes>Name of the relationship containing the attribute
33                        data. This relationship must look exactly like HasValueFor.
34                        The only difference is the table name.</Notes>
35                        <Asides>In order to improve performance of batch updates,
36                        some attributes are stored in private relationship tables.
37                        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        <Notes>An _object_ represents a keyed thing to which an attribute can be assigned.              <DisplayInfo theme="neutral" col="3" row="5" caption="Target Object" />
46        In order to improve performance, this table has no data in it. It is simply required by              <Notes>An object represents a keyed thing to which an attribute can
47        the semantics of the database.</Notes>              be assigned. In order to improve performance, this table has no data
48      </Entity>              in it. It is simply required by the semantics of the
49      <Entity name="EvidenceClass" keyType="name-string">              database.</Notes>
       <Notes>An _evidence class_ describes a general type of evidence code. An actual evidence  
       code consists of its class (e.g. =dlit=, =ff=) and an optional modifier. The modifier  
       is contained in the relationship between the class and the target object.</Notes>  
       <Fields>  
         <Field name="format" type="string">  
           <Notes>The format string is an example showing how the modifier portion of the  
           evidence code is formatted.  It may contain HTML markup.</Notes>  
         </Field>  
         <Field name="short-description" type="string">  
           <Notes>The short description is a brief noun phrase explanation of the evidence class.</Notes>  
         </Field>  
         <Field name="description" type="text">  
           <Notes>The description is a long text description of the evidence class and its  
           format string.</Notes>  
         </Field>  
       </Fields>  
50      </Entity>      </Entity>
51    </Entities>    </Entities>
52    <Relationships>    <Relationships>
53      <Relationship name="IsEvidencedBy" from="TargetObject" to="EvidenceClass" arity="MM">          <Relationship name="IsEvidencedBy" to="TargetObject" from="AttributeKey" arity="MM" converse="HasEvidence">
54        <Notes>This relationship connects a feature (target object) to its evidence.</Notes>              <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
56                evidence attributes.</Notes>
57                <Asides>This table exists to separate evidence codes from other
58                attributes for performance reasons. Evidence codes are built from
59                scratch several times a week. Erasing an entire table is faster than
60                erasing individual rows, so putting the evidence codes in their own
61                private table provides significant benefits.</Asides>
62        <Fields>        <Fields>
63          <Field name="modifier" type="string">                  <Field name="subkey" type="string">
64            <Notes>The modifier contains ancillary information about the evidence, including                      <Notes>Some attribute keys are split into two parts. The
65            counts for clustering codes, pubmed IDs for literature codes, and so forth.                      real key is controlled and must correspond to a key in the
66            The modifier contains its own punctuation, and the full code is computed by                      AttributeKey table. The second part of the key resides in
67            concatenating the modifier directly to the evidence class.</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>
71                    <Field name="value" type="text">
72                        <Notes>This is the actual attribute value. Note that a
73                        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>
78                    <Notes>This index sorts all the values for a single attribute
79                    key by the subkey value.</Notes>
80                    <IndexFields>
81                        <IndexField name="subkey" order="ascending" />
82                    </IndexFields>
83                </FromIndex>
84                <ToIndex>
85                    <Notes>This index sorts all the values for an object by
86                    attribute key and the subkey.</Notes>
87                    <IndexFields>
88                        <IndexField name="from-link" order="ascending" />
89                        <IndexField name="subkey" order="ascending" />
90                    </IndexFields>
91                </ToIndex>
92                <Indexes>
93                    <Index>
94                        <Notes>This index allows searching for an attribute value by
95                        its prefix.</Notes>
96                        <IndexFields>
97                            <IndexField name="value" order="ascending" />
98                        </IndexFields>
99                    </Index>
100                    <Index>
101                        <Notes>This index allows searching for values within
102                        keys.</Notes>
103                        <IndexFields>
104                            <IndexField name="from-link" order="ascending" />
105                            <IndexField name="value" order="ascending" />
106                        </IndexFields>
107                    </Index>
108                    <Index>
109                        <Notes>This index sorts all the values for a single
110                        attribute key by the target object ID.</Notes>
111                        <IndexFields>
112                            <IndexField name="from-link" order="ascending" />
113                            <IndexField name="to-link" order="ascending" />
114                        </IndexFields>
115                    </Index>
116                </Indexes>
117      </Relationship>      </Relationship>
118      <Relationship name="IsInGroup" from="AttributeKey" to="AttributeGroup" arity="MM">      <Relationship name="IsInGroup" from="AttributeKey" to="AttributeGroup" arity="MM">
119        <Notes>This relationship connects an attribute key to the groups of which it is a member.</Notes>              <DisplayInfo theme="seed" caption="Is\nGroup\nOf" />
120                <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">          <Relationship name="HasValueFor" from="AttributeKey" to="TargetObject" arity="MM" converse="HasValueOf">
124        <Notes>This relationship connects an attribute key to its objects. It contains the              <DisplayInfo theme="seed" col="2.5" row="4" fixed="1" caption="Has\nValue\nFor" />
125        attribute values, and is therefore the primary data repository for the database.</Notes>              <Notes>This relationship connects an attribute key to its objects.
126                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 90  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 112  Line 182 
182        </Indexes>        </Indexes>
183      </Relationship>      </Relationship>
184    </Relationships>    </Relationships>
185        <Shapes></Shapes>
186  </Database>  </Database>

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3