Skip to content

Interface: LtnQueryRequest

@kortexya/reasoninglayer


@kortexya/reasoninglayer / LTN / LtnQueryRequest

Interface: LtnQueryRequest

Defined in: src/types/ltn.ts:155

A tagged-union query over a grounded LTN theory.

Remarks

kind selects the query; the fields each kind needs are validated server-side:

  • ground — requires predicate plus either an explicit features vector or feature_text (embedded via the configured embedding backend).
  • truth / value — require rules.
  • generalisation — requires instances; sort and certainty describe the formula.

Example

const request: LtnQueryRequest = {
kind: 'truth',
rules: [{ individual: 'rex', sort: 'dog', membership: 0.9 }],
aggregator: { kind: 'p_mean_error', p: 2 },
};

Properties

aggregator?

optional aggregator: LtnAggregator | null

Defined in: src/types/ltn.ts:159

KB-level aggregator (truth, generalisation). Absent ⇒ pMeanError(p = 2).


certainty?

optional certainty: number | null

Defined in: src/types/ltn.ts:164

The formula’s certainty (generalisation).

Default Value

1.0

features?

optional features: number[] | null

Defined in: src/types/ltn.ts:171

An explicit input feature vector for the queried individual (ground).


featureText?

optional featureText: 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?

optional instances: LtnInstance[] | null

Defined in: src/types/ltn.ts:173

The unseen instances to score (generalisation).


kind

kind: LtnQueryKind

Defined in: src/types/ltn.ts:157

Which query to answer.


predicate?

optional predicate: string | null

Defined in: src/types/ltn.ts:175

The neural predicate name (ground).


rules?

optional rules: LtnRule[] | null

Defined in: src/types/ltn.ts:177

The formula’s rules (truth, value).


sort?

optional sort: string | null

Defined in: src/types/ltn.ts:179

The formula’s sort, by name (generalisation). Absent ⇒ the root sort.