hm

=============

Write Graphviz dot files for archaeological sequence diagrams and chronological models. Convert a sequence diagram to a chronological model.

Requirements

The hm package is Common Lisp software that runs on SBCL or Clozure CL.

It is convenient to install the software with the git distributed version control system.

The output file produced by the hm package is source code for Graphviz dot.

Install

Installation with Quicklisp is recommended. It automatically installs dependencies.

cd ~/quicklisp/local-projects/

git clone https://github.com/tsdye/harris-matrix.git

Load

(ql:quickload "hm")

(in-package hm)

Draw

(hm-draw "path/to/configuration/file")

Overview

The hm package produces Graphviz dot source code for archaeological sequence diagrams from tables of stratigraphic observations, inferences, and interpretations. With the addition of a table of events, the hm package will produce a Bayesian chronological model.

The hm package provides a single function, hm-draw, which expects a valid path to a configuration file as its sole argument.

The configuration file specifies paths to one or more data files and sets values for several dozen Graphviz dot variables.

The configuration information and the data are held in comma separated value files. Together, the configuration and data files can hold a complete description of site stratigraphy and its interpretation.

Example Output

The hm package includes several example configuration and data files.

The stratigraphic section shown in Figure 12 of Edward Harris’ book, Principles of Archaeological Stratigraphy. Note that the symbol for a deposit is a box and for an interface a trapezium. In this example, the nodes are colored according to the directed graph concept of level.

fig-12-harris-levels-tred.svg

Another view of the stratigraphic section shown in Figure 12 of Edward Harris’ book, Principles of Archaeological Stratigraphy. In this example, layer interfaces are recognized and the nodes are colored to reflect the relationship of Context 4 to other contexts in a Bayesian chronological model.

fig-12-distance-from-4-layer-interfaces-set24-tred.svg

“Avoiding a common error in Harris matrix construction,” is an example H-structure from Figure 14 of Steve Roskams’ book, Excavation. You can draw this diagram as follows:

(hm-draw "path/to/examples/roskams-h-structure/roskams-h-cnf.csv")

Note that you might have to adjust the paths in roskams-h-cnf.csv to reflect your file structure.

Roskams' H Structure

A complex H-structure from an article by Irmela Herzog and Irwin Scollar, “A new graph theoretic oriented program for Harris Matrix analysis,” with nodes colored according to reachability from Context 2. The node coloring resolves potential ambiguities in the diagram.

Roskams's Fig. 9.5

Another view of the complex H-structure with nodes colored according to reachability from Context 4.

Roskams's Fig. 9.5

Sequence diagrams sometimes require “jumps” or “crossings”. This example from Figure 13 of Steve Roskams’ book, Excavation, was created with the following command:

(hm-draw "path/to/examples/roskams-jumps/roskams-cnf.csv")

Note that you might have to adjust the paths in roskams-cnf.csv to reflect your file structure.

Roskams' jumps

Data Tables

There are seven data tables used as input to hm. Examples of each are provided in the hm git repository.

Units of Stratification

This table describes the contexts identified by the archaeologist.

Observed Stratigraphic Relations

This table includes observations of stratigraphic superposition. Its first two columns refer to values from the label column of the contexts table.

Inferred Parity Relations

This table contains inferences of parity between pairs of discontiguous contexts.

Periods

This table describes periods, which are groups of interfacial contexts believed to have been in use at the same time.

Phases

This table describes phases, which are groups of depositional contexts believed to have been deposited pene-contemporaneously, typically because they share diagnostic artifactual content.

Events

This table associates events and contexts and specifies the nature of the association using terms introduced to archaeology by Jeffrey Dean in 1978.

Event Order

This optional table contains information on the temporal order of events from the same context.

Configuration File

An empty configuration file is included in the repository as examples/empty-configuration-file.csv.

In addition, each of the examples comes with its own configuration file.

Plotting the Sequence Diagram

I have two shell scripts to automate graph plotting on my Mac OS X system. They each take two arguments:

This one simply plots and opens the graph. It will display all the arcs.

dot -T$2 $1.dot -o $1.$2

open $1.$2

This one plots and opens the transitive reduction of the graph. Transitive reduction corresponds to Harris’ Law of Stratigraphical Succession.

tred $1.dot > $1-tred.dot

dot -T$2 $1-tred.dot -o $1-tred.$2

open $1-tred.$2

Workflow

Legends are displayed as elements; no attempt at good legend layout is made. The svg output from dot can be edited with an application such as Inkscape.