The Greatest Commandments, Part 2

Last week’s Greatest Commandments post explained a new project I’m taking on: map out a hierarchy of all 613 commandments of Torah. The project is inspired by the Messiah’s words:

Love the Lord your God with all your heart, with all your soul, and with all your strength. This is the first and greatest commandment. The second, like it, is this: love your neighbor as yourself. All the Law and the prophets hang on these 2 commandments.

I thought, wouldn’t it be cool to visualize all the commandments in the law hanging on these 2 commandments? And so started my commandments hierarchy project.

Before I go into the boring, nerdy details, behold! The fruit of my labor, my first mapping beyond the 2 golden commandments.

Commandments Hierarchy Part 2

(Click for full size image.)

This week’s addition to the hierarchy are those in gray. I’m adding them in order of a traditional Jewish listing of the 613 commandments.

Today’s additions include 2 commandments that derive from other commandments:

  1. Leviticus 22:31’s command not to profane the name of God is a derivative of Exodus' 22:18’s command to not blaspheme God.
  2. Deuteronomy 6:4’s command to know that God is one derives from Exodus 20’s command to know that God exists.

Deuteronomy 6:4 is a particularly special commandment: the Messiah considered it part of the greatest commandments; he grouped Deuteronomy 6:4 and 6:5 as a single commandment: Israel should hear that the Lord is one. Yeshua considered this the single greatest commandment in Torah.

Additionally, Deuteronomy 6 contains the foundation for the Jewish Sh’ma prayer, recited daily by observant Jews:

Sh’ma yisrael (Hear, Israel)
Adonai eloheinu (The Lord is our God)
Adonai echad (The Lord is one)
Baruch shem k’vod malchuto (Bless the name of his glorious kingdom)
L’olam vaed (forever and forever)

The first half of that prayer is from Deuteronomy 6:4-5. The latter half is a traditional appendage, and when recited aloud, is spoken in a quieter tone than the first half.

While Yeshua considered it a single commandment, Judaism traditionally holds 2 commandments contained within this passage. For the sake of preserving that magic 613 number, I’ve followed Judaism’s lead.

What the future holds for the commandments project

The plan is to map 5 commandments per week:

613 commandments in the Torah / 5 per week = 122 weeks

122 weeks / 52 weeks in a year = 2.3 years

In other words, I’ll be done with this project roughly in November of 2011. The Greatest Commandments Hierarchy project will be done, and we should have flying cars by then, so the world will be a better place.

How is it being done?

WARNING: excursion into nerdliness ahead. Continue at your own risk.

With over a hundred potential modifications to be made to the hierarchy before its completion, mapping new commandments needs to be super easy and frictionless. Drawing a picture with the necessary circles and lines and updating them every time we add a new commandment is out of the question.

Nerd Problem 1: Generating the display

To divide and conquer this problem, the first step was to separate the data from the display: the hierarchical data should be stored separate from the display, and the display should be automatically generated from that data. Imagine a text file, or database, containing all the information about each commandment. Next to it, imagine a program that takes that data and generates a hierarchy chart display from it.

With that in mind, I started searching for a tool that could build a visual hierarchy from a set of hierarchical data. One solution I found, and the tool I’m currently using, is the open source GraphViz app. It’s an old school desktop application that’s been around for ages. It can generate visual hierarchy diagrams from a simple domain-specific language called the DOT language. Put in the following DOT language statements into GraphViz:

digraph graphname {
a -> b -> c;
b -> d;

... and out comes this beautiful graph:

Example graph

Bingo. That’s the kind of graph-generating tool I’m looking for.

Now that I have the tool to automatically generate the display, we need the data to be represented in this special DOT language. How do we do that?

Nerd Problem 2: Creating the data

I’m a software developer. What comes natural to me is class inheritance and type hierarchies. I thought, why not create a code class that represents each commandment? Then, write a small program reflects over all commandment classes, and outputs DOT language instructions for those classes. Here’s my cleverly-named C# project that does exactly that:


As you can see, each commandment mapped so far has its own class file. The application dynamically finds all commandment classes and outputs DOT language instructions. Running it now gives me this output:

 digraph Commandments {
ratio = fill
node[style = filled]
"Love God with all your being.\r\nDeuteronomy 6:5" [color="0.603 0.258 1.000"];
"Love God with all your being.\r\nDeuteronomy 6:5" -> "Do not have gods besides the LORD.\r\nExodus 20:3" [color="0.603 0.258 1.000"];
"Love God with all your being.\r\nDeuteronomy 6:5" -> "No blaspheming God.\r\nExodus 22:28" [color="0.603 0.258 1.000"];
"No blaspheming God.\r\nExodus 22:28" -> "No profaning God's name.\r\nLeviticus 22:31" [color="0.603 0.258 1.000"];
"Love God with all your being.\r\nDeuteronomy 6:5" -> "Know that God exists.\r\nExodus 20:2" [color="0.603 0.258 1.000"];
"Know that God exists.\r\nExodus 20:2" -> "Know that God is one.\r\nDeuteronomy 6:4" [color="0.603 0.258 1.000"];
"Love others as yourself.\r\nLeviticus 19:18" [color="0.603 0.258 1.000"];

Looks crazy and ugly, not much a human can read. But feed that into GraphViz, and…

Commandments Hierarchy Part 2

Voila! We have our data, we have translated our data to DOT language, and we have our data visualization tool. Problem solved.

The beauty of all this is:

  • I can easily change the style, look, and feel of the graph by tweaking a few lines of code.
  • The graph regenerates in a few milliseconds.
  • Introducing new commandments is painless – simply add a new class to my application.
  • Changing existing commandment hierarchy around is frictionless: simply change the type the code class derives from.

With this system, I can go from new commandment to graph in about 2 minutes. Now that’s what I’m talkin’ ‘bout, Willis! :-D

Some further statistics

Each commandment stores the data:

  • Text: the full bit of Scripture containing the commandment
  • Book: stored separately from the chapter and verse
  • Chapter
  • Verse
  • CanBeCarriedOutToday: an interesting piece of data: can this commandment be carried out today in modern times? When the project is finished, it will be interesting to see what percentage of commandments can be followed today.
  • FollowedByMessianics: Whether Messianics generally observe the commandment.
  • FollowedByChristians: Whether Christians generally observe the commandment.
  • FollowedByObservantJews: Whether observant Jews (I’m thinking the various streams of Orthodox Judaism) generally observe the commandment.
  • ShortSummary: A short one-liner that succinctly describes the commandment.
  • CommandmentType: Positive or negative? (Do? or Don’t?)
  • What else? I want to leave this open for more data as I find interesting stats to tally.

In addition to tallying these statistics, the visual graph itself can be shaped to show this data: negative commandments may have a red background. Commandments that cannot be carried out today (e.g. Tabernacle/Temple activities) may utilize rectangles rather than ellipses. And so on. When the project is finished, I will be dumping all this data into a standard SQL database.

That’s it, fine blog readers! Shabbat shalom! And may you take joy in the commandments. (And the commandments project!)


  1. This is awesome! I love nerdly details! :-D

    On a more serious note, this is a very useful project, in my opinion. Do you have a convenient way (e.g. SVN, Hg) to allow collaboration on this? Or are you planning to hog all the work for yourself? ;-)

  2. I'm glad you guys think this is a useful project.


    I don't have anything set up. I could put the project under SVN source control somewhere...know of any free SVN hosts?

  3. This is a great project.
    Blessings / Shalom

    Yves L.L

  4. Sounds like a great project!

    What is with Google Code, Codeplex or GitHub.

  5. Judah's machine. :-) I might host the app on CodePlex eventually. We'll see.