Loading server...
{
"type": "object",
"properties": {
"after": {
"description": "deadline: the date of the event",
"type": "string"
},
"afterTime": {
"description": "deadline: the time of filing",
"type": "string"
},
"args": {
"description": "the arguments of the predicate in the order of its signature; with kind='collect' exactly one of them is the selection variable ?name (for example ['urn:x:water', 'urn:x:mix', '?value']), the rest are values. Values follow the parameter type: an entity — 'urn:…' or a short name; Date — 'YYYY-MM-DD'; Money — '<number> <currency>' ('43250 KZT'); Quantity — '<number> <unit>' with the unit exactly as the package spells it; a constant of the package — its name",
"type": "array"
},
"calc": {
"description": "kind='calc': a tree {op,left,right}, op ∈ add|sub|mul|div|le|lt|ge|gt|eq|ne (the synonyms divide/multiply/plus/minus and the signs are accepted); the leaves are 5 | '3932 KZT' | '2 mrp' | {lookup: 'mrp', args: [2026]} — a statutory value from the corpus; aggregates are {aggregate: 'sum', element: '?v', over: [{predicate, args with '?variables'}]} over the facts given in facts"
},
"context": {
"additionalProperties": false,
"description": "Explicit temporal context: timezone is an IANA name; decisionTime and knowledgeTime are complete Instants with UTC or an offset, preserved unchanged. legalTime is also required with context; a profile may require all these fields",
"properties": {
"decisionTime": {
"type": "string"
},
"knowledgeTime": {
"type": "string"
},
"timezone": {
"type": "string"
}
},
"required": [
"timezone",
"decisionTime",
"knowledgeTime"
],
"type": "object"
},
"cutoff": {
"description": "deadline: the hour operations close",
"type": "string"
},
"days": {
"description": "deadline: the length of the period",
"type": "integer"
},
"deadlinePolicy": {
"description": "the policy for counting time limits expressed in days: the StableId of a deadline policy declared in the world of the question (e.g. 'urn:kz:corpus:clir:administrative-code#AC_WORKING_DAY_TERMS'), or its short name when exactly one declaration carries it. An inline object {start_count: 'same_day'|'next_day', include_end: true|false, roll: 'no_roll'|'next_working_day'|'previous_working_day'[, month_end: 'last_day_of_month']} is accepted only by a 0.1 world; a 0.2 world refuses it, and the refusal names the declared policies. Without a policy a norm carrying a time limit answers MISSING_POLICY — the policy is set by the law of procedure and the server never assumes one. The snapshot of the official calendar for working days is supplied by the server itself whenever an instrument counts them.",
"type": [
"string",
"object"
]
},
"evidence": {
"description": "case documents, section 74, evidence_item nodes. One document is referenced from provenance.evidence of many facts. payload.confidence is data for the EvidencePolicy; the engine does not evaluate the number",
"type": "array"
},
"evidencePolicy": {
"description": "StableId of an evidence_policy node, section 78.2. Without it, previous calls keep their behaviour. The confidence threshold is a rule of that policy, not an argument of the call",
"type": "string"
},
"facts": {
"description": "facts of the case: [{predicate, args, provenance, negated?, package?, judgment?}]. provenance is required and must be an object; {} is allowed. Its fields are optional: {origin?, evidence?: StableId, span?: {page?, quote?, offset?}, extractor?: {name, version?, confidence?}, observedAt?, recordedAt?}. origin defaults to case_input. evidence and observedAt are not required; the extractor is lowered to was_generated_by and a document to was_derived_from. confidence is a decimal string; the package EvidencePolicy reads the threshold, not the host. package resolves an ambiguous short name; args use the same notation as the args of the question",
"items": {
"properties": {
"args": {
"type": "array"
},
"predicate": {
"type": "string"
},
"provenance": {
"type": "object"
}
},
"required": [
"predicate",
"args",
"provenance"
],
"type": "object"
},
"type": "array"
},
"focused": {
"description": "kind='truth': ask as focused_truth — the same answer as the full truth, but the proof and the warnings cover only the cone of the question; the answer carries evaluationKind and the slice hashes (focus); the cone in focus is reduced to coneHash and the predicate count, the full cone manifest comes in evaluation.focusManifest with proof=true. A slice is not an audit document: law_prepare_answer does not accept it for publication",
"type": "boolean"
},
"kind": {
"description": "the kind of question (truth by default)",
"enum": [
"truth",
"collect",
"deadline",
"calc",
"positions",
"why_not"
]
},
"legalTime": {
"description": "the date of the law (YYYY-MM-DD)",
"type": "string"
},
"package": {
"description": "narrow the question to one package of law",
"type": "string"
},
"predicate": {
"description": "what is being asked, e.g. 'duty_amount'",
"type": "string"
},
"proof": {
"description": "return the evaluation field with the proof graph in the answer — a ready-made input for law_explain (kind truth|collect; by default a summary without the graph)",
"type": "boolean"
},
"responseMode": {
"description": "full (default) — the complete answer. compact is accepted for compatibility: this server builds no short reply and returns the same complete answer in both modes; there is no fullAnswer reference and no stored snapshot of the answer.",
"enum": [
"full",
"compact"
]
},
"selectedInterpretations": {
"description": "named readings; for an exactly_one group choose exactly one StableId out of law_packages/law_rules",
"items": {
"type": "string"
},
"type": "array"
},
"supportEdges": {
"description": "support edges, section 75, support_edge nodes: from is the document id, to is the fact literal, relation is supports or refutes. Admission is decided by the package EvidencePolicy, not by the host",
"type": "array"
},
"unit": {
"enum": [
"calendar_day",
"business_day"
]
},
"version": {
"description": "the exact package version pinned by the client (open('name@version')); if it differs from the profile composition the host refuses instead of answering with another version",
"type": "string"
}
},
"additionalProperties": false
}
law_query
A deterministic LawQL query over the CLIR of a formalization: a question about the model of the act itself, not about a case. Relations (14): anchors, edges, fields, imports, interpretations, labels, links, literals, nodes, norms, positions, rules, variables, windows. Full field lists: `law query --schema`. Functions (9): anchor/1, labels/1..2, short/1, contains/2, overlaps/2, starts_with/2, ends_with/2, position/2, derivation/2. exists/not exists over a bound variable; equality and membership only, no arithmetic and no ordering comparisons. Scope: corpus by package.name (for example kz.corpus.labour_code, not a file name) or a glob; without corpus, the whole profile slice; a scope outside the profile is empty (CORPUS_EMPTY). Examples: `from r in rules where r.head_predicate == "urn:…#eligible" select r.id as producer, r.strength as strength, anchor(r.id) as anchors` — who produces; `from l in literals where l.predicate == "urn:…#eligible" select l.node as reader, l.context as context` — who reads; `query eligible over "pkg" { for x: Person; where applicant(x); select eligible(x); }` — inference by the core. This is orchestration over the CLIR and the core; no new legal semantics is implemented here. Instead of text, a question from the catalog with arguments: anchors-of, imports-of, links-of, producers, readers, type-step (see `law query --list` for the set) (predicate/node/type parameters are URNs, pkg is a package.name or a glob). A structural answer is a queryPage: resultHash of the full queryResult, snapshot (hash of the scope package list), rowCount, rows by rowLimit (20, at most 5000) and rowOffset, next with the snapshot for continuation; full: true returns the full queryResult when the scope is one package. Every row carries provenance (CLIR nodes); an empty answer carries the explain funnel (emptyAt names the clause); errors carry LDC-Qxxxx codes with hints; a source product too wide is refused before execution (QUERY_TOO_BROAD), a continuation on another snapshot as SNAPSHOT_CHANGED.
Schema valid · SHA-256 cbe161c1de8c…
View input schema
{
"type": "object",
"properties": {
"arguments": {
"description": "the question parameters: an object of name → string (predicate, node, type — URNs; pkg — a package.name or a glob)",
"type": "object"
},
"case": {
"description": "the case for query-over; it replaces the case clause",
"type": "object"
},
"corpus": {
"description": "the snapshot scope: a package.name (for example kz.corpus.labour_code) or a glob over package.name; without corpus, the whole profile slice",
"type": "string"
},
"engine": {
"default": "lawc",
"description": "there is one engine — the core; the reference implementation is called by its own command",
"enum": [
"lawc"
]
},
"full": {
"description": "return the full queryResult instead of a page; only when the scope is one package",
"type": "boolean"
},
"limit": {
"description": "an explicit cap on eval() materialisations (it does NOT bound the rows — see rowLimit)",
"minimum": 1,
"type": "integer"
},
"query": {
"description": "inline LawQL",
"type": "string"
},
"question": {
"description": "the name of a question from the named-query catalog (producers, readers, anchors-of, imports-of, links-of, type-step) or of a lint; instead of query",
"type": "string"
},
"rowLimit": {
"description": "how many rows in structuredContent (20; the budget may lower it)",
"maximum": 5000,
"minimum": 1,
"type": "integer"
},
"rowOffset": {
"description": "from which row (0); continuation comes from next together with snapshot; structural queries only",
"minimum": 0,
"type": "integer"
},
"snapshot": {
"description": "the snapshot hash from next.snapshot of the previous page: a continuation on another snapshot is refused (SNAPSHOT_CHANGED)",
"type": "string"
}
},
"required": [],
"additionalProperties": false
}