Module 8: Customising TEI, ODD, Roma

7. Summary

This tutorial started from a sample encoding project: the encoding of Lewis Carroll’s novel Alice’s Adventures in Wonderland. An analysis of this mini-project’s needs identified following encoding goals:

  • Encoding of structural elements: the document, title page, document title, chapters, headings, (sub)divisions, paragraphs, quotations, citations, page breaks, figures, line groups.
  • Encoding of names for persons, places and animals in the story, with an additional requirement for an experimental analysis of the ontological status of their referents.

Throughout this tutorial, a TEI customisation was developed step-by-step from which TEI schemas can be generated that fit these needs. After selection of relevant TEI modules and elements, selection of element-specific and attribute class attributes, and the addition of new elements and attributes, this is the final version of the ODD file for our TBEcustom customisation:

<TEI xmlns="http://www.tei-c.org/ns/1.0">
<teiHeader>
<fileDesc>
<titleStmt>
<title>A T​BE Customisation</title>
<author>The T​BE crew</author>
</titleStmt>
<publicationStmt>
<publisher>T​EI Consortium</publisher>
<availability status="free">
<licence target="http​://creativecommons​.org​/licenses​/by​-sa​/3.0/"> Distributed under a Creative Commons Attribution​-Share​Alike 3​.0 Unported License </licence>
<licence target="http​://www​.opensource​.org​/licenses​/BSD-2-Clause">
<p>Copyright 2013 T​EI Consortium.</p>
<p>All rights reserved.</p>
<p>Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:</p>
<list>
<item>Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.</item>
<item>Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and​/or other materials provided with the distribution.</item>
</list>
<p>This software is provided by the copyright holders and contributors "as is" and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall the copyright holder or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.</p>
</licence>
<p>T​EI material can be licensed differently depending on the use you intend to make of it. Hence it is made available under both the C​C+BY and B​SD-2 licences. The C​C+BY licence is generally appropriate for usages which treat T​EI content as data or documentation. The B​SD-2 licence is generally appropriate for usage of T​EI content in a software environment. For further information or clarification, please contact the
<ref target="mailto​:info​@tei​-c.org">T​EI Consortium</ref>
. </p>
</availability>
</publicationStmt>
<sourceDesc>
<p>Created from scratch by James Cummings, but looking at previous tei​_minimal and tei​_bare exemplars by S​PQR and LR.</p>
</sourceDesc>
</fileDesc>
</teiHeader>
<text>
<body>
<head>A Minimal T​EI Customization</head>
<p>This T​EI O​DD defines a T​EI customization that is as minimal as possible and the schema generated from it will validate a document that is minimally valid against the T​EI scheme. It includes only the ten required elements:
<list rend="numbered">
<item>
<gi>tei​Header</gi>
from the header module to store required metadata</item>
<item>
<gi>file​Desc</gi>
from the header module to record information about this file</item>
<item>
<gi>title​Stmt</gi>
from the header module to record information about the title</item>
<item>
<gi>publication​Stmt</gi>
from the header module to detail how it is published</item>
<item>
<gi>source​Desc</gi>
from the header module to record where it is from</item>
<item>
<gi>p</gi>
from the core module for use in the header and the body</item>
<item>
<gi>title</gi>
from the core module for use in the title​Stmt</item>
<item>
<gi>T​EI</gi>
from the textstructure module because what is a T​EI file without that?</item>
<item>
<gi>text</gi>
from the textstructure module to hold some text</item>
<item>
<gi>body</gi>
from the textstructure module as a place to put that text</item>
</list>
</p>
<schemaSpec ident="T​BEcustom" start="T​EI" prefix="tei_" targetLang="en" docLang="en">
<moduleRef key="figures" include="fig​Desc figure"/>
<moduleRef key="header" include="tei​Header file​Desc title​Stmt publication​Stmt source​Desc"/>
<moduleRef key="core" include="p title emph lg l pb pub​Place publisher q quote name graphic"/>
<moduleRef key="textstructure" include="T​EI text body title​Page doc​Title doc​Imprint doc​Date doc​Author byline div"/>
<moduleRef key="tei"/>
<moduleRef key="namesdates" include="pers​Name place​Name"/>
<elementSpec ident="name" mode="change">
<attList>
<attDef ident="type" mode="change">
<valList type="closed" mode="change">
<valItem mode="add" ident="place">
<desc versionDate="2020​-04​-23" xml:lang="en">used for place names</desc>
</valItem>
<valItem mode="add" ident="person">
<desc versionDate="2020​-04​-23" xml:lang="en">used for person names</desc>
</valItem>
<valItem mode="add" ident="animal">
<desc versionDate="2020​-04​-23" xml:lang="en">used for animal names</desc>
</valItem>
</valList>
</attDef>
<attDef ident="subtype" mode="delete"/>
<attDef ident="calendar" mode="delete"/>
<attDef ident="cert" mode="delete"/>
<attDef ident="evidence" mode="delete"/>
<attDef ident="from" mode="delete"/>
<attDef ident="full" mode="delete"/>
<attDef ident="instant" mode="delete"/>
<attDef ident="not​After" mode="delete"/>
<attDef ident="not​Before" mode="delete"/>
<attDef ident="period" mode="delete"/>
<attDef ident="resp" mode="delete"/>
<attDef ident="sort" mode="delete"/>
<attDef ident="source" mode="delete"/>
<attDef ident="to" mode="delete"/>
<attDef ident="when" mode="delete"/>
<attDef ident="nym​Ref" mode="delete"/>
<attDef ident="role" mode="delete"/>
</attList>
</elementSpec>
<classSpec ident="att​.naming" type="atts" mode="change">
<attList>
<attDef ident="nym​Ref" mode="delete"/>
<attDef ident="ont​Status" mode="change" usage="opt" ns="http​://teibyexample​.org​/ns​/TBE">
<desc versionDate="2020​-04​-28" xml:lang="en">describes the ontological status of a name​'s referent</desc>
<datatype>
<dataRef key="teidata​.enumerated"/>
</datatype>
<valList mode="change">
<valItem mode="add" ident="realistic">
<desc versionDate="2020​-04​-28" xml:lang="en">the referent can / could occur in the extra​-textual reality</desc>
</valItem>
<valItem mode="add" ident="mythological">
<desc versionDate="2020​-04​-28" xml:lang="en">the referent does not exist in real life, but belongs to a major mythology</desc>
</valItem>
<valItem mode="add" ident="fantastic">
<desc versionDate="2020​-04​-28" xml:lang="en">the referent can / could occur in the extra​-textual reality</desc>
</valItem>
</valList>
</attDef>
</attList>
</classSpec>
<elementSpec ident="animal​Name" ns="http​://teibyexample​.org​/ns​/TBE" mode="add" module="namesdates">
<desc>contains a proper noun referring to an animal</desc>
<classes>
<memberOf key="att​.global"/>
<memberOf key="model​.pers​State​Like"/>
<memberOf key="model​.name​Like​.agent"/>
<memberOf key="att​.datable"/>
<memberOf key="att​.edit​Like"/>
<memberOf key="att​.personal"/>
<memberOf key="att​.typed"/>
</classes>
<content>
<macroRef key="macro​.phrase​Seq"/>
</content>
</elementSpec>
</schemaSpec>
</body>
</text>
</TEI>

This ODD file allows the generation of a TEI schema for the encoding of the document. The following example illustrates how the encoding could make use of the features defined in the ODD file (notice how the http://teibyexample.org/ns/TBE namespace is used to distinguish the added elements and attributes, and bound to the namespace prefix “TBE”):

<TEI xmlns="http://www.tei-c.org/ns/1.0" xmlns:tbe="http://teibyexample.org/ns/TBE">
<teiHeader>
<!-- ... -->
</teiHeader>
<text>
<body>
<!-- ... -->
<div type="chapter">
<!-- ... -->
<pb n="157"/>
<figure>
<graphic url="images​/lobster​.jpg"/>
<figDesc>The lobster sugaring its hair.</figDesc>
</figure>
<p>
<q who="#alice">"How the creatures order one about, and make one repeat lessons!"</q>
thought
<persName tbe:ontStatus="realistic">Alice</persName>
,
<q who="#alice">"I might just as well be at school at once."</q>
However, she got up, and began to repeat it, but her head was so full of the
<title type="song">
<tbe:animalName tbe:ontStatus="realistic">Lobster</tbe:animalName>
-Quadrille</title>
, that she hardly knew what she was saying, and the words came very queer indeed:—</p>
<q rend="blockquote" who="#alice">
<lg>
<l>"'Tis the voice of the
<tbe:animalName tbe:ontStatus="realistic">lobster</tbe:animalName>
; I heard him declare,</l>
<l>
<q who="#lobster">'You have baked me too brown, I must sugar my hair.'</q>
</l>
<l>As a duck with its eyelids, so he with his nose</l>
<l>Trims his belt and his buttons, and turns out his toes."</l>
</lg>
</q>
<p>
<q who="#gryphon">"That​'s different from what
<emph>I</emph>
used to say when I was a child,"</q>
said the
<tbe:animalName tbe:ontStatus="mythological">Gryphon</tbe:animalName>
.</p>
<pb n="158"/>
<p>
<q who="#mock​Turtle">"Well, I never heard it before,"</q>
said the
<tbe:animalName tbe:ontStatus="fantastic">Mock Turtle</tbe:animalName>
;
<q who="#mock​Turtle">"but it sounds uncommon nonsense."</q>
</p>
<p>
<persName tbe:ontStatus="realistic">Alice</persName>
said nothing; she had sat down with her face in her hands, wondering if anything would
<emph>ever</emph>
happen in a natural way again.</p>
<p>
<q who="#mock​Turtle">"I should like to have it explained,"</q>
said the
<tbe:animalName tbe:ontStatus="fantastic">Mock Turtle</tbe:animalName>
.</p>
<p>
<q who="#gryphon">"She can​'t explain it,"</q>
said the
<tbe:animalName tbe:ontStatus="mythological">Gryphon</tbe:animalName>
hastily.
<q who="#gryphon">"Go on with the next verse."</q>
</p>
<p>
<q who="#mock​Turtle">"But about his toes?"</q>
the
<tbe:animalName tbe:ontStatus="fantastic">Mock Turtle</tbe:animalName>
persisted.
<q who="#mock​Turtle">"How
<emph>could</emph>
he turn them out with his nose, you know?"</q>
</p>
<p>
<q who="#aliceI">"It​'s the first position in dancing."</q>
<persName tbe:ontStatus="realistic">Alice</persName>
said; but she was dreadfully puzzled by the whole thing, and longed to change the subject.</p>
<p>
<q who="#gryphon">"Go on with the next verse,"</q>
the
<tbe:animalName tbe:ontStatus="mythological">Gryphon</tbe:animalName>
repeated impatiently:
<q who="#gryphon">"it begins
<quote>'I passed by his garden.'</quote>
"</q>
</p>
<p>
<persName tbe:ontStatus="realistic">Alice</persName>
did not dare to disobey, though she felt sure it would all come wrong, and she went on in a trembling voice:—</p>
<pb n="159"/>
<!-- ... -->
</div>
<!-- ... -->
</body>
</text>
</TEI>