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

View of /Sprout/AttributesDBD.xml

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.7 - (download) (as text) (annotate)
Mon Apr 30 00:31:56 2007 UTC (12 years, 7 months ago) by parrello
Branch: MAIN
CVS Tags: rast_rel_2008_06_18, rast_rel_2008_06_16, rast_rel_2008_04_23
Changes since 1.6: +14 -0 lines
Added a new index to keep MySQL from being so stupid.

<?xml version='1.0' standalone='yes'?>
<Database>
  <Title>Attributes Database</Title>
  <Entities>
    <Entity name="AttributeGroup" keyType="name-string">
      <Notes>A [i]group[/i] is a named set of attribute keys. An attribute key can belong to
      many groups or none at all.</Notes>
    </Entity>
    <Entity name="AttributeKey" keyType="name-string">
      <Notes>An [i]attribute key[/i] describes named values attached to a particular type of object.
      Each instance of this entity contains the attribute's description and its name. An attribute
      key name must consist of letters, numbers, periods, underscores, and hyphens.</Notes>
      <Fields>
        <Field name="description" type="text">
          <Notes>Text describing the attribute. This should explain what the attribute means and
          what kinds of values are appropriate.</Notes>
        </Field>
        <Field name="data-type" type="name-string">
          <Notes>ERDB data type for the attribute. This serves as documentation only, but
          that may change at some future point.</Notes>
        </Field>
      </Fields>
    </Entity>
    <Entity name="TargetObject" keyType="string">
      <Notes>An [i]object[/i] represents a keyed thing to which an attribute can be assigned.
      In order to improve performance, this table has no data in it. It is simply required by
      the semantics of the database.</Notes>
    </Entity>
  </Entities>
  <Relationships>
    <Relationship name="IsInGroup" from="AttributeKey" to="AttributeGroup" arity="MM">
      <Notes>This relationship connects an attribute key to the groups of which it is a member.</Notes>
    </Relationship>
    <Relationship name="HasValueFor" from="AttributeKey" to="TargetObject" arity="MM">
      <Notes>This relationship connects an attribute key to its objects. It contains the
      attribute values, and is therefore the primary data repository for the database.</Notes>
      <Fields>
        <Field name="subkey" type="string">
            <Notes>Some attribute keys are split into two parts. The real key is controlled and
            must correspond to a key in the AttributeKey table. The second part of the key
            resides in this field. When the attribute value is presented to the user, the two
            parts of the key are joined together around the splitter value.</Notes>
        </Field>
        <Field name="value" type="text">
          <Notes>This is the actual attribute value. Note that a single key/object pair may in fact
          have many values, and therefore many entries in this table.</Notes>
        </Field>
      </Fields>
      <FromIndex>
        <Notes>This index sorts all the values for a single attribute key by the subkey value.</Notes>
        <IndexFields>
            <IndexField name="subkey" order="ascending" />
        </IndexFields>
      </FromIndex>
      <ToIndex>
        <Notes>This index sorts all the values for an object by attribute key and the subkey.</Notes>
        <IndexFields>
            <IndexField name="from-link" order="ascending" />
            <IndexField name="subkey" order="ascending" />
        </IndexFields>
      </ToIndex>
      <Indexes>
        <Index>
            <Notes>This index allows searching for an attribute value by its prefix.</Notes>
            <IndexFields>
                <IndexField name="value" order="ascending" />
            </IndexFields>
        </Index>
        <Index>
            <Notes>This index allows searching for values within keys.</Notes>
            <IndexFields>
                <IndexField name="from-link" order="ascending" />
                <IndexField name="value" order="ascending" />
            </IndexFields>
        </Index>
        <Index>
            <Notes>This index sorts all the values for a single attribute key by the target object ID.</Notes>
            <IndexFields>
                <IndexField name="from-link" order="ascending" />
                <IndexField name="to-link" order="ascending" />
            </IndexFields>
        </Index>
      </Indexes>
    </Relationship>
  </Relationships>
</Database>

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3