---
title: "onto-query — Mova code model"
description: "Mova code model of onto/src/query.rs: components with their labels, obernants and the model text."
url: "https://groupants.elamur.ai/free/en/mova/onto/src/query.rs.groupant/"
---
Elamur: [Mova](https://md.mova.elamur.ai/free/en/) · [Dictionary](https://md.dictionary.elamur.ai/free/en/) · [Research](https://md.research.elamur.ai/free/en/) · **Groupants**

This page as HTML: <https://groupants.elamur.ai/free/en/mova/onto/src/query.rs.groupant/>

# onto-query

The groupant beside onto/src/query.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

- **kind:** groupant
- **status:** partial source bound model
- **source:** [`onto/src/query.rs`](https://github.com/ElamurAI/mova-free/blob/main/onto/src/query.rs)
- **source SHA-256:** `c1e3d46ec350cc30…`
- **repository folder:** [`onto/src/query.rs.groupant`](https://github.com/ElamurAI/mova-free/tree/main/onto/src/query.rs.groupant)
- **repository commit:** `855da7bd4a7b`

> **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

| component | label | where |
|---|---|---|
| **approximant** | partial | [approximant](#approximant) |
| **ast** | partial | `syntax.json` |
| **composition** | partial | [composition](#composition) |
| **cost** | partial | [cost](#cost) |
| **descriptant** | present | [descriptant](#descriptant) |
| **invariant** | partial | [invariant](#invariant) |
| **tests** | executed bounded checks | [tests](#tests) |

## 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.

| id | type | label | where |
|---|---|---|---|
| `behavior_complement` | behavior_complement | partial source derived model | [behavior_complement](#behavior-complement) |
| `reverse_reconstruction` | reverse_reconstruction | partial source derived model | [reverse_reconstruction](#reverse-reconstruction) |
| `lookup_order` | lookup_order | partial source derived model | [lookup_order](#lookup-order) |
| `relation_completeness` | relation_completeness | partial source derived model | [relation_completeness](#relation-completeness) |
| `proof_paths` | proof_paths | partial source derived model | [proof_paths](#proof-paths) |
| `parser_precedence` | parser_precedence | partial source derived model | [parser_precedence](#parser-precedence) |

## Parts

- [onto-query-lookup](https://md.groupants.elamur.ai/free/en/mova/onto/src/query.rs.groupant/lookup.groupant/)
- [onto-query-meronymy](https://md.groupants.elamur.ai/free/en/mova/onto/src/query.rs.groupant/meronymy.groupant/)

## Model text


### descriptant

#### onto-query

lookup explicit ID/POS→merged exact/lower/capitalized→first successful noun plural fallback. Context/core/prior rank retains within0.3. ask resolves first --layer before command. Property verdict preserves Kb distinction. parts sorted ancestor(depth,id), PartOf<=3, MemberOf/MadeOf depth0.

##### Modeling epoch 2026-10-31

Prospective model saved before edits; nine existing sources read fully. Added bounded inline tests; store reader overflow repaired only after compiled old-code failing witness. No live corpus, teacher, model or database effects executed. Source syntax generated twice identically; partial lexical projection only.

### approximant

#### Forward relation

lookup explicit ID/POS→merged exact/lower/capitalized→first successful noun plural fallback. Context/core/prior rank retains within0.3. ask resolves first --layer before command. Property verdict preserves Kb distinction. parts sorted ancestor(depth,id), PartOf<=3, MemberOf/MadeOf depth0.

##### Equations

lookup=ordered_unique_senses(exact,lower,capitalized) ⊕ first successful noun singular candidate. rank retains s(c)≥max(s)-0.3. Parts=first unique(part,rel) across sorted ancestor owners and≤3 incoming part edges.

##### Domain

Valid lookup ordering/nonempty senses assumed. IsA miss No, parts miss Unknown. Dedup(part,rel) retains first owner/path. Ranking may load global prior; one-sense fixture avoids.

Categorical behavior and effect boundaries have no validated percentage surrogate. Executable Rust approximant unsupported; 1/2/5/10% future caps require a useful metric first.

##### Ranking score domain

Multi-candidate ranking claims additionally require finite per-candidate scores (finite prior shares and finite weighted sums). The prior parser can accept NaN: total_cmp may place NaN first, then every `score >= best - 0.3` comparison fails, producing an empty ranked vector; isa/has_part can subsequently panic at cands[0]. Nonfinite scores are an explicit unverified failure domain, not a successful unknown-answer policy. Executed query fixtures have one sense and bypass rank_candidates scoring/global prior loading.

### invariant

#### Invariant and domain

Valid lookup ordering/nonempty senses assumed. IsA miss No, parts miss Unknown. Dedup(part,rel) retains first owner/path. Ranking may load global prior; one-sense fixture avoids.

##### Limits

Finite synthetic fixtures are not semantic proof. Public invalid indices, allocation failures, huge counters, environment races and live effects outside explicit checks remain unverified.

##### Ranking score domain

Multi-candidate ranking claims additionally require finite per-candidate scores (finite prior shares and finite weighted sums). The prior parser can accept NaN: total_cmp may place NaN first, then every `score >= best - 0.3` comparison fails, producing an empty ranked vector; isa/has_part can subsequently panic at cands[0]. Nonfinite scores are an explicit unverified failure domain, not a successful unknown-answer policy. Executed query fixtures have one sense and bypass rank_candidates scoring/global prior loading.

### cost

#### Cost approximation

Lookup sense dedup O(S²); rank O(S log S); ancestry O(Va+Ea), repeated target BFS and broad3-level parts product costs; output-sized proof memory.

Symbolic costs only; no timing or throughput claim.

### composition

#### Composition

lookup=ordered_unique_senses(exact,lower,capitalized) ⊕ first successful noun singular candidate. rank retains s(c)≥max(s)-0.3. Parts=first unique(part,rel) across sorted ancestor owners and≤3 incoming part edges.

Graph builder→store shape check→Kb; Kb→query→bridge/describe/pron. hs Parsed→hsmap preference/scoring/gates. Core SynMap last-duplicate vs Graph first-duplicate requires unique synset keys for interchangeable lookup. Syntax children below share parent projection; exact byte ranges bind original source semantics.

- lookup: Found=merge(exact,lower,capitalized) else first successful plural candidate for nouns

- meronymy: owners=sort ancestors(depth,Cid); walk incoming PartOf<=3, MemberOf/MadeOf at depth0

### models

### behavior_complement

Unknown word excludes guessed Boolean; no part witness excludes No; direct form excludes plural; MemberOf cannot recursively traverse.

### reverse_reconstruction

Found allows case/underscore aliases and plural forms with earlier fallback misses. Yes admits compatible paths; No constrains selected senses only; answers lose unseen paths/seeds/extra args.

### lookup_order

Explicit ID POS mismatch returns None immediately; adjective satellite same class.

### relation_completeness

IsA/verb/role No vs meronym Unknown on no witness; relation-specific closed world.

### proof_paths

BFS shortest, owners depth/id sorted, first(part,rel), depth<=3.

### parser_precedence

First --layer parsed before unknown/missing command; only first pair drained, extra args ignored.


### Ranking score domain

Multi-candidate ranking claims additionally require finite per-candidate scores (finite prior shares and finite weighted sums). The prior parser can accept NaN: total_cmp may place NaN first, then every `score >= best - 0.3` comparison fails, producing an empty ranked vector; isa/has_part can subsequently panic at cands[0]. Nonfinite scores are an explicit unverified failure domain, not a successful unknown-answer policy. Executed query fixtures have one sense and bypass rank_candidates scoring/global prior loading.

### tests

#### Actual-code checks

- `query::wave29_tests::lookup_query_and_open_world_parts`

##### Evidence 2026-10-31

Each selected test passed twice debug and twice release after exact mutation restoration (15 named suite checks; all four sorted outcome sets equal, exits0). Compiled source control: negative-query.log (compiled source mutation assertion failure101). Controls compile successfully and fail an assertion with exit101. Store control is the original unsafe length addition before repair.

Finite graph/token/temp fixtures; public invalid states and unselected branches not exhausted

Whole CLI, live teacher/corpus/model/prior loading, filesystem failure/durability and huge inputs were not executed. No exact wrapper is advertised as a percentage surrogate. Added test blocks rustfmt-formatted independently; unrelated source formatting preserved. Strict broad Clippy not repeated: existing dependency/source warnings are outside this work.
