The primary value element

Primary values are closely related to primary keys, but have an informal linguistic meaning. An example is city name. In general the name of a city identifies a city exactly. This however is not strictly true. For example the city "Springfield" is ambiguous while "Chicago" is not. The following example captures this for geo:

    <table id="City" lex="city,cities,town,towns">
        <column id="name" type="text" lex="name,names,named,called"/>
        <column id="state" type="text" lex="where,located in"/>
        <column id="population" type="int" lex="population,populations,..."/>

        <primary_key key="name,state"/>
        <primary_value key="name"/>

The DTD of primary values is almost exactly the same as that for primary keys but only one attribute can be a primary value:

<!ATTLIST primary_value
          key CDATA #REQUIRED
          description CDATA #IMPLIED>

key is the identifier of a single column in the table.

It you would like to make a sets of columns (e.g. first and last names) together form primary values then create a virtual attribute of the pair (e.g. name) and make that a primary value.

There are cases where you may be tempted to use primary values to let users reference records directly by their value, but there are many records of that value. For example you might put primary value around the column type a table Worker so that you can ask 'give me the contractors'. In this case you could put the property +value-stands-for-table on that column and not use the primary value element.