sim_query
Answer a question over the edge graph between stored models: bounded paths, closure over transitive predicates, and conjunctive patterns of up to 4 triples joined on shared ?variables. The query argument is JSON: {"select": ["?m"], "where": [{"subject": "?m", "predicate": "subnetOf", "object": "", "mode": "closure"}, {"subject": "?m", "predicate": "@type", "object": "QueueingSystem"}]}; a term starting with ? is a variable, anything else a constant (a 24-hex content id, or for @type's object a model kind). Modes: edge (default; one stored edge, read through the registry: narrower is read as broader turned round, symmetric predicates match either way round), path (1..maxHops hops, maxHops 1 to 8 required; a row says reached by a path unless the predicate is transitive), closure (no maxHops; allowed only on the transitive predicates broader, isomorphicTo, migratedFrom, narrower, subnetOf, supersededBy). Put the bound term in object to walk backwards. Unregistered (legacy) predicates are one stored edge in their stored direction only, never walked or closed over. A structural edge (isomorphicTo, subnetOf, preservesInvariant, refines) counts only when one of its stored witnesses re-checks valid now; a derived structural fact carries a derivation (the chain of witnesses and the composed map's digest) that sim_check_witness(derivation=…) re-checks, and is never stored; excluded lists the edges not walked and why. Closure runs per predicate (isomorphicTo hops never feed a subnetOf closure). status complete means complete over the eligible edges (and, for path, within maxHops: hopLimitReached names patterns with edges beyond); truncated means a bound was reached, rows is absent and the rows found so far are in partialRows (true, but not all of them). A query with no variables answers yes, no or unknown (a bound stopped it, or a stored row could not be decoded); a no's caveat says how far the search looked (only closure rules out a derived edge, and a path cut at maxHops says so), and no is not a refutation. Pattern numbers in a result (support[].pattern, hopLimitReached, unmatched, truncated.pattern) are 0-based positions in query.normalized.where; refusals number your patterns from 1. Limits: 4 patterns, 8 hops, 200 rows, 10,000 intermediate rows, 1,000,000 work units, 64 models probed, a 256 KiB result, a 16 KiB query; the whole call is bounded by the 55s request limit. Over a limit before running is a refusal naming it; reached while running is truncated, and retrying gives the same answer. Needs sign-in with read scope (opens OAuth the first time). Costs 2 compute tokens per call, cache hits and refusals included. Writes one Query and one Result entity, content-addressed (resolve either at GET /api/lineage/{id}; stored is false, with storedNote saying why, if the write failed or a composed map was refused); a repeated question is served from the cache only while the edges and witnesses it read, and the models it checked, are unchanged. An answer naming models that have since been superseded carries superseded ([{model, successor, current, chainStatus}]); the answer is still right about those versions.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | the query as JSON: {"select": [variables], "where": [{"subject", "predicate", "object", "mode", "maxHops"}]} |