Elamur Groupants⌕
☰

onto-wdlex

The groupant beside onto/src/wdlex.rs in the Mova repository: what the code computes, what it never does, how to go back from its outputs, its invariants, cost and checks.

Facts

Implementation material. A Mova code model describes this code at one source revision: partial models, finite checks and their stated scope. It is not a reviewed general exposition, and its labels are shown as written, never raised.

Components

componentlabelwhere
approximantpartialapproximant
astpartialsyntax.json
compositionpartialcomposition
costpartialCost
descriptantpresentdescriptant
invariantpartialmodel.md
testsexecuted bounded checkstests

Obernants

The typed relations around the forward model: the behaviour complement (what the code never does), the reverse reconstruction (every input compatible with an output) and specialised views.

idtypelabelwhere
behavior_complementbehavior_complementpartial source derived modelbehavior_complement
reverse_reconstructionreverse_reconstructionpartial source derived modelreverse_reconstruction
subid_projectionsubid_projectionpartial source derived modelsubid_projection
rank_joinrank_joinpartial source derived modelrank_join
language_prioritylanguage_prioritypartial source derived modellanguage_priority
subprocess_ordersubprocess_orderpartial source derived modelsubprocess_order

Parts

Model text

descriptant

onto-wdlex

AnyClaims retains item IDs, lexeme sense IDs and only P8814 strings with rank. lex_line trims CR/comma/space/LF, ignores non-object/non-lexeme, counts bad JSON/lid, emits eight zstd tables. Enclosing lid overrides subid prefix. extract lbzip2 refuses >100 bad or nonzero exit. senses_en joins Q1860, prioritized en/en-gb/en-us lemma, P5137/P8814 and English gloss into sorted sense keys.

Epoch 2026-10-31

Full source reviewed before changes; prospective predictions retained in the external wave29 receipt. Added tests preserve production behavior. lexeme_rows actual parser/emitter tiny zstd and ids executed; subprocess/dump extract and senses_en unexecuted. Registration is partial modeling, not semantic proof.

approximant

Forward relation

AnyClaims retains item IDs, lexeme sense IDs and only P8814 strings with rank. lex_line trims CR/comma/space/LF, ignores non-object/non-lexeme, counts bad JSON/lid, emits eight zstd tables. Enclosing lid overrides subid prefix. extract lbzip2 refuses >100 bad or nonzero exit. senses_en joins Q1860, prioritized en/en-gb/en-us lemma, P5137/P8814 and English gloss into sorted sense keys.

Scoped equation

Trim trailing CR/comma/space/LF; if first!={ return unchanged. Deserialize→bad++ on error; typ gate; L-id gate. Emit header then lemmas/items/forms/senses. valid F/S subids emit using enclosing lid; header counts raw arrays, counters count accepted paths.

Domain: finite in-memory synthetic inputs and fresh tiny temporary fixtures, valid graph/CSR/rank coordinates when graph APIs are used, sufficient resources and representable integer intermediates. Malformed-input behavior is only claimed where explicitly stated; no universal panic-freedom. External teacher, live dump, corpus and database effects were not executed.

Executable approximant gap: no useful percentage metric established for these categorical/effectful observations. No surrogate or production substitution. Future caps 1/2/5/10% require a metric/domain and evidence; no numerical error bound follows here.

invariant

Invariant

Header n_forms/n_senses raw array lengths differ from valid-ID counters. Deprecated extraction rank0 retained; senses_en filters rank0 P5137 but not P8814. Equal priority lemma first wins, duplicate gloss last. Missing language/category becomes0.

Cost

Linear JSON/output plus compression, eight writer buffers. senses_en retains selected maps O(R), sorts O(S log S). Partial output/child process failure separate; counters must fit.

Domain: finite in-memory synthetic inputs and fresh tiny temporary fixtures, valid graph/CSR/rank coordinates when graph APIs are used, sufficient resources and representable integer intermediates. Malformed-input behavior is only claimed where explicitly stated; no universal panic-freedom. External teacher, live dump, corpus and database effects were not executed.

composition

Composition

AnyClaims retains item IDs, lexeme sense IDs and only P8814 strings with rank. lex_line trims CR/comma/space/LF, ignores non-object/non-lexeme, counts bad JSON/lid, emits eight zstd tables. Enclosing lid overrides subid prefix. extract lbzip2 refuses >100 bad or nonzero exit. senses_en joins Q1860, prioritized en/en-gb/en-us lemma, P5137/P8814 and English gloss into sorted sense keys.

Fragment lexeme-emission covers bytes [6723,9757); its equation contributes the indicated local relation. Other source branches/effects remain in the parent model; fragment does not inherit a whole-file proof.

Actual joins: wdx::Tsv emits rank-bearing unquoted schemas read by wdgraph and wdlex; wdgraph rebuilds local indices so wdwalk/rank_kinds must remap Q IDs. wdalign source masks serialize through src_names into wdwalk::n_sources_str (all16 categories checked). Wd uses first-step P31 even for present graph nodes, whereas wdwalk::run only adds P31 for absent graph Qs: these are distinct adapters. wdwalk candidates feed coresel confirmation; wdvmm parsing does not prove truth. wsd consumes model::Graph, kb::up/ancestors, query::lookup and core::of_concept; eval scores query::Answer rather than proof correctness. build::Builder consumes Zip::read; central/local offsets and method gates are not full ZIP validation.

models

behavior_complement

Exclude non-P8814 strings and non-English lexemes in senses_en. Do not exclude deprecated P8814 or parent/subid prefix mismatch; no gates for these.

reverse_reconstruction

Rows admit unknown claims/metadata and control-character variants. Parent lid+form number cannot recover subid prefix. English output loses other languages/lemma variants/duplicates.

subid_projection

L123-S2→(123,2), lex_line discards123 in favor of parent.

rank_join

Raw rank retained, P5137 filtered downstream unlike P8814.

language_priority

en<en-gb<en-us; Q1860 gate first.

subprocess_order

Directory/spawn precede output init; >100 bad kills child; files may remain.

tests

Executed checks

Native command: cargo test --offline -p onto --bin onto -- --exact --test-threads=1 wdlex::t::ids wdlex::t::lexeme_rows (add --release before -- for optimized profile). These exact names were included in the inspected selected command, twice per profile. All 21 sorted named outcomes matched across four runs. This source's compiled mutant returned exit101 with a failing assertion; exact source restoration followed by its passing test.

lexeme_rows actual parser/emitter tiny zstd and ids executed; subprocess/dump extract and senses_en unexecuted.

Syntax generated twice identically after restoring source. Evidence receipts: debug-1/debug-2/release-1/release-2 logs, outcomes and exit files; negative-wdlex, restored-wdlex, controls.json and native-commands.json in external wave29 ontowiki run.

No strict Clippy claim: inherited dependency/target warnings observed; no production logic changed, focused rustfmt applied to added test modules only.

This page in Markdown → https://md.groupants.elamur.ai/free/en/mova/onto/src/wdlex.rs.groupant/