Entities

Each Mork entity is described in detail here, including sample code how they are parsed with the Java Mork implementation.

Dictionary

Dictionaries are Maps containing Key-Value pairs. A dictionary covers a specific scope. The default scope is the Atom scope and it can be changed with a special tag at the beginning of a dictionary (<a=c>).

Each Key-Value pair is enclosed by parentheses.

				
Dict dict = new Dict("< <a=c> (80=foo)(81=bar) >");
assertSame(ScopeTypes.COLUMN_SCOPE, dict.getDefaultScope());
assertEquals(2, dict.getAliasCount());
assertEquals("foo", dict.getValue("80"));
assertEquals("bar", dict.getValue("81"));
assertEquals("a", dict.getScopeName());
assertEquals("c", dict.getScopeValue());
				
			

The column scope dictionary is used for column names. The atom scope dictionary is used for cell values. This separation is used to decrease the size of column ids, because there are less columns than values.

A Mork database can have multiple dictionaries. Definitions in subsequent dictionaries will replace previously existing definitions.

Table

Tables consist of optional meta-information and rows.

Row

A row consists of a row id and data pairs. Such a key-value pair is called a Cell. A row can have many cells.

Cell

A cell is a key-value pair in a Mork database, either in the Dictionary definition or within a row. The same format is also used for meta-information in various places such as the meta-dict or the meta-table. Each data pair is a key-value pair. Both, the key and the value, can be represented by literal values or by id references.

Group

Groups represent something like transactions in a Mork database. A group can add or remove content. A group can either be in a committed state, or in an aborted state. A group can contain tables and rows.

Literal

Literal values are encoded. Octets which must be hex-encoded are prefixed by a $ dollar sign.