unimsg provisional

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.

kinda variety ofholdsfor example
vocabularymeaningwhat a document's fields mean; the shape a gate checks@vocab/rich-document/v0
lecta vocabularya declared variety of one vocabulary: fixed values, refused keys, no new ones@rd/profile/prose/v0 — the prose subset of rich-document
targeta rendererwhat one build of one consumer has, and what it resolves tokens to@ui/target/web/v0
librarya kernelelement types derived over a vocabulary's kernel; adds nothing to implement@ui/lib/v0
mappinganother formathow an external format's constructs land in a vocabularymapping/encyclopaedia/infobox-planet/v0
profilethe encodingwhat the format itself restricts: key types, determinism, limits@unimsg/v0
registrythe wholethe one list of every named thing above, with its kind, hash and statusvocab/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.

kindhow many
shapes — the shape of a whole document5
libraries — decompositions over a vocabulary's kernel1
qualifiers — annotations that qualify a statement2
policies — how a vocabulary's documents merge4
subjects — describing something in the world40
in total52

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 sitscarriesanswers
a block inside the VOCABULARY document:over, no :ofwhat a document of this kind looks like when nobody said otherwise
a block BESIDE the data, same document:over and :ofwhat THIS document looks like
its own document, pinned by hash:over and :ofa 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.

stepwhat
declarea 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
projectrun the walk over a document and you get another document: the same subject, arranged
renderthe 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 documentexamples/genealogy-windsor-charles.umsg raw
the viewexamples/genealogy-windsor-charles.umsg raw
where it sitsbeside the data, in the same file
emitsan interface