Interface: LtnQueryRequest
@kortexya/reasoninglayer / LtnQueryRequest
Interface: LtnQueryRequest
Section titled “Interface: LtnQueryRequest”Defined in: src/types/ltn.ts:155
A tagged-union query over a grounded LTN theory.
Remarks
Section titled “Remarks”kind selects the query; the fields each kind needs are validated server-side:
ground— requirespredicateplus either an explicitfeaturesvector orfeature_text(embedded via the configured embedding backend).truth/value— requirerules.generalisation— requiresinstances;sortandcertaintydescribe the formula.
Example
Section titled “Example”const request: LtnQueryRequest = { kind: 'truth', rules: [{ individual: 'rex', sort: 'dog', membership: 0.9 }], aggregator: { kind: 'p_mean_error', p: 2 },};Properties
Section titled “Properties”aggregator?
Section titled “aggregator?”
optionalaggregator?:LtnAggregator|null
Defined in: src/types/ltn.ts:159
KB-level aggregator (truth, generalisation). Absent ⇒ pMeanError(p = 2).
certainty?
Section titled “certainty?”
optionalcertainty?:number|null
Defined in: src/types/ltn.ts:164
The formula’s certainty (generalisation).
Default Value
Section titled “Default Value”1.0features?
Section titled “features?”
optionalfeatures?:number[] |null
Defined in: src/types/ltn.ts:171
An explicit input feature vector for the queried individual (ground).
featureText?
Section titled “featureText?”
optionalfeatureText?:LtnFeatureText[] |null
Defined in: src/types/ltn.ts:169
Ψ-term feature text to embed into the input vector when features is absent
and an embedding backend is configured (ground).
instances?
Section titled “instances?”
optionalinstances?:LtnInstance[] |null
Defined in: src/types/ltn.ts:173
The unseen instances to score (generalisation).
kind:
LtnQueryKind
Defined in: src/types/ltn.ts:157
Which query to answer.
predicate?
Section titled “predicate?”
optionalpredicate?:string|null
Defined in: src/types/ltn.ts:175
The neural predicate name (ground).
rules?
Section titled “rules?”
optionalrules?:LtnRule[] |null
Defined in: src/types/ltn.ts:177
The formula’s rules (truth, value).
optionalsort?:string|null
Defined in: src/types/ltn.ts:179
The formula’s sort, by name (generalisation). Absent ⇒ the root sort.