I have studied the Bible since I was a child. There is no more beautiful or useful book in all of history and there never will be. But, that is a discussion for another day.
Object model of the real world Bible
First, I will start with an object oriented design of the Bible itself. For those who have not read it, there are key concepts that are different from other books. For those who have read the Bible, a more formalized description is helpful to understand how to write a program to present what is printed on paper.
I will begin with actual pictures of my study Bible and a CRC card object design of it.
The word Bible comes from a the Ancient Greek word Byblos which refers to a collection of pages made from the stems of the Papyrus plant. The pages were bundled together and later bound into what we would call a book. For modern readers a book is a bunch of paper bound together with two covers. In that sense, we can say that the Bible is a Book. Here is my Ryrie Study Bible:


However, when the Jewish Bible (Old Testament) was written writing was done on a specially prepared animal skin stitched together into a continuous scroll that was rolled up.

When the Christian Bible (New Testament) was written they used Papyrus paper and later velum pages bound into a book (a Codex).
An example of a Codex is the Book of Kells. (Latin text from the Middle Ages):

That technology was not nearly as compact as modern books, so each of the 40 writers wrote in one or more scrolls or codices. There were 66 of those, 39 in the Old Testament, and 27 in the New Testament. Our single modern Bible is a book that contains 66 ancient books.


To express this understanding so far I would list these classes of objects:
- Bible: A collection of ancient writings.
- Testament: A collection of ancient writings written by a certain faith (Jewish, Christian). Old Testament is 39 writings in Hebrew, New Testament is 27 writings in Koine Greek.
- Book: A writing by a single author on a specific subject.
Each book was a continuous stream of sentences. The earliest Hebrew text was written in only consonants and the vowels were implied. The reader had to recognize the word and its context and supply the vowel sounds needed.
An example is this image of the Isaiah scroll found at Qumran in 1947.

The earliest Greek text was written in all capital letters without any punctuation, not even spaces between the words. Again, the reader had to know the text and recognize the words and speak them appropriately. He also had to supply the punctuation as he read.
An example of an early Greek text on Papyrus is this page from P66:

As time went on, the scribes copying the text started inserting punctuation in the Greek, and special vowel marks in the Hebrew.

Furthermore, to make the text more manageable it was divided into chapters (usually a page or so long) in the 1200’s and then smaller verses within a chapter (usually about a sentence). The chapters and verses within a chapter are simply numbered starting with 1.
When we refer to a certain collection of verses (for example The Lord’s Prayer, or The Sermon on the Mount) we refer to the Book name, the starting chapter and verse and a dash and ending verse. The Lord’s Prayer is Matthew 6:9-13. The Sermon on the Mount is Matthew chapters 5-7. This type of collection can be referred to as a Passage. Sometimes a study Bible will have a scholar’s provided title to describe the content or meaning of the passage. The passage from Matthew 1:1 through 1: 17 has a title supplied by Charles Ryrie “His Background“.
One of the unique features of the Bible is the vast web of relationships between different passages. Those are referred to as Cross References. They are printed in the margins next to the verse they originate at. I call that the Anchor Verse. The other end of the reference can be a single verse or a passage. Finally, scholars have supplied many footnotes that explain details that the average reader might not know regarding a verse. These are printed like footnotes in other books, except that rather than including a footnote number in square brackets, the footnotes are annotated to refer to the verse they describe. A typical page of a study Bible looks like these:


One final detail is that since the Protestant Reformation, the Bible has been translated from either Latin (used by the Roman Catholic Church since Saint Jerome in around 200 A.D.) or from the original Hebrew and Greek texts. These translations have been done for around 2000 languages for the New Testament, or 1000 languages for the whole Bible. The reason for using translations is so that each person can read a text written in their “heart language“, the language that is usually the native language. As a result, each Bible used today is a translation into a modern language. Therefore, any particular Bible is associated with one of many well known translations. My study Bible is of the New American Standard Bible (NASB) translation which was translated from the very best Hebrew and Greek manuscripts. My father’s childhood Bible is a King James Version (KJV) (or Authorized version) which was translated mostly from the Latin translation of Saint Jerome. 20th century readers will find the King James rather difficult and olde fashioned. I present those two Bibles showing one of the most well known passages (John 3:16).


With those concepts and terms, here is a CRC card that expresses the basic classes of objects:

From real world object model to software object model
Ideally, the software object model should closely resemble the real world model at the highest level. The reason for that is that once developers understand the real world model, the software model should be intuitive. Here is the side by side comparison.

Adding responsibilities and collaborators
Starting with the top level object of our software model we can define the details on individual cards.

This says that the responsibilities of the class called Bible is threefold:
- To logically contain all of the other classes of objects
- To provide access to the other object classes upon demand
- And to select and deliver text from one of a list of available translations
The direct collaborators are also object classes that the Bible class directly interacts with. For instance, starting with the Bible, a piece of software would ask the Bible class to provide access to one of the two Testaments (old and new), or one of the 66 Books contained in the Bible. There may be other convenience methods supplied but these two are the most important.
Of course there are many other aspects to this class that need to be coded and documented, but for the purpose of our high level design, these are the essentials.
In order to create a visual representation of the collaboration relationships, when the design team is writing these cards, they are placed on the table in a physical representation of the relationships. The whole table would look like this:

In the cascade of CRC cards we read something like this:
The Bible provides access to the Testaments which in turn contain Books.

It is also possible that one could access the Books directly from the Bible since each Book is uniquely named.
One could select just one of the testaments and then access just the books it contains. The card also tells us that the important attributes of a Book include its Title and the Author. Other information could also be added as is typical in many study Bibles.
From a given Book, it is possible to access a single Chapter, or each Chapter in order.

For any given Chapter, one can access specific verses, or a passage of multiple verses, or all the verses in order.

A Verse is identified by its number within the Chapter and it composed of words forming one or more sentences.

Obviously a verse is part of a chapter. Another relationship shown in the card is that associated with a verse can be one or more Cross References, or in our data model it is abbreviated as Xref.
An Xref (Cross Reference) is associated with a specific verse and refers to another verse or passage anywhere in the Bible.

When accessing a Passage, there may be a title comment provided by the author of the study Bible. The passage begins at a specific verse and ends with another specific verse. Most printed study Bibles were written by a specific scholar. But, there is usually not any specific annotations or notes indicating what that scholar thought about the reference. I would like to be able to record that information, or write my own. I would also like to indicate the role that the reference plays. Examples could be that the verse (or passage) is a direct quote from somewhere else, or it could be a parallel passage from one of the other gospels. It could be that this verse is either a prophesy of something to come, or a fulfillment of a prophesy earlier in the Bible. This is why I want to model a richer version of a cross reference in my studies.
As mentioned before, a Passage is a sequence of verses, so it has a starting location, and an ending location, which refer to the starting and ending verses. Passages often have names that are well known, such as The Lord’s Prayer, The Ten Commandments, or The Great Commission. It would be nice to be able to label these and provide an index of key passages in our study Bible.

The last element of the real world model is a Footnote. It is associated directly to the verse by a chapter number and verse number. It is attributed to a specific scholar as the author, may have a title, and of course has some text.

New classes not present in the real world model.
One concept in this software object model that is not in the real world model is the concept of a Location. Since all of the text can be stored in a relational database it is efficient if a specific location can be represented by a simple number so that a relational query can be expressed as a simple range of numbers. The Bible always contains a small number of books, and each book contains a reasonably small number of chapters, which in turn contain a reasonably small number of verses. If we assume that all of these numbers are less than 1000, we can encode a location with the following formula:
Location = ( Book number * 1,000,000 ) + ( Chapter number * 1,000 ) + Verse number.
For example the Great Commission beginning in Matthew 28:18 would be at location 40,028,018. Genesis 2:3 would be 1,002,003.
Since this concept of location occurs in a number of places in such an application, we could either code this math in all those places, or more efficiently and importantly we should create a new class called Location that would encapsulate this whole calculation and the other details in a single place. All the other classes in the model would consume the services of the Location class. This is an example of the way that object oriented design and coding helps greatly in reducing duplicated code, code fragility, and allows future flexibility. If we applied this logic to another book or a library of books that is significantly larger than the Bible, we would only have to change one piece of code.
Implementations of the model
I currently have these projects on going to implement this model in two different languages and implementations.
MichaelKentBurns / BibleModel – A Node.js JavaScript implementation.
MichaelKentBurns / BibleModel-Pharo – A Pharo Smalltalk implementation.