Expand description
The catalogue job (CONTRACT-classes-round C3 to C5): datumesh-mesh catalog-build writes the classes catalog/subject and
catalog/facet (their methods inline, K7), and the cells of their objects, as stored cells signed by the mesh’s key with the
licence the job is given; and the rule text (catalog/rule(), the page /catalog/rule).
The job reads the store’s catalogue entries that have facets (as of its clock). A rerun over an unchanged catalogue writes
nothing: each cell line has no tx, so publish’s skip rule keeps a cell whose latest version states the same thing. A subject
that disappears has every method cell withdrawn with the reason “the subject is no longer in the catalogue” (R1, R10), its
labels too, and so does a facet value that disappears; source(rank) past the count of sources is withdrawn (“rank past the
count of sources”). A withdrawal is a cell’s null version, never false or "". A cell never stored and not wanted has no line,
so a label that names two subjects is absent, not withdrawn.
At most 256 subjects come from one entry, and a subject keeps at most 20 sources (R11).
§The rank (C5)
Per subject, each entry of the subject is level 1, 2 or 3:
- a relay is a name
<host>/relay/<domain>/...; its domain is<domain>(level 2); - a view is a function or class that is not a relay and whose inputs read a relay directly or through other views, to any depth, through any named function or class (level 2). Its source domains are the domains of the relays it reaches;
- the subject’s source domains are the domains of its relays and of the relays its views reach;
- any other entry is level 1 when its publisher’s host (the first segment of its name) equals one of those domains or is a sub-domain of one; when the subject has no source domain, every such entry is level 1 (its own host is its source domain);
- otherwise level 3.
Within a level (R5): a source whose class is a subclass of another source’s class (at any depth) comes before it; the rest
by the instant the name was first bound (a class’s own class binding), then the name, ascending. The rank one source is the
first of that order, and source(k) is the k-th.
§What is written, and what it is called
- the class
<host>/catalog/subject: keysdomain,thing,measure,region(none), in that order; the lookupfrom_label(label_fold); the methodsexists,label,sources,source(rank)(ranka number of unit1, default1, K13),from_label; the extentkeysisexists; - the class
<host>/catalog/facet: keysfacet,value; the methodsexists,label,subjects; the extentkeysisexists; - the function
<host>/catalog/rule(no argument, a blob: the text of the rule).
The labels of a subject: label() is its facet values with _ as a space, measure, thing, region, domain, joined by
·, a none value left out, the region written out (ea euro area, gb United Kingdom, us United States, world
world). The lookup’s labels are the folded label(), and <measure> <region> and <thing> <measure> <region> (folded), each
only when it names exactly one subject; a label that names two is not stored.
Choices where the contract is silent (each is in the report): a subject needs all four keys (an entry without one has no
subjects); subjects() of a frequency value is the number of subjects of the entries that carry it.
Structs§
- Catalog
Built - The job’s result:
cellsis the number of cell versions the run wrote (the classes, methods and bindings are not counted), andsubjectsthe subjects that exist now.
Constants§
- DEFAULT_
CATALOG_ MAX - The default most subjects the catalogue lists (
DATUMESH_CATALOG_MAX, CONTRACT-0.5.1 H2).
Functions§
- catalog_
build_ with - Runs the catalogue job (C5): reads the store’s faceted entries as of the clock, and writes the classes, the cells and the rule
as one publish under the mesh’s key, with the job flag (C1).
licenceis the licence of the cells (DATUMESH_LICENCE).