Citations

All material taken from other sources must be cited. This part describes the three citation systems used in JLPTEI:
 * The canonical reference system
 * The bibliographic reference system
 * The source reference system

=Linking citations to text=

Citations are stored as identified pointers in a tei:linkGrp within the tei:TEI/j:citationGrp resource. The citation is linked to the text it cites via tei:link[@type] (or tei:linkGrp[@type]/tei:link), where @type is one of the four citation types:
 * quotation citations (@type='quote'), which indicate that the linked text contains an exact quote from the source.
 * allusion citations (@type='allude'), which indicate that the linked text is alluding to the source (eg, in poetry).
 * source citations (@type='source'), which indicate that the linked text was copied from a given source listed in the tei:sourceDesc.
 * bibliographic citations (@type='bibl'), which indicate that the linked text's content is making an academic bibliographic reference to the source.

The first URI in the link contains the source, the second URI contains the citation.

If the citation cannot be expressed as a TEI XPointer range or as an xml:id reference (shorthand XPointer), intermediate pointers may be used to complete the citation.

=Canonical references and quotation/allusion citations=

Quotation and allusion citations are mostly used to indicate where siddur texts are either taken directly from or are allusive of biblical and rabbinic works.

A canonical reference is a citation that references a source with a consistent citation system. These include the bible and many rabbinic works. In JLPTEI, a canonical reference need not point to a specific existing XML resource. Canonical reference systems are defined in the global header's tei:refsDecl elements, which have the base URI http://jewishliturgy.org/base/text/refs. tei:refsDecl defines the form of the canonical reference as a W3C regular expression.

Each canonical reference has two parts: the @decls attribute indicates which reference system it uses, and the @cRef attribute contains the canonical reference itself, as shown in this example, which refers to the first verse in Genesis:

Bible
Biblical references use the following regular expression: (((I|II|1|2)\s)?([ ]?[a-zA-Z.])+(1|2)?)(\s([0-9]+)(:([0-9]+)([a-z]?))?(-(([0-9]+)(:(([0-9]+)([a-z]?)))?))?)?

Book names are written in Latin characters, and may be abbreviated in the specified ways, with or without an appended dot. The following examples show a selection of biblical book names that are valid for use in @cRef: Genesis Exod Lev. numbers Deuteronomy Josh Judg. I Samuel 2 Sam. 1 kings II Kings Isa. Jeremiah Ezek Hos. Joel Amos Obad. Jonah Mic. Nah. Habakkuk Zeph. haggai Zach. Malachi Ezra Neh Dan Psalms Job Prov. Ruth SOS Ecc. Lamentations Esth. I Chr. 2 Chronicles

In addition to books, the expression also supports chapter references, chapter:verse references, chapter:verse-chapter:verse ranges, and chapter:verse parts. The following are all valid Biblical references: I Samuel 12:3 Gen. 2 Ex. 1:1-1:5 Gen 1:1a

(The canonical reference system is implemented in the source code in cRef.xsl2)

Mishnah
Mishnaic references are of the form: M. Tractate chapter:number-chapter:number

M\.?\s([A-Za-z]+(\ [A-Za-z]+)?)(\s([0-9]+)(:([0-9]+))?(-(([0-9]+)(:(([0-9]+)))?)?

Examples include: M. Brachot 1 M. Bava Kamma 2:3 M. Gittin 2-3 M. Kiddushin 4:1-2

Other Rabbinic works
=Source citations=

In a file with more than one primary source of transcription, source citations indicate which primary source a given segment was transcribed from. Source citations are of the form: where target-uri points to the item being sourced, and sourcedesc-uri points to a tei:sourceDesc element.

=Bibliographic citations=

Bibliographic citations include all references to places where information was obtained. An identified j:citationGrp/tei:bibl element is used to enclose the citation. It must include at least a tei:ptr whose target is a tei:biblStruct in the global bibliography. It may also include additional information that is specific to the reference, such as volume, chapter or page numbers (using tei:biblScope). Additional citations that link to the same text must each have their own tei:bibl element.

A tei:link element of type='bibl' is used to link the text to its reference. The form of the link is as follows: