.. _input: Prepare your TEI document ================================================== The TEI standard allows for multiple ways to encode the same textual features. For example, you can use the tag :code:``, the tag :code:``, or even the tag :code:`` to markup a personal name (cf. |TEI Guidelines, 13. Names, Dates, People, and Places|). This TEI feature has the advantage of flexibility, but it makes creating a universal TEI-to-RDF transformation script a difficult task. This is why this documentation includes a set of encoding guidelines designed to ensure a smooth TEI-to-RDF transformation via LIFT. In particular, in order for LIFT to work on your TEI document, you must adhere to the following simple guidelines: 1. :ref:`xmlid` 2. :ref:`teiheader` 3. :ref:`person` 4. :ref:`place` 5. :ref:`sameas` 6. :ref:`relation` 7. :ref:`event` .. _xmlid: Provide TEI elements with unique identifiers using :code:`@xml:id` -------------------------------------------------------------------------------- A unique URI must be assigned to each entity of a linked data graph (for example, a person, a place, a literary work, etc.). LIFT uses :code:`@xml:id` attributes to create unique URIs. To accomplish this, LIFT concatenates the value of the attribute :code:`@xml:base` attribute of the :code:`` element is concatenated with the value of the :code:`@xml:id` attribute of the element. For example, the element below representing a person .. code-block:: xml ... ... ... will be assigned the following URI: .. code-block:: xml Note that the value of your @xml:base attribute should be registered as a permanent URL (i.e. through services such as `w3id.org `_). Check the |W3C Permanent Identifier Community Group| for more information on how to register your URL. If your TEI document lacks unique identifiers, you can use Charlotte Tupman's |XSLT transformation stylesheet| (written for |SAWS|), which generates a unique identifier for each element that has no :code:`@xml:id`. You can run the transformation using `xsltproc `_ after downloading the stylesheet to the same folder as your TEI document. You can look at this `tutorial `_ for detailed instructions about the process (last accessed 2021-10-25). .. _teiheader: Provide an at least minimal TEI header ----------------------------------------------------------------------------------------- Your TEI header should comprise, at least, the minimal recommended elements as shown below: .. code-block:: xml <!-- Title of the resource -->

.. _person: Use :code:`` and :code:`` to represent persons and in-text references to such persons ------------------------------------------------------------------------------------------------------------------- Each person mentioned in the TEI document must be described in the TEI header within a :code:`` element to which an :code:`@xml:id` has been assigned. It is possible to provide a normalized form of each person's name by nesting a :code:`` element containing the normalized name within :code:``. You can provide multiple normalizations, e.g. in different languages (to specify the language use the :code:`@xml:lang` attribute and a value from the |ISO 639 list| of language codes). All in-text occurrences of personal names must be encoded using :code:``. The attribute :code:`@ref` should be used on the element to relate each name to the corresponding person (via the person's :code:`@xml:id`). For example: .. code-block:: xml ... Socrates Σωκρᾰ́της ... ... Socrates ... Persons can be grouped using :code:``. Each :code:`` (or, alternatively, each :code:`` element if :code:`` is not present) can be assigned a :code:`@type` and/or :code:`@corresp` containing a short description of the group or individual. In particular, use :code:`@type` for free-text descriptions (if using multi-word descriptions, please separate each word with an hyphen) or :code:`@corresp` to provide a URI from a controlled vocabulary. For example: .. code-block:: xml ... .. _place: Use :code:`` and :code:`` to represent places and in-text references to such places ------------------------------------------------------------------------------------------------------------------- The guidelines for encoding persons apply to places as well. For example: .. code-block:: xml ... Athens ... ... Athens ...
.. _sameas: Assign a :code:`@sameAs` attribute to real-world entities ----------------------------------------------------------------------------------------- By assigning a @sameAs attribute to your entities, you can disambiguate them by connecting them to external authority files, such as |VIAF|, |Worldcat|, or the |Library of Congress|. Provide a URI in a :code:`@sameAs` attribute. You can supply multiple URIs, separated by a whitespace. For example: .. code-block:: xml .. _relation: Encode relationships between persons within :code:`` ----------------------------------------------------------------------------------------- Use a series of :code:`` elements nested within :code:`` to markup relationships between persons in the TEI header. Note that :code:`` must be a child element of :code:``. In particular, for unidirectional relationships (e.g. 'Socrates has student Plato') use the attributes :code:`@active` and :code:`@passive` to express the subject and the object of the relationship respectively; for bidirectional relationships (e.g. 'Plato has colleague Xenophon') use the attribute :code:`@mutual`. It is possible to represent a mutual relationship involving multiple persons by declaring more than one value for the :code:`@mutual` attribute. Multiple values must be separated by whitespaces. Finally, use the :code:`@name` attribute to express the nature of the relationship. You can reuse terms from |AgRelOn|, the Agent Relationship Ontology. For example: .. code-block:: xml .. _event: Use :code:`` to represent events, either within :code:`` or :code:`` ------------------------------------------------------------------------------------------ It is possible to describe events that occur in relation to a specific person or place. Such descriptions should be nested within the corresponding or elements. The element :code:`` contains the description of the event. The attributes :code:`@type` and :code:`@corresp` can be assigned to :code:`` to provide a free-text label or a URI, respectively. The date of the event must be recorded in :code:`@when` or :code:`@from/@to` attributes. Dates should be represented according to the |ISO 8601| standard. A :code:` .. bibliographic references (upcoming) .. critical apparatus (upcoming) Full example -------------------------------------- You can download a TEI XML pseudo-edition featuring all of the examples presented above from |this link|. .. All links .. |TEI Guidelines, 13. Names, Dates, People, and Places| raw:: html TEI Guidelines, 13. Names, Dates, People, and Places .. |SAWS| raw:: html SAWS project .. |XSLT transformation stylesheet| raw:: html this XSLT transformation .. |W3C Permanent Identifier Community Group| raw:: html W3C Permanent Identifier Community Group .. |ISO 639 list| raw:: html ISO 639 list .. |VIAF| raw:: html VIAF .. |Worldcat| raw:: html Worldcat .. |Library of Congress| raw:: html Library of Congress .. |sameas.org| raw:: html sameas.org .. |this link| raw:: html this link .. |AgRelOn| raw:: html AgRelOn .. |ISO 8601| raw:: html ISO 8601