Skip to main content

Module schema_section

Module schema_section 

Source
Expand description

The SCHEMA section (kind 9, SPEC §7.5): the class hierarchy, the per-level type rollups and lateral class links, the coherence axioms, the planner’s per-predicate query_stats and the characteristic sets — computed without the community dendrogram, so any build writes it, --no-pyramid and the memory-bounded build included.

These used to be blocks of the pyramid-meta (kind 4), built only after the dendrogram; a file without a pyramid had none of them, and the planner had no statistics on exactly the large files where it matters most.

§Layout

0   16  digest: blake3(section[16..])[..16]  (the section is outside the header hash)
16  1   version (= 1)
17  …   varint len + bytes: the type predicate the rollups used (empty = no typing)
    …   a pyramid-meta encoding (SPEC §7.3) with round 0, no superedges, no tiles,
        no label block and no descriptors: [QSTATS_V1] [CHARSET_V1] [SCHEMA_V2]

§Rules (order-independent, so every builder writes the same bytes)

Everything is computed over the deduplicated default graph:

  • the type predicate is --type-predicate when given, else rdf:type;
  • a subject’s representative class is its type with the smallest object id; instance counts count every type statement;
  • lateral links (class(s), p, class(o)) skip the type and subClassOf statements; (literal) / (untyped) are the object sentinels;
  • levels carry round = 0 (there is no dendrogram to align with);
  • characteristic sets: the 128 commonest exact predicate sets.

Structs§

SchemaMeta
A decoded SCHEMA section — or, for a file built before it existed, the same fields read from the pyramid-meta (see SchemaMeta::from_pyramid).