<feed xmlns='http://www.w3.org/2005/Atom'>
<title>sisudoc-abstraction-format/ocda-db-format-specification.md, branch claude-markdown-1</title>
<subtitle>SiSU Spine: specs</subtitle>
<link rel='alternate' type='text/html' href='https://git.sisudoc.org/sisudoc-abstraction-format/'/>
<entry>
<title>specs</title>
<updated>2026-10-03T03:23:34+00:00</updated>
<author>
<name>Ralph Amissah</name>
<email>ralph.amissah@gmail.com</email>
</author>
<published>2026-10-01T16:59:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sisudoc.org/sisudoc-abstraction-format/commit/?id=50321b927d162936f031dad7e8e917ac52e0c1d2'/>
<id>50321b927d162936f031dad7e8e917ac52e0c1d2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>format 2.1: a poem is a container, cited as the range of its verses</title>
<updated>2026-10-03T03:23:34+00:00</updated>
<author>
<name>Ralph Amissah</name>
<email>ralph.amissah@gmail.com</email>
</author>
<published>2026-09-29T18:02:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sisudoc.org/sisudoc-abstraction-format/commit/?id=77c68e02c4562ad121891d66f915f16e21144b1f'/>
<id>77c68e02c4562ad121891d66f915f16e21144b1f</id>
<content type='text'>
.ocn_range, the first and last ocn of what a container holds, as one
.ssp property and two .ocda.db columns. A poem is the one container:
its verses are the citable units and the poem is not. It now comes
before its first verse, carries ocn 0 and no identifier, and states
the range, where it came after its last verse carrying that verse's
ocn and identifier, so that one number named two objects: 48 such
pairs in the reference collection, none now.

So the model can now say that a non-zero ocn is unique within a
document, and does, keeping the older rule for artefacts written
before 2.1. A minor bump: an addition, a poem was never rendered and
has no text, the verses are unchanged, and a 2.0 reader reads a 2.1
file.

The property-count table is recounted over the regenerated reference
set, the method first checked against the old set, which it
reproduces. The one new endnote, a note in a poem's last verse now
gathered, accounts for the other moved counts; the poems' segment
names account for .segment_html_is and .segment_epub_is. Neither
example holds a poem, so each changed by its version line alone.

(assisted by Claude-Code)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
.ocn_range, the first and last ocn of what a container holds, as one
.ssp property and two .ocda.db columns. A poem is the one container:
its verses are the citable units and the poem is not. It now comes
before its first verse, carries ocn 0 and no identifier, and states
the range, where it came after its last verse carrying that verse's
ocn and identifier, so that one number named two objects: 48 such
pairs in the reference collection, none now.

So the model can now say that a non-zero ocn is unique within a
document, and does, keeping the older rule for artefacts written
before 2.1. A minor bump: an addition, a poem was never rendered and
has no text, the verses are unchanged, and a 2.0 reader reads a 2.1
file.

The property-count table is recounted over the regenerated reference
set, the method first checked against the old set, which it
reproduces. The one new endnote, a note in a poem's last verse now
gathered, accounts for the other moved counts; the poems' segment
names account for .segment_html_is and .segment_epub_is. Neither
example holds a poem, so each changed by its version line alone.

(assisted by Claude-Code)
</pre>
</div>
</content>
</entry>
<entry>
<title>the derived values, which the model left unstated</title>
<updated>2026-10-03T03:23:34+00:00</updated>
<author>
<name>Ralph Amissah</name>
<email>ralph.amissah@gmail.com</email>
</author>
<published>2026-09-26T02:28:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sisudoc.org/sisudoc-abstraction-format/commit/?id=e55c46e8858672bdf542aef850d5c42426010d54'/>
<id>e55c46e8858672bdf542aef850d5c42426010d54</id>
<content type='text'>
The model says nothing about an object's identifier or its anchor, and
both are derived: the identifier is the ocn where there is one, the
anchor is the segment name. The .ssp omits each where it can be worked
out; the .ocda.db states both on every row. In one reference document
that is 1,314 identifiers and 69 anchors present from one serialisation
and absent from the other.

This is existing behaviour, not a new rule. Spine's own .ssp reader has
always filled both in, which is why the database carries them: the
database is written from the .ssp read straight back. It should have
been written down first. Two readers written independently from these
documents disagreed for want of it, on nearly every object, and nothing
short of comparing whole models showed it.

ocda-model.md gains 3.1 the identifier, 7.1 the anchor and 9 derived
values, with the loading rule in a table; "what the model does not hold"
becomes 10.

The two format specifications gain what a reader needs and did not have:

- the .ssp's property table now says what the absent value is, not only
  when it is written;
- the .ocda.db gains 3.2.1, the metadata key prefix that carries what
  the .ssp puts in four blocks, which a reader must strip to give one
  model from either file, and the note that a value here may carry
  whitespace the text form cannot represent;
- 3.3 gains the element types of each JSON column and a warning to
  parse rather than scan: the encoder writes "/" as "\/" and every
  document in the reference collection has a heading containing one;
- 4.1 names the three places the two files are not symmetric,
  including translation.ocn_aligned, which a .ssp cannot hold because
  it is one language, and which a reader should keep out of the
  document model so that nothing built on the model can tell which
  file it was given.

(assisted by Claude-Code)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The model says nothing about an object's identifier or its anchor, and
both are derived: the identifier is the ocn where there is one, the
anchor is the segment name. The .ssp omits each where it can be worked
out; the .ocda.db states both on every row. In one reference document
that is 1,314 identifiers and 69 anchors present from one serialisation
and absent from the other.

This is existing behaviour, not a new rule. Spine's own .ssp reader has
always filled both in, which is why the database carries them: the
database is written from the .ssp read straight back. It should have
been written down first. Two readers written independently from these
documents disagreed for want of it, on nearly every object, and nothing
short of comparing whole models showed it.

ocda-model.md gains 3.1 the identifier, 7.1 the anchor and 9 derived
values, with the loading rule in a table; "what the model does not hold"
becomes 10.

The two format specifications gain what a reader needs and did not have:

- the .ssp's property table now says what the absent value is, not only
  when it is written;
- the .ocda.db gains 3.2.1, the metadata key prefix that carries what
  the .ssp puts in four blocks, which a reader must strip to give one
  model from either file, and the note that a value here may carry
  whitespace the text form cannot represent;
- 3.3 gains the element types of each JSON column and a warning to
  parse rather than scan: the encoder writes "/" as "\/" and every
  document in the reference collection has a heading containing one;
- 4.1 names the three places the two files are not symmetric,
  including translation.ocn_aligned, which a .ssp cannot hold because
  it is one language, and which a reader should keep out of the
  document model so that nothing built on the model can tell which
  file it was given.

(assisted by Claude-Code)
</pre>
</div>
</content>
</entry>
<entry>
<title>the .ocda.db specified, and the two serialisations shown to agree</title>
<updated>2026-10-03T03:23:34+00:00</updated>
<author>
<name>Ralph Amissah</name>
<email>ralph.amissah@gmail.com</email>
</author>
<published>2026-09-24T15:55:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sisudoc.org/sisudoc-abstraction-format/commit/?id=43fbb8b8b52b33dcb3eda4ffcf066ebfb76f5459'/>
<id>43fbb8b8b52b33dcb3eda4ffcf066ebfb76f5459</id>
<content type='text'>
The third document, derived from the writer and checked against the
27 published databases: eight tables, one virtual table, three views,
fifty columns on objects.

The claim worth making, and it is now checked rather than asserted:
nothing is lost in either direction between the two serialisations.
Every .ssp property is a column or a child table, every column is a
property, a value from the object declaration line, or a database
key.  The mapping is given in full.  Six properties are renamed, the
text form preferring the short name and the database the explicit
one; two are expanded, .indent into base and hang and .has into five
columns; and the four repeatable properties become the four child
tables.  That is the whole of the difference.

Which follows from how the database is made: the document is emitted
as .ssp, read straight back, and what comes back is written.  So the
database cannot carry an object property the .ssp cannot express, and
the two cannot drift.  It is also why they share one version number.

Traps recorded rather than left to be found:

- citable is SELECT d.lang AS lang, o.*, and objects has a lang
  column of its own, so the view carries lang, the document's, and
  lang:1, the object's.  Quote the second to select it.
- the three file-level metadata rows are the only ones with doc_id
  null, and in SQL no null equals another, so UNIQUE(doc_id, key)
  does not constrain them.  A partial unique index over key alone
  where doc_id is null is what keeps them singular.
- parent_ocn 0 is a real non-substantive parent, so a recursive walk
  upward needs the guard or it does not terminate.

The compression column carries the literal none or zstd, so a reader
need not infer it from the role; images are the role that is stored
as read, png and jpeg being compressed already.

Verified while writing: 8 tables and 3 views as described, the three
file-level rows, the partial index as quoted, every JSON array valid
(10,260 of 10,260 in live-manual), and compression by role including
image=none on a document that has images.

(assisted by Claude-Code)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The third document, derived from the writer and checked against the
27 published databases: eight tables, one virtual table, three views,
fifty columns on objects.

The claim worth making, and it is now checked rather than asserted:
nothing is lost in either direction between the two serialisations.
Every .ssp property is a column or a child table, every column is a
property, a value from the object declaration line, or a database
key.  The mapping is given in full.  Six properties are renamed, the
text form preferring the short name and the database the explicit
one; two are expanded, .indent into base and hang and .has into five
columns; and the four repeatable properties become the four child
tables.  That is the whole of the difference.

Which follows from how the database is made: the document is emitted
as .ssp, read straight back, and what comes back is written.  So the
database cannot carry an object property the .ssp cannot express, and
the two cannot drift.  It is also why they share one version number.

Traps recorded rather than left to be found:

- citable is SELECT d.lang AS lang, o.*, and objects has a lang
  column of its own, so the view carries lang, the document's, and
  lang:1, the object's.  Quote the second to select it.
- the three file-level metadata rows are the only ones with doc_id
  null, and in SQL no null equals another, so UNIQUE(doc_id, key)
  does not constrain them.  A partial unique index over key alone
  where doc_id is null is what keeps them singular.
- parent_ocn 0 is a real non-substantive parent, so a recursive walk
  upward needs the guard or it does not terminate.

The compression column carries the literal none or zstd, so a reader
need not infer it from the role; images are the role that is stored
as read, png and jpeg being compressed already.

Verified while writing: 8 tables and 3 views as described, the three
file-level rows, the partial index as quoted, every JSON array valid
(10,260 of 10,260 in live-manual), and compression by role including
image=none on a document that has images.

(assisted by Claude-Code)
</pre>
</div>
</content>
</entry>
</feed>
