2011-09-20
Abstract
teian is a standalone, web-based annotator for texts in XML format. It works by directly annotating the respective XML file or fragment. The end user does not have to know the XML markup, but just choose the text to annotate, and select an annotator.
teian can be easily extended in order to use new XML annotators
Table of Contents
teian is a standalone, web-based annotator for texts in XML.
It runs in all major modern browsers: Opera, Firefox, Google Chrome, Safari, and Internet Explorer (8+).
Note | |
---|---|
These dependencies have to be installed in the same folder as teian. They are archived by default in the teian package. |
Create a base folder and copy within it the teian folder and all dependecies from the teian package.
Access page http://server-name:port/url-to-teian-base-folder/core/teian.html and add a doc-url parameter to the address, having as value the URL of the XML document to annotate.
Example 1. Example of access URL for teian:
http://localhost/teian/core/teian.html?doc-url=http://localhost/data/01.xml
Each XML element to be used for annotation has to be defined as follows:
in $TEIAN_HOME/config/annotator-specifications.xml file, according to its type (see below the detailed description of annotators' types).
in $TEIAN_HOME/config/lang/language-abbreviation.xml file(s), according to the needs for localization of teian .
in $TEIAN_HOME/config/css/elements.css file(s), according to presentation desired for each XML element.
in $TEIAN_HOME/core/teian.html file(s), as child of kyer:menu element, according to the way desired for rendering the annotator in the page's toolbar (button, drop-down menu, etc.). This kyer:menu element is an implementation in kyer of this element.
The annotators are defined in $TEIAN_HOME/config/annotator-specifications.xml file.
The localization is defined in $TEIAN_HOME/config/lang/en.xml , or other file, according to choosen language - for examples of usage, see below.
One has to provide for each annotator an unique id (@id), a name (@name), which is the corresponding XML element name, and a type code (@type-code), which is the type of the respective annotator.
In order to provide an annotated XML document that is conformant to its schema, one has to provide for each annotator the name of the parent and preceding sibling XML elements (annotator-possible-parent-element-names and annotator-possible-preceding-sibling-element-names).
Also, for each annotator has to be provided the description of each attribute of the respective XML element (if any), according to examples, and the name for annotator's icon (this is the icon that will appear on toolbar; the respective file should be located into $TEIAN_HOME/config/images folder).
In case when the annotator has as UI a dialog panel, the respective panel and its tabs has to be defined according to the examples below.
Principially speaking, this web-annotator allows user, by means of an panel (for certain annotators), to attach desired strings to the respective XML element's attributes. For this, each panel has text fields and/or lists, having their values as result of a query to a server or not; each text field/list is thus attached to an XML element's attribute and its content can be validated against a regular expression contained by annotator-panel-field-validation-regex element.
The labels for each text fiels/list are defined in the respective language file.
Note that the annotators of "selected-wrap-server" type have a common panel definition, which is entered separately into annotator-specifications.xml file.
The annotators' localization definitions have to closely follow the annotator definition, namely to have the same id (@id). Also, one has to define the text that will appear when user hovers over the annotator's button (toolbar-button-title).
Annotator of "insert" type. This type of annotator includes the XML elements that are simply inserted into text.
Example of annotator definition:
<teian:annotator id="lb-annotator" name="lb" type-code="insert"> <teian:annotator-description-text> Insert a line break at the insertion point. Only for inside p and div tags. </teian:annotator-description-text> <teian:annotator-possible-parent-element-names> cl m phr s span w abbr add addrLine address author bibl biblScope cit corr date del distinct editor email emph expan foreign gloss head headItem headLabel hi imprint item l label lg list listBibl measure mentioned name note num orig p pubPlace publisher q quote ref reg resp rs said series sic soCalled sp speaker stage street term time title unclear activity channel constitution derivation domain factuality interaction locale preparedness purpose case colloc def dictScrap entry entryFree etym form gen gram gramGrp hom hyph iType lang lbl mood number orth per pos pron re sense stress subc syll tns usg xr actor camera caption castGroup castItem castList epilogue performance prologue role roleDesc set sound tech view cell figure table authority change classCode creation distributor edition extent funder geoDecl handNote language principal scriptNote sponsor typeNote ab seg accMat acquisition additions catchwords collation colophon condition custEvent decoNote explicit filiation finalRubric foliation heraldry incipit layout material msItem musicNotation objectType origDate origPlace origin provenance rubric secFol signatures source stamp summary support surrogates textLang watermark addName affiliation age birth bloc country death district education faith floruit forename genName geogName langKnown nameLink nationality occupation orgName persName person placeName region residence roleName settlement sex socecStatus surname graph u writing valDesc app lem rdg wit witDetail argument back body byline closer dateline div div1 div2 div3 div4 div5 div6 div7 docAuthor docDate docEdition docImprint docTitle epigraph floatingText front group imprimatur opener postscript salute signed text titlePage titlePart trailer damage fw restore supplied surplus metSym rhyme </teian:annotator-possible-parent-element-names> <teian:annotator-possible-preceding-sibling-element-names/> <teian:annotator-attribute/> <teian:annotator-icon-name>lineBreak.gif</teian:annotator-icon-name> </teian:annotator>
Example of annotator localization:
<teian:annotator id="lb-annotator"> <teian:toolbar-button-title>Insert a line break</teian:toolbar-button-title> <teian:toolbar-button-label>lb</teian:toolbar-button-label> </teian:annotator>
Annotator of "insert-parametrized" type. This type of annotator is similar to "insert" type annotators, with the difference that the corresponding XML element has attributes, which are the annotator's parameters; these parameters can be set in a dialog panel.
Example of annotator definition:
<teian:annotator id="pb-annotator" name="pb" type-code="insert-parametrized"> <teian:annotator-description-text> Insert a page break at the insertion point. Only for inside p and div tags. Note that page breaks can have three attributes. </teian:annotator-description-text> <teian:annotator-possible-parent-element-names> cl m phr s span w abbr add addrLine address author bibl biblScope cit corr date del distinct editor email emph expan foreign gloss head headItem headLabel hi imprint item l label lg list listBibl measure mentioned name note num orig p pubPlace publisher q quote ref reg resp rs said series sic soCalled sp speaker stage street term time title unclear activity channel constitution derivation domain factuality interaction locale preparedness purpose case colloc def dictScrap entry entryFree etym form gen gram gramGrp hom hyph iType lang lbl mood number orth per pos pron re sense stress subc syll tns usg xr actor camera caption castGroup castItem castList epilogue performance prologue role roleDesc set sound tech view cell figure table authority change classCode creation distributor edition extent funder geoDecl handNote language principal scriptNote sponsor typeNote ab seg accMat acquisition additions catchwords collation colophon condition custEvent decoNote explicit filiation finalRubric foliation heraldry incipit layout material msItem musicNotation objectType origDate origPlace origin provenance rubric secFol signatures source stamp summary support surrogates textLang watermark addName affiliation age birth bloc country death district education faith floruit forename genName geogName langKnown nameLink nationality occupation orgName persName person placeName region residence roleName settlement sex socecStatus surname graph u writing valDesc app lem rdg wit witDetail argument back body byline closer dateline div div1 div2 div3 div4 div5 div6 div7 docAuthor docDate docEdition docImprint docTitle epigraph floatingText front group imprimatur opener postscript salute signed text titlePage titlePart trailer damage fw restore supplied surplus metSym rhyme </teian:annotator-possible-parent-element-names> <teian:annotator-possible-preceding-sibling-element-names/> <teian:annotator-icon-name>pageBreak.gif</teian:annotator-icon-name> <teian:annotator-attribute>n</teian:annotator-attribute> <teian:annotator-attribute>xml:id</teian:annotator-attribute> <teian:annotator-attribute>facs</teian:annotator-attribute> <teian:annotator-panel> </teian:annotator-panel> </teian:annotator>
Example of annotator localization:
<teian:annotator id="lb-annotator"> <teian:toolbar-button-title>Insert a page break</teian:toolbar-button-title> <teian:toolbar-button-label>pb</teian:toolbar-button-label> </teian:annotator>
Annotator of "selected-wrap" type. This type of annotator is used for the XML elements needed for styling (bold, italic, etc.).
Example of annotator definition:
<teian:annotator id="strong-annotator" name="hi" type-code="selected-wrap"> <teian:annotator-description-text> Wrap bold tags around the selected text. </teian:annotator-description-text> <teian:annotator-possible-parent-element-names> cl phr s w abbr add addrLine author bibl biblScope corr date del distinct editor email emph expan foreign gloss head headItem headLabel hi item l label measure mentioned name note num orig p pubPlace publisher q quote ref reg rs said sic soCalled speaker stage street term time title unclear case colloc def dictScrap entryFree etym form gen gram gramGrp hyph iType lang lbl mood number orth per pos pron re sense stress subc syll tns usg xr actor camera caption castItem role roleDesc sound tech view cell distributor edition extent geoDecl handNote scriptNote typeNote ab seg accMat acquisition additions catchwords collation colophon condition custEvent decoNote explicit filiation finalRubric foliation heraldry incipit layout material musicNotation objectType origDate origPlace origin provenance rubric secFol signatures source stamp summary support surrogates textLang watermark addName affiliation birth bloc country death district education faith floruit forename genName geogName nameLink nationality occupation orgName persName placeName region residence roleName settlement sex socecStatus surname u writing lem rdg wit witDetail byline closer dateline docAuthor docDate docEdition docImprint imprimatur opener salute signed titlePart trailer damage fw restore supplied surplus rhyme </teian:annotator-possible-parent-element-names> <teian:annotator-possible-preceding-sibling-element-names/> <teian:annotator-icon-name>bold.gif</teian:annotator-icon-name> <teian:annotator-attribute name="rend" value="strong"/> </teian:annotator>
Example of annotator localization:
<teian:annotator id="lb-annotator"> <teian:toolbar-button-title>Insert strong style</teian:toolbar-button-title> <teian:toolbar-button-label> <b>B</b> </teian:toolbar-button-label> </teian:annotator>
Annotator of "selected-wrap-parameterized" type. This type of annotator is similar to "selected-wrap" type annotators, with the difference that the corresponding XML element has attributes, which are the annotator's parameters; these parameters can be set in a dialog panel.
Example of annotator definition:
<teian:annotator id="date-annotator" name="date" type-code="selected-wrap-parameterized"> <teian:annotator-description-text>Wrap date tags around the selected text and display the date selector panel.</teian:annotator-description-text> <teian:annotator-icon-name>calendar.png</teian:annotator-icon-name> <teian:annotator-possible-parent-element-names> cl phr s w abbr add addrLine author bibl biblScope corr date del distinct editor email emph expan foreign gloss head headItem headLabel hi item l label measure mentioned name note num orig p pubPlace publisher q quote ref reg rs said sic soCalled speaker stage street term time title unclear case colloc def dictScrap entryFree etym form gen gram gramGrp hyph iType lang lbl mood number orth per pos pron re sense stress subc syll tns usg xr actor camera caption castItem role roleDesc sound tech view cell distributor edition extent geoDecl handNote scriptNote typeNote ab seg accMat acquisition additions catchwords collation colophon condition custEvent decoNote explicit filiation finalRubric foliation heraldry incipit layout material musicNotation objectType origDate origPlace origin provenance rubric secFol signatures source stamp summary support surrogates textLang watermark addName affiliation birth bloc country death district education faith floruit forename genName geogName nameLink nationality occupation orgName persName placeName region residence roleName settlement sex socecStatus surname u writing lem rdg wit witDetail byline closer dateline docAuthor docDate docEdition docImprint imprimatur opener salute signed titlePart trailer damage fw restore supplied surplus rhyme </teian:annotator-possible-parent-element-names> <teian:annotator-possible-preceding-sibling-element-names/> <teian:annotator-attribute name="when" value=""/> <teian:annotator-panel> <div id="date-dialog" title=""> <label for="teian-date-when" ref="simpath:instance('ui-lang')//teian:annotator[@id = 'date-annotator']/teian:annotator-panel/teian:annotator-panel-element[@id = 'date-when-label']"/> <input type="text" id="teian-date-when"/> </div> <script type="text/javascript" charset="utf-8"> $("#date-dialog").attr('title', $x.xpath("simpath:instance('ui-lang')//teian:annotator[@id = 'date-annotator']/teian:annotator-panel/teian:annotator-panel-title/text()")); $("label[for='teian-date-when']").text($($x.xpath($("label[for='teian-date-when']").attr('ref'))[0]).text()); teian.ui['date-annotator'] = $("#date-dialog").dialog({ autoOpen: false, width : 700, height : 200, modal : true, buttons: { "Save": function() { $( this ).dialog( "close" ); $($("#date-annotator")[0]['oAnnotatorMarkup']).attr('when', $("#teian-date-when").val()); teian.annotator[0]($("#date-annotator")[0]); $($("#date-annotator")[0]['oAnnotatorMarkup']).attr('when', ''); $("#teian-date-when").val(''); }, "Cancel": function() { $( this ).dialog( "close" ); teian.utils.oSavedSelection = null; $("#teian-date-when").val(''); } } }); </script> </teian:annotator-panel> </teian:annotator>
Example of annotator localization:
<teian:annotator id="lb-annotator"> <teian:toolbar-button-title>Date</teian:toolbar-button-title> <teian:toolbar-button-label>date</teian:toolbar-button-label> <teian:annotator-panel> <teian:annotator-panel-title>Enter date in format YYYY-MM-DD</teian:annotator-panel-title> <teian:annotator-panel-element id="date-when-label">Enter date: </teian:annotator-panel-element> </teian:annotator-panel> </teian:annotator>
Note | |
---|---|
Note: Each annotator should have a definition of the dialog panel's content, contained by annotator-panel element. |
Annotator of "selected-wrap-server" type. This type of annotator is similar to "selected-wrap-parameterized" type annotators, with the difference that the values of the corresponding XML elements' attributes are set based upon the response to a query sent to a server.
Example of annotator definition:
<teian:annotator id="persName-annotator" name="persName" type-code="selected-wrap-server"> <teian:annotator-description-text>Wrap the person tags around the selected text and display the person selection panel.</teian:annotator-description-text> <teian:annotator-icon-name>person.png</teian:annotator-icon-name> <teian:annotator-id-service-uri>http://demoedb.richmond.edu/exist/rest/db/urbml/apps/tei/utils/teian/services/suggest.xql?type=people&word=</teian:annotator-id-service-uri> <teian:annotator-possible-parent-element-names> cl phr s span abbr add addrLine address author bibl biblScope corr date del desc distinct editor email emph expan foreign gloss head headItem headLabel hi item l label measure meeting mentioned name note num orig p pubPlace publisher q quote ref reg resp respStmt rs said sic soCalled speaker stage street term time title unclear activity channel constitution derivation domain factuality interaction locale preparedness purpose setting case colloc def dictScrap entryFree etym form gen gram gramGrp hyph iType lang lbl mood number orth per pos pron re sense stress subc syll tns usg xr actor camera caption castItem role roleDesc sound tech view cell figDesc authority catDesc change classCode creation distributor edition extent funder geoDecl handNote language principal rendition scriptNote sponsor tagUsage typeNote fDescr fsDescr ab seg accMat acquisition additions catchwords collation colophon condition custEvent decoNote explicit filiation finalRubric foliation heraldry incipit layout material musicNotation objectType origDate origPlace origin provenance rubric secFol signatures source stamp summary support surrogates textLang watermark addName affiliation age birth bloc country death district education faith floruit forename genName geogName langKnown nameLink nationality occupation org orgName persName person personGrp placeName region residence roleName settlement sex socecStatus surname u writing valDesc lem rdg wit witDetail witness byline closer dateline docAuthor docDate docEdition docImprint imprimatur opener salute signed titlePart trailer damage fw restore supplied surplus metSym rhyme </teian:annotator-possible-parent-element-names> <teian:annotator-possible-preceding-sibling-element-names/> <teian:annotator-attribute name="corresp" value=""/> </teian:annotator>
Example of annotator localization:
<teian:annotator id="lb-annotator"> <teian:toolbar-button-title>Person</teian:toolbar-button-title> <teian:toolbar-button-label>persName</teian:toolbar-button-label> <teian:annotator-panel> <teian:annotator-panel-title>Person</teian:annotator-panel-title> </teian:annotator-panel> </teian:annotator>
Note | |
---|---|
|
© 2011 - 2019 Claudius Teodorescu