<TEI xmlns="http://www.tei-c.org/ns/1.0">
  <teiHeader>
    <fileDesc>
      <titleStmt>
        <title type="main">TEI by Example</title>
        <title type="sub">Module 8: Customising TEI, ODD, Roma</title>
        <author xml:id="RvdB">Ron Van den Branden</author>
        <editor xml:id="EV">Edward Vanhoutte</editor>
        <editor xml:id="MT">Melissa Terras</editor>
        <sponsor>Association for Literary and Linguistic Computing (ALLC)</sponsor>
        <sponsor>Centre for Data, Culture and Society, University of Edinburgh, UK</sponsor> 
        <sponsor>Centre for Digital Humanities (CDH), University College London, UK</sponsor>
        <sponsor>Centre for Computing in the Humanities (CCH), King’s College London, UK</sponsor>
        <sponsor>Centre for Scholarly Editing and Document Studies (CTB) , Royal Academy of Dutch Language and Literature, Belgium</sponsor>
        <funder>
          <address>
            <addrLine>Centre for Scholarly Editing and Document Studies (CTB)</addrLine>
            <addrLine>Royal Academy of Dutch Language and Literature</addrLine>
            <addrLine>Koningstraat 18</addrLine>
            <addrLine>9000 Gent</addrLine>
            <addrLine>Belgium</addrLine>
          </address>
          <email>ctb@kantl.be</email>
        </funder>
        <principal>Edward Vanhoutte</principal>
        <principal>Melissa Terras</principal>
      </titleStmt>
      <publicationStmt>
        <publisher>Centre for Scholarly Editing and Document Studies (CTB) , Royal Academy of Dutch Language and Literature, Belgium</publisher>
        <distributor>Centre for Scholarly Editing and Document Studies (CTB) , Royal Academy of Dutch Language and Literature, Belgium</distributor>
        <pubPlace>Gent</pubPlace>
        <address>
          <addrLine>Centre for Scholarly Editing and Document Studies (CTB)</addrLine>
          <addrLine>Royal Academy of Dutch Language and Literature</addrLine>
          <addrLine>Koningstraat 18</addrLine>
          <addrLine>9000 Gent</addrLine>
          <addrLine>Belgium</addrLine>
        </address>
        <availability status="free">
          <p>Licensed under a <ref target="http://creativecommons.org/licenses/by-sa/3.0/">Creative Commons Attribution ShareAlike 3.0 License</ref>
                    </p>
        </availability>
        <date when="2010-07-09">9 July 2010</date>
      </publicationStmt>
      <seriesStmt>
        <title>TEI By Example.</title>
        <editor>Edward Vanhoutte</editor>
        <editor>Ron Van den Branden</editor>
        <editor>Melissa Terras</editor>
      </seriesStmt>
      <sourceDesc>
        <p>Digitally born</p>
      </sourceDesc>
    </fileDesc>
    <encodingDesc>
      <projectDesc>
        <p>TEI By Example offers a series of freely available online tutorials walking individuals through the different stages in marking up a document in TEI (Text Encoding Initiative). Besides a general introduction to text encoding, step-by-step tutorial modules provide example-based introductions to eight different aspects of electronic text markup for the humanities. Each tutorial module is accompanied with a dedicated examples section, illustrating actual TEI encoding practise with real-life examples. The theory of the tutorial modules can be tested in interactive tests and exercises.</p>
      </projectDesc>
    </encodingDesc>
    <profileDesc>
      <langUsage>
        <language ident="en-GB">en-GB</language>
      </langUsage>
    </profileDesc>
    <revisionDesc>
      <change when="2020-06-15" who="#RvdB">proofing corrections</change>
      <change when="2020-06-11" who="#RvdB">revision</change>
      <change when="2020-04-30" who="#RvdB">updated to Pure ODD + RomaJS</change>
      <change when="2010-07-13" who="#RvdB">
        <list>
          <item>added distinction <gi>gi</gi> — <tag>gi scheme="..."</tag> — <gi>tag</gi>
                    </item>
          <item>final spellcheck</item>
        </list>
      </change>
      <change when="2010-07-09" who="#RvdB">release</change>
      <change when="2008-11-05" who="#RvdB">
        <list>
          <item>updated to TEI P5-1.2.0 + Roma 3.5 (04/11/2008)</item>
          <item>corrected errors + typos</item>
        </list>
      </change>
      <change when="2008-08-21" who="#RvdB">
        <list>
          <item>corrected typos</item>
          <item>elaborated on didactic motivations for some choices in the tutorial</item>
        </list>
      </change>
      <change when="2008-08-19" who="#RvdB">replaced <title level="m">Alice’s Adventures Under Ground</title> example with <title level="m">Alice’s Adventures in Wonderland</title> due to copyright concerns with the images</change>
      <change when="2008-08-01" who="#RvdB">revisions</change>    
      <change when="2008-07-15" who="#RvdB">creation</change>
    </revisionDesc>
  </teiHeader>
  <text xml:id="TBED08v00" type="tutorials">
    <body>
            <div xml:id="summary">
        <head>Summary</head>
        <p>This tutorial started from a sample encoding project: the encoding of Lewis Carroll’s novel <title level="m">Alice’s Adventures in Wonderland</title>. An analysis of this mini-project’s needs identified following encoding goals:
          <list rend="bulleted">
            <item>Encoding of structural elements: the document, title page, document title, chapters, headings, (sub)divisions, paragraphs, quotations, citations, page breaks, figures, line groups.</item>
            <item>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.</item>
          </list>
        </p>
        <p>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 <ident type="file">TBEcustom</ident> customisation:
          <egXML xmlns="http://www.tei-c.org/ns/Examples">
            <TEI>
              <teiHeader>
                <fileDesc>
                  <titleStmt>
                    <title>A TBE Customisation</title>
                    <author>The TBE crew</author>
                  </titleStmt>
                  <publicationStmt>
                    <publisher>TEI Consortium</publisher>
                    <availability status="free">
                      <licence target="http://creativecommons.org/licenses/by-sa/3.0/"> Distributed under a
                        Creative Commons Attribution-ShareAlike 3.0 Unported License </licence>
                      <licence target="http://www.opensource.org/licenses/BSD-2-Clause">
                        <p>Copyright 2013 TEI 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>TEI material can be licensed differently depending on the use you intend to make of it.
                        Hence it is made available under both the CC+BY and BSD-2 licences. The CC+BY licence is
                        generally appropriate for usages which treat TEI content as data or documentation. The
                        BSD-2 licence is generally appropriate for usage of TEI content in a software
                        environment. For further information or clarification, please contact the <ref target="mailto:info@tei-c.org">TEI Consortium</ref>. </p>
                    </availability>
                  </publicationStmt>
                  <sourceDesc>
                    <p>Created from scratch by James Cummings, but looking at previous tei_minimal and tei_bare
                      exemplars by SPQR and LR.</p>
                  </sourceDesc>
                </fileDesc>
              </teiHeader>
              <text>
                <body>
                  <head>A Minimal TEI Customization</head>
                  
                  <p>This TEI ODD defines a TEI customization that is as minimal as possible and the schema
                    generated from it will validate a document that is minimally valid against the TEI scheme.
                    It includes only the ten required elements: <list rend="numbered">
                      <item>
                                                <gi>teiHeader</gi> from the header module to store required metadata</item>
                      <item>
                                                <gi>fileDesc</gi> from the header module to record information about this
                        file</item>
                      <item>
                                                <gi>titleStmt</gi> from the header module to record information about the
                        title</item>
                      <item>
                                                <gi>publicationStmt</gi> from the header module to detail how it is published</item>
                      <item>
                                                <gi>sourceDesc</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 titleStmt</item>
                      <item>
                                                <gi>TEI</gi> from the textstructure module because what is a TEI 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="TBEcustom" start="TEI" prefix="tei_" targetLang="en" docLang="en">
                    <moduleRef key="figures" include="figDesc figure"/>
                    <moduleRef key="header" include="teiHeader fileDesc titleStmt publicationStmt sourceDesc"/>
                    <moduleRef key="core" include="p title emph lg l pb pubPlace publisher q quote name graphic"/>
                    <moduleRef key="textstructure" include="TEI text body titlePage docTitle docImprint docDate docAuthor byline div"/>
                    <moduleRef key="tei"/>
                    <moduleRef key="namesdates" include="persName placeName"/>
                    <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="notAfter" mode="delete"/>
                        <attDef ident="notBefore" 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="nymRef" mode="delete"/>
                        <attDef ident="role" mode="delete"/>
                      </attList>
                    </elementSpec>
                    <classSpec ident="att.naming" type="atts" mode="change">
                      <attList>
                        <attDef ident="nymRef" mode="delete"/>
                        <attDef ident="ontStatus" 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="animalName" 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.persStateLike"/>
                        <memberOf key="model.nameLike.agent"/>
                        <memberOf key="att.datable"/>
                        <memberOf key="att.editLike"/>
                        <memberOf key="att.personal"/>
                        <memberOf key="att.typed"/>
                      </classes>
                      <content>
                        <macroRef key="macro.phraseSeq"/>
                      </content>
                    </elementSpec>
                  </schemaSpec>
                </body>
              </text>
            </TEI>
          </egXML>                    
        </p>
        <p>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 <ident type="ns">http://teibyexample.org/ns/TBE</ident> namespace is used to distinguish the added elements and attributes, and bound to the namespace prefix <soCalled>TBE</soCalled>):
          <egXML xmlns="http://www.tei-c.org/ns/Examples">
            <TEI 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="#mockTurtle">"Well, I never heard it before,"</q> said the <tbe:animalName tbe:ontStatus="fantastic">Mock Turtle</tbe:animalName>; <q who="#mockTurtle">"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="#mockTurtle">"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="#mockTurtle">"But about his toes?"</q> the <tbe:animalName tbe:ontStatus="fantastic">Mock Turtle</tbe:animalName> persisted. <q who="#mockTurtle">"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>                        
          </egXML>
        </p>
      </div>
        </body>
  </text>
  <!-- 
      $Date: 2020-11-16 12:33:38 +0100 (Mon, 16 Nov 2020) $
      $Id: TBED08v00.xml 460 2020-11-16 11:33:38Z ron.vandenbranden $  -->
</TEI>