Type Alias: TermWriteErrorCode
@kortexya/reasoninglayer / TermWriteErrorCode
Type Alias: TermWriteErrorCode
Section titled “Type Alias: TermWriteErrorCode”TermWriteErrorCode =
"write_creates_rule"|"governed_sort_write_refused"|"reference_term_unknown"|"term_id_unavailable"|"engine_feature_write_refused"
Defined in: src/types/terms.ts:645
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.reference_term_unknown(422) — a feature references a term that does not exist, or one the caller’s Read grant does not show; both answer alike (reasoninglayer#1212).POST /api/v1/terms,PUT /api/v1/terms/{id}andPOST /api/v1/inference/factsanswer it; a bulk write names the row instead (BulkRowRefusal.code). Nothing is written.term_id_unavailable(409) — the explicitidof aPOST /api/v1/termsis held by a term the caller’s Read grant hides; the message names only that id, and nothing is written (reasoninglayer#1215). An RDF import or a SPARQLINSERT DATAthat names such a resource answers it too (error_typeon the SPARQL body). A frame comment whose id a term already holds answers it as well (409, #1265); name another id.engine_feature_write_refused(422) — the write names a feature only the engine writes: a runtime-record tag such as_pref_user, or bookkeeping such as_derived_by(reasoninglayer#1269).POSTandPUT /api/v1/terms,POST /api/v1/inference/factsand the agent-belief route answer it; abulkCreateTermsrow names the feature. No principal is exempt, and nothing is written.
Read any of these codes 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';