Vocabularies, lects, and what they are for
The format says what a document IS — its types, its bytes, its canonical form. It does not say what any field MEANS. A vocabulary is where meaning lives: what the fields are, which are required, and what a gate may refuse. Without one a document is well-formed and mute; with one, a tool that has never seen it can read it, check it, and render it.
The words
Seven words, each with exactly one job. They are borrowed from linguistics, and the borrowing is not decoration: a format that makes meaning addressable has the same parts a language does, and the words a linguist would use keep the analogy honest.
| kind | a variety of | holds | for example |
|---|---|---|---|
| vocabulary | meaning | what a document's fields mean; the shape a gate checks | @vocab/rich-document/v0 |
| lect | a vocabulary | a declared variety of one vocabulary: fixed values, refused keys, no new ones | @rd/profile/prose/v0 — the prose subset of rich-document |
| target | a renderer | what one build of one consumer has, and what it resolves tokens to | @ui/target/web/v0 |
| library | a kernel | element types derived over a vocabulary's kernel; adds nothing to implement | @ui/lib/v0 |
| mapping | another format | how an external format's constructs land in a vocabulary | mapping/encyclopaedia/infobox-planet/v0 |
| profile | the encoding | what the format itself restricts: key types, determinism, limits | @unimsg/v0 |
| registry | the whole | the one list of every named thing above, with its kind, hash and status | vocab/vocabularies.umsg, for vocabularies only |
From the terminology document: docs/51-terminology-and-infrastructure.umsg raw
EVERYTHING ELSE ON THE LIST VARIES IT OR BINDS IT. A vocabulary is the only kind that introduces meaning; a lect narrows one, a target says what one renderer can do with one, a library builds on one, a mapping brings another format into one, and a profile restricts the encoding underneath all of them.
What a lect is
A LECT IS A DECLARED VARIETY OF ONE VOCABULARY: it may fix values and it may refuse keys, and it may never ADD one. That last rule is what keeps it cheap — every document in a lect is a valid document of its vocabulary, so a reader that knows only the vocabulary reads it correctly, if less efficiently. A lect that introduced a key would be a new vocabulary in a disguise, and the parent's gate would refuse its documents.
IT IS A VARIETY AND NOT ONLY A SUBSET. The prose lect refuses keys, which is a subset, and FIXES five values, which is not: a document written in it resolves to formatting a plain reader would have had to be told. Subset would therefore have been the wrong word, and so would dialect, which presumes a geographic axis. A lect in linguistics is any variety distinguished by SOMETHING — region gives a dialect, social group a sociolect, situation a register — and the word exists precisely because the general notion needed a name presuming none of the specific ones. That is the situation here: the axis is different every time and the lect declares it.
What this buys
THREE THINGS, AND THEY ARE WHY THE LAYER EXISTS.
A GATE CAN REFUSE. A vocabulary states which fields are required and what may hold what, so a checker written by somebody else can reject a document the author got wrong — before it reaches whatever would have misread it.
A READER CAN AGREE WITH A WRITER IT NEVER MET. The fields mean what the vocabulary says they mean, not what the program that wrote them assumed. That is the difference between data and a private convention that happens to be in a public format.
AND A DOCUMENT GAINS A RENDERING NOBODY WROTE FOR IT, which is the section below.
How many there are
They are filed by what a vocabulary GOVERNS — a whole document, a statement inside one, or a subject in the world — because that is the question somebody adding the next one is asking. Three more kinds sit beside them: a LIBRARY decomposes widgets into a kernel that already exists, a TARGET PROFILE says what one consumer can do with a construct, and a MAPPING says what another format's structures become.
| kind | how many |
|---|---|
| shapes — the shape of a whole document | 5 |
| libraries — decompositions over a vocabulary's kernel | 1 |
| qualifiers — annotations that qualify a statement | 2 |
| policies — how a vocabulary's documents merge | 4 |
| subjects — describing something in the world | 40 |
| in total | 52 |
From the vocabularies index: vocab/vocabularies.umsg raw
The presentation layer
A view is a document that says how a subject is drawn. It names the vocabulary it is written :over, so every path it reaches through can be checked against that vocabulary — and it declares what KIND of thing it produces. Without this each consumer invents its own, and a reader asking what a family tree looks like is shown one program's opinion of one.
A VIEW CAN SIT IN THREE PLACES, and which one it sits in is what it means. The absence of :of is what makes a view a default.
| where the view sits | carries | answers |
|---|---|---|
| a block inside the VOCABULARY document | :over, no :of | what a document of this kind looks like when nobody said otherwise |
| a block BESIDE the data, same document | :over and :of | what THIS document looks like |
| its own document, pinned by hash | :over and :of | a view shared across documents, or one that must outlive any of them |
THEY ANSWER DIFFERENT QUESTIONS, not the same question at two qualities. A measurement series of 821 rows declares an axis with a size and no values, and three of its five variables are indices — so nothing in the document says which is the time coordinate, and a vocabulary-level default can only chart against 0…820: total, honest and poor. A view written beside that document says the x axis is the decimal date, which the vocabulary cannot know and the author can. That is the argument for having both.
| step | what |
|---|---|
| declare | a view is a document of its own. It states a walk over the subject — where to start, what to follow, what to join — and says nothing about pixels |
| project | run the walk over a document and you get another document: the same subject, arranged |
| render | the view declares what KIND it produces — an interface, a document, a drawing — and that decides what draws it. Each is something the format already had a reader for |
NOTHING IN A VIEW DESCRIBES APPEARANCE, and what it produces is an ordinary document. That is what lets one mechanism serve a family tree and an encyclopaedia entry alike, and it is why a view can be written by somebody who has never seen the drawing code.
The samples
Four subjects, none of them styled for this page. One is drawn by the default view of its own vocabulary — the same one that renders any document of that kind. The other three carry a view in the same file as the data, which is what a document does when it wants to arrive alone: a document's own view beats the vocabulary's default, and one of the three differs from that default in three colours and nothing else.
Fourteen people of the British royal family, from published record: the King, the parents he descends from, and the two generations below him with the people they married.
IT CARRIES THE SHAPES A TIDY TREE DOES NOT HAVE. A person married twice, where the first marriage ended in divorce and the second began nine years later — so one person sits beside two spouses without implying the two are married to each other. A marriage that ended without a death, whose line the tree still has to draw, because the children descend from it whatever happened afterwards. And a marriage with no children, which is a union with nothing hanging from it.
EVERY PORTRAIT IS IN THE SAME FILE. Each photograph is carried as bytes beside its digest, its title and its licence, so the tree arrives with its pictures and with the right to show them.
The document holds people, assertions and the basis of every link, and says nothing about layout. Where the cards go is the view's business.
| vocabulary | @vocab/genealogy/v0 |
|---|---|
| the document | examples/genealogy-windsor-charles.umsg raw |
| the view | examples/genealogy-windsor-charles.umsg raw |
| where it sits | beside the data, in the same file |
| emits | an interface |
Pluto, whose classification changed in 2006 without its identity changing and is still disputed. The entry holds both values and declares neither the winner; the view has to render a fact that has two answers, which is the case most templates skip.
| vocabulary | @vocab/encyclopaedia/v0 |
|---|---|
| the document | examples/entry-pluto.umsg raw |
| the view | vocab/subjects/encyclopaedia-v0.umsg raw |
| where it sits | in the vocabulary, so it is the default |
| emits | a document |
Lantern, a small link checker, complete to its second tag. Three authors and three committers — including a commit whose committer is not its author — three branches, two merges of which one was a conflict resolved by hand, an annotated tag and a lightweight one, and files in seven languages and formats down to a batch file with CRLF line endings.
The view projects the commits, the refs and the tree: a code host's front page described as a walk over the document rather than as a template. Nothing in the repository knows it is going to be drawn.
IT IS ONE FILE. The view sits beside the data it draws, so a reader holding neither the vocabulary nor the vocabulary's own default view can still draw what is in it.
| vocabulary | @vocab/git-repository/v0 |
|---|---|
| the document | examples/repository-lantern.umsg raw |
| the view | examples/repository-lantern.umsg raw |
| where it sits | beside the data, in the same file |
| emits | an interface |
The Royal Exhibition Building and Carlton Gardens, Melbourne: Joseph Reed's Great Hall of 1879, where the first Parliament of Australia opened in 1901, and the garden laid out around it. One World Heritage property, and one document — the hall is recorded as a part of the property rather than as the property itself.
A SPACE IS NOT ALWAYS A ROOM. The Great Hall is a room, the crossing under the dome is a void running through three storeys, the paths are circulation, the lawns and islands are outdoor space, and the water of the two ponds is none of those. The vocabulary has a word for each, so nothing is filed as a room for want of anywhere else to put it.
AN ELEVATION OF NULL MEANS UNKNOWN AND NEVER ZERO. The upper galleries and the Dome Promenade are recorded without a height, and the spaces on them carry no geometry rather than a guess at it. The document is equally explicit elsewhere: five of its coverage answers state what is not known, and a garden gate that the source could not place says so in the record.
SHAPES CARRY HOLES, AND SWEEPS RUN WHERE THEY LIKE. The garden ground is holed by both ponds, each pond by its islands, and the wheel parterre is one lawn with twenty-seven beds cut out of it. Each run of the outer wall is an elevation holed by two storeys of arched windows and swept through the wall's thickness; the gabled roofs are triangles swept along the ridge rather than extruded upward; the dome is thirty octagonal tiers of one element.
EVERY FIGURE SAYS WHERE IT CAME FROM. The outlines and heights are the map's, the property record is the World Heritage List's, and the section — read from photographs — is marked indicative, each under a named source the rest of the document points back at. The frame is metres from the centre of the dome, and the hall stands 7.73 degrees clockwise of east on a lattice chosen so that every wall along it is exactly vertical and exactly planar.
Nothing in the document mentions a camera.
| vocabulary | @vocab/building/v0 |
|---|---|
| the document | examples/building-royal-exhibition.umsg raw |
| the view | examples/building-royal-exhibition.umsg raw |
| where it sits | beside the data, in the same file |
| emits | an interface |