World's first open-source enterprise world model.
0007 · Counting decides what becomes a relation
- Status: Implemented (#112) · open: narrative verbs,
merge_keynot folding_by - Written: 2026-08-30 · condensed into English 2026-09-03
- Related: 0006 for the bench and its caveats; 0010 and 0011 removed the seed relations this record started from; 0008 packs are now the start; 0012 has the successor metric.
The problem
A new knowledge base started with 10 seed relations. Most relations the model produced
were not among them and degraded to related_to, a predicate that says nothing: 49.8% of
facts on the ai-timeline corpus (15 Wikipedia articles on AI companies, 348 chunks).
bootstrap_ontology existed for exactly this and worked badly, for six independent
reasons:
- Exact-string matching discarded vocabulary already in the ontology:
produced_by | ChatGPT → OpenAImissedproduces. Fix:predicate_match(spelling, inflection, and a trailingbythat swaps subject and object). - If the last document failed, the KB stuck forever: auto-extension was enqueued on the success path only. Fix: enqueue on both paths.
- The ≥ 2 documents threshold only gated the LLM run;
build_proposalsre-queried the unfiltered set, so 86.7% of the phrasings shown to the model came from one document. doc_countcounted leftovers still on the fallback predicate, so a KB fed one document at a time never reached two. Fix: prevalence counts all evidence.- "Ignore" was a one-way door:
record_missskipped dismissed phrasings, so counts froze at 1 while twenty later documents used them. Fix: count everything; list dismissed apart, undoable. - Undated facts claimed day precision (
valid_precision NOT NULL DEFAULT 'day'; 728 and 843 live rows). Fix: nullable, CHECK-tied to a date (facts.valid_from_precision).
Decisions
- Counting decides adoption. The model is not asked: the data answers "which
phrasings deserve to become relations", and the model got it wrong: it skipped
runs_on(8 documents, 13 facts) and adopted a single-documentpledged_capital. Three deterministic steps: group by inflectional base (predicate_match::merge_key:suedandsuesare one), take the union of documents per group (never a sum), passMIN_DOCS = 2; the group is named by its most frequent phrasing. From 10 seeds,related_towent 55.5% with auto-extension off, 39.1% with LLM adoption (17 relations), 25.8% with counted adoption (104). - The model keeps the question that needs meaning: synonym merging (is
collaborates_withthe same aspartnered_with), reversible withunadopt. - Deterministic adoption is the most valuable side effect: the same corpus produces the same ontology, so the bench can compare this stage at all.
_byis the only inverse marker worth handling (#109): 31 forms (founded_by42 facts), nearly all coexisting with an active form (produces265). Before adopting,PredicateIndexis consulted; an existing equivalent,_byinverse included, is rewritten to with subject and object swapped.has_X/X_ofhad two pairs, not enough evidence.
Caveats: differences between LLM groups are within run variance (25 vs 18 entities on the
same input); only the deterministic part is certain (single-document adoptions 5 → 0). The
related_to share is no quality metric, since adopting everything lowers it fastest, and
the corpus is dense in training data.
Dead ends
- Snowball stemming (
rust-stemmers) went the wrong way: 49 matches with a 10-word vocabulary, 18 with schema.org's 629, because it strips derivational suffixes too;producerandproducesboth becomeproducand the collision rule refuses to match. Inflectional suffixes only: 49 → 59. - Subject diversity instead of document count: stricter in practice (6 gained, 33
lost), and most of the 6 were coordinated subjects ("A, B and C proposed X" split into
three facts).
docs >= 2 OR subjects >= 3fell to the same problem. - Auto-extension after every document: "≥ 2 documents" becomes a so-far property, and
merging degrades, since the LLM merges
acquired/acquires/acquisition_ofonly when it sees them together. - A fact-count threshold (≥ 3) for new single-document relations: the top two it
admits are the worst two (
has_property11,intends_to5); about 5 of 20 groups look like relations, 1.2% of the KB. Growing KBs solve this themselves; static corpora have the manual panel (min_docs = 0).
Revisions
- 2026-09-02: both premises are gone. Seed relations left in three steps (
related_toin 0010, eight more in #125,mapped_toin 0011) and the seeding function with them (#128); a new KB starts from a pack (0008). The numbers above are not comparable with anything measured today: a fact may now have no predicate (the original word goes tofact_evidence.proposed_predicate), and the successor metric, empty-predicate share, measured 25.6% in 0012 under a different start and definition. The decisions are unaffected and all live. - 2026-09-02: the ontology can declare inverses (#177/#179) and direction is corrected on
write (#138, leaving a
direction_correctedtrace). That does not close themerge_keygap below.
Open questions
- Narrative verbs enter the ontology. Among the 104 relations:
reported/report11,states/stated6,describes/described5,criticizes/criticized6: the article citing sources, no structure between companies. They recur across documents, so counting cannot stop them, and the ontology feeds back into the prompt. Candidate: ask the synonym-merging LLM call "which of these are the article's voice", small and reversible; a verb list would break with the next corpus. merge_keydoes not fold_by. When neither direction is in the ontology (founded_by42 vsfounded4, both qualifying), two opposite relations are still created. The original reason, "the adoption path cannot swap", no longer holds; fold_byinto the group and mark it for swapping.- What a 1,500-term start does to the adoption loop has not been measured; no threshold has moved.
Status history
The status line as it stood on 2026-09-27, before status lines were cut to one line:
Built · adoption by counting (
MIN_DOCS = 2; an LLM run needsMIN_SIGNALS = 3); six defects fixed; proposals persist inontology_proposals(#112); open: narrative verbs in the ontology,merge_keynot folding_by; the starting point (10 seeds, therelated_toshare) no longer exists · 2026-09-10: the counting path now takestemporalfrom the proposal it already reads for classes and attributes, instead of writingstatefor every relation it adopts — the comment that justifiedstate("temporal has no consequence unless functional is set") stopped being true at 0031, which normalises every write by it; counting still decides whether, the model only answers which kind.