Reference Annotation

Structural annotation for referring to other annotation types. Used e.g. for referring to bibliography entries (citations) and footnotes.


Annotation Category:

Structure Annotation


<reference-annotation set="..."> (note: ``set`` is optional for this annotation type)

Version History:

Since v0.11, external references since v1.2



API Class:


Required Attributes:
Optional Attributes:
  • xml:id – The ID of the element; this has to be a unique in the entire document or collection of documents (corpus). All identifiers in FoLiA are of the XML NCName datatype, which roughly means it is a unique string that has to start with a letter (not a number or symbol), may contain numers, but may never contain colons or spaces. FoLiA does not define any naming convention for IDs.
  • set – The set of the element, ideally a URI linking to a set definition (see Set Definitions (Vocabulary)) or otherwise a uniquely identifying string. The set must be referred to also in the Annotation Declarations for this annotation type.
  • class – The class of the annotation, i.e. the annotation tag in the vocabulary defined by set.
  • processor – This refers to the ID of a processor in the Provenance Data. The processor in turn defines exactly who or what was the annotator of the annotation.
  • annotator – This is an older alternative to the processor attribute, without support for full provenance. The annotator attribute simply refers to the name o ID of the system or human annotator that made the annotation.
  • annotatortype – This is an older alternative to the processor attribute, without support for full provenance. It is used together with annotator and specific the type of the annotator, either manual for human annotators or auto for automated systems.
  • confidence – A floating point value between zero and one; expresses the confidence the annotator places in his annotation.
  • datetime – The date and time when this annotation was recorded, the format is YYYY-MM-DDThh:mm:ss (note the literal T in the middle to separate date from time), as per the XSD Datetime data type.
  • n – A number in a sequence, corresponding to a number in the original document, for example chapter numbers, section numbers, list item numbers. This this not have to be an actual number but other sequence identifiers are also possible (think alphanumeric characters or roman numerals).
  • space – This attribute indicates whether spacing should be inserted after this element (it’s default value is always yes, so it does not need to be specified in that case), but if tokens or other structural elements are glued together then the value should be set to no. This allows for reconstruction of the detokenised original text.
  • src – Points to a file or full URL of a sound or video file. This attribute is inheritable.
  • begintime – A timestamp in HH:MM:SS.MMM format, indicating the begin time of the speech. If a sound clip is specified (src); the timestamp refers to a location in the soundclip.
  • endtime – A timestamp in HH:MM:SS.MMM format, indicating the end time of the speech. If a sound clip is specified (src); the timestamp refers to a location in the soundclip.
  • speaker – A string identifying the speaker. This attribute is inheritable. Multiple speakers are not allowed, simply do not specify a speaker on a certain level if you are unable to link the speech to a specific (single) speaker.
  • xlink:href – Turns this element into a hyperlink to the specified URL
  • xlink:type – The type of link (you’ll want to use simple in almost all cases).
Accepted Data:

<alt> (Alternative Annotation), <altlayers> (Alternative Annotation), <comment> (Comment Annotation), <correction> (Correction Annotation), <desc> (Description Annotation), <hiddenw> (Hidden Token Annotation), <br> (Linebreak), <metric> (Metric Annotation), <p> (Paragraph Annotation), <part> (Part Annotation), <ph> (Phonetic Annotation/Content), <quote> (Quote Annotation), <relation> (Relation Annotation), <s> (Sentence Annotation), <str> (String Annotation), <t> (Text Annotation), <utt> (Utterance Annotation), <whitespace> (Whitespace), <w> (Token Annotation)

Valid Context:

<def> (Definition Annotation), <div> (Division Annotation), <event> (Event Annotation), <ex> (Example Annotation), <head> (Head Annotation), <hiddenw> (Hidden Token Annotation), <list> (List Annotation), <note> (Note Annotation), <p> (Paragraph Annotation), <quote> (Quote Annotation), <s> (Sentence Annotation), <term> (Term Annotation), <utt> (Utterance Annotation), <w> (Token Annotation)

Extra Attributes:
  • id – The ID of the element to link to
  • type (optional) – The type of the element that is being linked to (e.g. note)

Explanation & Examples

FoLiA allows for things like footnotes and bibliography entry using Note Annotation. In this section we show that you can make references to these notes using the <ref> element, this is a structure element, which implies that the references are explicitly present in the text. The <ref> element, however, carries an extra higher-order annotation function:

  <t>We demonstrated this earlier.</t>
<ref id="mynote" />

Another example in tokenised data, and now we add the optional type attribute, which holds the type of the FoLiA element that is referred to:

  <ref id="mynote" type="note" />

You can optionally make explicit the symbol used for the reference. When no textual content is provided, whatever program renders the FoLiA document may assign its own numbering or symbol.

  <t>We demonstrated this earlier.</t>
<ref id="mynote" type="note"><t>1</t></ref>

This is often needed for bibliographical references:

  <t>We demonstrated this earlier.</t>
<ref id="bib.1" type="note"><t>(van Gompel et al, 2014)</t></ref>

As a structure element, the <ref> element may contain other structure elements such as words (Token Annotation) or even sentences (Sentence Annotation) or paragraphs (Paragraph Annotation), which can in turn contain further linguistic annotations.

Although we framed this section in the context of notes, the <ref> element is more general and can be used whereever you need to explicitly refer to other structure elements. Common targets are figures, tables, divisions (sections, chapters, etc).

Being a structure element, the note reference itself may carry an ID as well. Note that the ID attribute without the xml namespace always indicates a reference in FoLiA:

<s><t>We demonstrated this earlier.</t></s>
<ref xml:id="myreference" id="mynote" />

The difference between the reference element and the higher-order relations (Relation Annotation) needs to be clearly understood. Relation annotation lays relations between annotations of any kind and thus pertain strongly to linguistic annotation, whereas this reference element is a structural element that is explicitly shown in the text and draws a reference that is explicitly reflected in the text.

External references can also be made with the <ref> element, which effectively makes it a valid tool for hyperlinking. This is done by setting the xlink:href to point to the external resource and by setting the format attribute to the format of the external resource. The format is understood to be a MIME type and its value defaults to text/folia+xml. When an external reference is made, the id attribute is optional and points to an element inside the external resource.

  <ref xlink:href="http://somewhere" xlink:type="simple"
    format="text/html" id="section2">

This method of hyperlinking can be contrasted to the one described in Hyperlinks. The <ref> element offers a highly semantic way of hyperlinking, whereas the other method is more of a text-markup or stylistic nature.

<?xml version="1.0" encoding="utf-8"?>
<FoLiA xmlns="" xmlns:xlink="" version="2.0" xml:id="example">
			 <annotator processor="p1" />
          <note-annotation set="">
			 <annotator processor="p1" />
			 <annotator processor="p1" />
			 <annotator processor="p1" />
			 <annotator processor="p1" />
			 <annotator processor="p1" />
         <processor xml:id="p1" name="proycon" type="manual" />
  <text xml:id="example.text">
      <p xml:id="example.p.1">
        <s xml:id="example.p.1.s.1">
          <t>We demonstrated this earlier.</t>
        <ref xml:id="example.ref.1" id="example.note.1" />
      <note xml:id="example.note.1" class="footnote">
            <t>See our website.</t>
        <ref xml:id="example.ref.2" xlink:href="" xlink:type="simple" format="text/html" />