Span Relation Annotation¶
Span relations are a stand-off extension of relation annotation that allows for more complex relations, such as word alignments that include many-to-one, one-to-many or many-to-many alignments. One of its uses is in the alignment of multiple translations of (parts) of a text.
Specification¶
Annotation Category: | |
---|---|
Declaration: |
|
Version History: | |
since v0.8, renamed from complexalignment in v2.0 |
|
Element: |
|
API Class: |
|
Required Attributes: | |
Optional Attributes: | |
|
|
Accepted Data: |
|
Valid Context: |
|
Explanation & Examples¶
Please ensure you are familiar with Relation Annotation first, as this is an extension for that annotation type.
Note
In versions of FoLiA prior to 2.0, this annotation type was called complex alignments
Under span relations we count more complex relations such as many-to-one, one-to-many and many-to-many relations between
arbitrary elements. The element <spanrelation>
behaves similarly to a span annotation element, operating in a
stand-off fashion. This element groups <relation>
elements together, effectively creating a many-to-many relation.
The following example illustrates an example similar to the one above. All this takes place within the
<spanrelations>
annotation layer.
Consider the following example:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | <?xml version="1.0" encoding="utf-8"?> <FoLiA xmlns="http://ilk.uvt.nl/folia" xmlns:xlink="http://www.w3.org/1999/xlink" version="2.0" xml:id="example-english"> <metadata> <annotations> <token-annotation set="https://raw.githubusercontent.com/LanguageMachines/uctodata/master/setdefinitions/tokconfig-eng.foliaset.ttl"> <annotator processor="p1" /> </token-annotation> <text-annotation> <annotator processor="p1" /> </text-annotation> <sentence-annotation> <annotator processor="p1" /> </sentence-annotation> <relation-annotation set="ad-hoc-translation-set"> <annotator processor="p1" /> </relation-annotation> <spanrelation-annotation> <annotator processor="p1" /> </spanrelation-annotation> </annotations> <provenance> <processor xml:id="p1" name="proycon" type="manual" /> </provenance> </metadata> <text xml:id="example-english.text"> <s xml:id="example-english.p.1.s.1"> <t>The Dalai Lama greeted him.</t> <w xml:id="example-english.p.1.s.1.w.1"><t>The</t></w> <w xml:id="example-english.p.1.s.1.w.2"><t>Dalai</t></w> <w xml:id="example-english.p.1.s.1.w.3"><t>Lama</t></w> <w xml:id="example-english.p.1.s.1.w.4"><t>greeted</t></w> <w xml:id="example-english.p.1.s.1.w.5" space="no"><t>him</t></w> <w xml:id="example-english.p.1.s.1.w.6"><t>.</t></w> <spanrelations> <spanrelation> <relation class="original"> <xref id="example-english.p.1.s.1.w.2" t="Dalai" type="w"/> <xref id="example-english.p.1.s.1.w.3" t="Lama" type="w"/> </relation> <relation class="french" xlink:href="doc-french.xml" xlink:type="simple"> <xref id="example-french.p.1.s.1.w.2" t="Dalai" type="w"/> <xref id="example-french.p.1.s.1.w.3" t="Lama" type="w"/> </relation> </spanrelation> </spanrelations> </s> </text> </FoLiA> |
Here <xref>
is used instead of the <wref>
element we know from Span Annotation.
as despite similarities relations are technically not exactly span annotation elements. You can in
fact relate to anything that can carry an ID, within the same document and across
multiple documents. Moreover, the notion of relations is not limited to just
words, and it can be used for more than specifying translations.
The first <relation>
element has no xlink reference, and therefore
simply refers to the current document. The second relation element links to
the foreign document. This notation is powerful as it allows you to specify a
large number of relations in a concise matter. Consider the next example in
which we added German and Italian, effectively specifying what can be perceived
as 16 relationships over four different documents:
<s xml:id="example-english.p.1.s.1">
<t>The Dalai Lama greeted him.</t>
<w xml:id="example-english.p.1.s.1.w.1"><t>The</t></w>
<w xml:id="example-english.p.1.s.1.w.2"><t>Dalai</t></w>
<w xml:id="example-english.p.1.s.1.w.3"><t>Lama</t></w>
<w xml:id="example-english.p.1.s.1.w.4"><t>greeted</t></w>
<w xml:id="example-english.p.1.s.1.w.5"><t>him</t></w>
<w xml:id="example-english.p.1.s.1.w.6"><t>.</t></w>
<spanrelations>
<spanrelation>
<relation class="english-translation">
<xref id="example-english.p.1.s.1.w.2" t="Dalai" type="w"/>
<xref id="example-english.p.1.s.1.w.3" t="Lama" type="w"/>
</relation>
<relation class="french-translation"
xlink:href="doc-french.xml"
xlink:type="simple">
<xref id="example-french.p.1.s.1.w.2" t="Dalai" type="w"/>
<xref id="example-french.p.1.s.1.w.3" t="Lama" type="w"/>
</relation>
<relation class="german-translation"
xlink:href="doc-german.xml"
xlink:type="simple">
<xref id="example-german.p.1.s.1.w.2" t="Dalai" type="w"/>
<xref id="example-german.p.1.s.1.w.3" t="Lama" type="w"/>
</relation>
<relation class="italian-translation"
xlink:href="doc-italian.xml"
xlink:type="simple">
<xref id="example-italian.p.1.s.1.w.2" t="Dalai" type="w"/>
<xref id="example-italian.p.1.s.1.w.3" t="Lama" type="w"/>
</relation>
</spanrelation>
</spanrelations>
</s>
Now you can even envision a FoLiA document that does not hold actual content, but acts merely as a document containing all relations between for example different translations of the document. Allowing for all relations to be contained in a single document rather than having to be made explicit in each language version.
The <spanrelation>
element itself may also take a set, which is
independent from the alignment set. They therefore also have two separate
declarations.