6 Special purpose linking attributes

6 Special purpose linking attributes

A number of special purpose linking attributes may be defined for every element in the TEI Lite DTD:

All of these attributes have declared values of either IDREF or IDREFS. If an <xptr> is required to carry one of the semantic roles listed above, it should be given an identifier which can then be specified as the value for the attribute concerned. For example, a linguistic analysis of the sentence ``John loves Mary'' might be encoded as follows:

<seg type=sentence ana=SVO>
  <seg type=lex ana=NP1>John</seg>
  <seg type=lex ana=VVI>loves</seg>
  <seg type=lex ana=NP1>Mary</seg>
This encoding implies the existence elsewhere in the document of elements with identifiers SVO, NP1, and VV1 where the significance of these particular codes is explained. Such elements might in fact be references to elements in some other document, as follows:
<xptr id=SVO doc=synSpec from=id(xsvo)>
<xptr id=NP1 doc="synSpec" from=id(xnp1)>
Here the implication is that there is an element in the external entity synSpec which carries an identifier xsvo and which provides the definition for the analysis concerned.

In the same way, the corresp (corresponding) attribute can be used to represent some form of correspondence between two elements within a document, or different documents. For example, in a multilingual text, it may be used to link translation equivalents, as in the following example

<seg lang=FRA id=FR001 corresp=EN001>Jean aime Marie</seg>
<seg lang=ENG id=EN001 corresp=FR001>John loves Mary</seg>

If, as is more likely, the French and English sentences are contained in two different documents, external pointers could be added to either document to refer to the other.

All the pointers so far discussed have been contextual, that is, one end of the link being represented is given by the location of the pointing element itself. The TEI also defines an independent linking pointer, (in HyTime terms, an ilink), represented by the <link> element. The targets attribute of this element specifies the identifiers of two or more other elements which are to be linked, in some way defined by its type attribute. For example, the translation equivalence expressed by means of the corresp attribute above could equally well be represented as follows:

<seg lang=FRA id=FR001>Jean aime Marie</seg>
<seg lang=ENG id=EN001>John loves Mary</seg>
<link type=translation targets="EN001 FR001">

This mechanism provides a convenient way of linking together sentences from different entities. Suppose that the English sentences are in an entity called ENtext and the French in one called FRtext. Since these are distinct SGML documents, we will use extended pointers to indicate each sentence, and express their alignment by means of an independent link:

<xptr id=EN1 doc=ENtext from=id(S1)>
<xptr id=FR1 doc=FRtext from=id(S1)>
<link type=translation targets="EN1 FR1">

A <link> element whose targets are pointers is defined as linking the targets of those pointers.

Groups of pointers of similar types can be identified using the <linkGrp> element: all the links within such a group inherit a type value from their parent.