The Structure of a Simple Text
Exploring the Index schema for "simple" texts at Sefaria.
The Schema of a Simple Text
The simplest Index records in the system have schema trees with just one node - a content node. Specifically, they have a JaggedArrayNode
, which is a type of content node.

A Single-Node-Tree for a Simple Text
For each JaggedArrayNode
, there is a corresponding JaggedArray
on the Version containing the text (not included in the diagram).
Example: The Book of Genesis
An example of a simple schema is the book of Genesis. The text for Genesis is stored in a depth 2 JaggedArray
- an array of arrays. Each array in the JaggedArray
represents a chapter, and each element within the chapter is an array of strings, representing verses.
The content for this book looks like this:
[
["Verse 1:1", "Verse 1:2", ...] # Chapter 1
["Verse 2:1", "Verse 2:2", ...] # Chapter 2
[...]
]
The Index schema describing the book looks like this.
{
"title" : "Genesis",
"maps" : [],
"order" : [1, 1],
"categories" : ["Tanach", "Torah"],
"schema" : {
"titles" : [
{
"lang" : "en",
"text" : "Genesis",
"primary" : True
},
{
"lang" : "en",
"text" : "Bereishit"
},
{
"lang" : "he",
"text" : "ืืจืืฉืืช",
"primary" : True
}
],
"nodeType" : "JaggedArrayNode",
"lengths" : [50, 1533],
"depth" : 2,
"sectionNames" : ["Chapter", "Verse"],
"addressTypes" : ["Integer", "Integer"],
"key" : "Genesis"
}
}
Let's dive into the various properties on the schema:
Property | Value in
| Explanation |
---|---|---|
|
| A text field. For a single node schema like this, the value of |
|
| This corresponds to a related class in the Python code. The value, |
|
| An array of dictionaries specifying titles for this node (for full description of how titles work, see Titles. Each title dictionary has two required keys:
|
|
| The depth of the |
|
| Array with |
|
| Array with |
| n/a | An Integer value primarily used to adjust the way we choose to organize commentaries around the base text (and therefore not present on the Usually, a commentary is organized by the segments of commentary on the verse of the base text it comments on. Adjusting the
An example of a commentary |
|
| Array with up to |
Updated 2 days ago