LMNL Data Model

Specifications
These are drafts at the moment, though we think they're just about right. We welcome comments, sent to lmnl-dev@lmnl.org to discuss changes.
LMNL Data Model
Defines the core data model of LMNL.
Reified Data Model
Defines the reified data model, which is used to describe physical documents that represent LMNL documents.
LMNL Object Model (LOM) API
This is very much a draft.
Specifies an object-oriented API for the LMNL data model.

Summary

The data model is the central part of LMNL: there can be many LMNL syntaxes, but only one data model (as opposed to XML, where there is only one syntax but multiple data models).

A LMNL document is made up of many layers, which are arranged one on top of each other, each resting on a base and having many overlays. The bottom-most layer is a text layer, which contains some text.

Layers aside from text layers contain ranges, which span over the contents of the layer below. Most ranges have a name, and some have annotations. Annotations all have a name, and can themselves have more annotations. The value of an annotation is a text layer, which can have its own overlays containing more ranges.

The span of a range (its start and end points) determines its relationships to other ranges on the same layer. Ranges can precede or follow each other; they can overlap another range's start or end; they can enclose other ranges, be within other ranges or be clones.

A reified LMNL layer acts as a bridge between a syntax and a LMNL data model. In the reified LMNL layer, a document is represented as a [lmnl:document] range, each range as a [lmnl:range] range, each annotation as a [lmnl:annotation] range and so on.