Type Alias: TermWriteErrorCode
@kortexya/reasoninglayer / TermWriteErrorCode
Type Alias: TermWriteErrorCode
Section titled “Type Alias: TermWriteErrorCode”TermWriteErrorCode =
"write_creates_rule"|"governed_sort_write_refused"
Defined in: src/types/terms.ts:617
The code of a coded refusal that a term write door answers.
Remarks
Section titled “Remarks”write_creates_rule(422) — the write carries a non-empty list under the featurewhen, which would make the term a RULE. Create a rule throughclient.inference(the rule routes) or OSFQLDERIVE. A scalarwhenis ordinary data.governed_sort_write_refused(409) — the term’s sort is@governed, or descends from a governed sort: its terms are written and removed only by the engine, for every caller.POST,PUT,PATCHandDELETEon/api/v1/termsanswer it, and so does a bulk retract with a governed member; nothing is applied.
Read either code with errorBodyCode(error). For write_creates_rule,
POST /api/v1/terms, PUT /api/v1/terms/{id} and
POST /api/v1/inference/facts answer an ApiError (status 422); a bulk
write does not throw it:
bulkCreateTerms names the row in BulkRefusedError.rows with
feature: 'when', and bulkAddFacts lists the fact in rejected with the
same message.
Example
Section titled “Example”const code: TermWriteErrorCode = 'write_creates_rule';