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

Annotation of /Sprout/AttributesDBD.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.10 - (view) (download) (as text)

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

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3