A thin EDN-over-HTTP client for the vaelii daemon (vaelii.serve). Runs no engine:
it POSTs {:op :args} and reads the result back, over JDK java.net.http (no
dependency — JDK 21 ships it).
Every call threads an explicit connection handle as its first argument —
(query conn '(dog ?x) 'Ctx) — the network mirror of vaelii.core's explicit-kb
API. A conn from client holds a reusable HttpClient; no socket opens until a
call. A daemon reply of {:ok false} becomes an ex-info carrying the daemon's
:error and :type, so a remote naming or disjointness refusal surfaces like a
local one.
Public because a client is a thing applications write against; the implementation is
vaelii.impl.client, which is free to change. Result shapes are vaelii.core's: a
sentex comes back as a plain map (the daemon projects the record), a solution as a
binding map.
A thin EDN-over-HTTP client for the vaelii daemon (`vaelii.serve`). Runs no engine:
it POSTs `{:op :args}` and reads the result back, over JDK `java.net.http` (no
dependency — JDK 21 ships it).
Every call threads an **explicit connection handle** as its first argument —
`(query conn '(dog ?x) 'Ctx)` — the network mirror of `vaelii.core`'s explicit-`kb`
API. A `conn` from `client` holds a reusable `HttpClient`; no socket opens until a
call. A daemon reply of `{:ok false}` becomes an `ex-info` carrying the daemon's
`:error` and `:type`, so a remote naming or disjointness refusal surfaces like a
local one.
Public because a client is a thing applications write against; the implementation is
`vaelii.impl.client`, which is free to change. Result shapes are `vaelii.core`'s: a
sentex comes back as a plain map (the daemon projects the record), a solution as a
binding map.(ask conn goal)(ask conn goal context)The first solution for goal, or nil.
The first solution for `goal`, or nil.
(ask? conn goal)(ask? conn goal context)Whether goal has any solution.
Whether `goal` has any solution.
(assert conn sentence context)(assert conn sentence context opts)Assert sentence in context (optional opts) — returns the handle(s). Bare —
no ! — for vaelii.core/assert's reason: additive, and retract! takes it back.
Assert `sentence` in `context` (optional `opts`) — returns the handle(s). Bare — no `!` — for `vaelii.core/assert`'s reason: additive, and `retract!` takes it back.
(assert-many conn sentences context)(assert-many conn sentences context opts)Assert every sentence in sentences into context, as one call.
Assert every sentence in `sentences` into `context`, as one call.
(assert-rule conn antecedents consequent context)(assert-rule conn antecedents consequent context opts)Assert a rule from antecedents to consequent in context — returns the
handle(s); a conjunctive consequent yields one handle per conjunct.
Assert a rule from `antecedents` to `consequent` in `context` — returns the handle(s); a conjunctive consequent yields one handle per conjunct.
(call conn op args)POST {:op op :args args} and return the :result, or throw ex-info on an
{:ok false} reply. The low-level entry the wrappers below use; reach for it for
an op with no wrapper yet — vaelii.serve/ops is the reachable set.
POST `{:op op :args args}` and return the `:result`, or throw `ex-info` on an
`{:ok false}` reply. The low-level entry the wrappers below use; reach for it for
an op with no wrapper yet — `vaelii.serve/ops` is the reachable set.(client host port)(client host port opts)A connection handle to a daemon at host:port (opts: :timeout-ms, default
30000). Holds a reusable HttpClient; no network happens until a call.
A connection handle to a daemon at `host`:`port` (opts: `:timeout-ms`, default 30000). Holds a reusable `HttpClient`; no network happens until a call.
(conflicts conn)The KB's current conflicts.
The KB's current conflicts.
(contexts conn)Every context the KB holds.
Every context the KB holds.
(contradictions conn)The coexisting P/¬P dilemmas.
The coexisting P/¬P dilemmas.
(find-sentexes conn term)Every sentex containing term.
Every sentex containing `term`.
(genls conn t)The types t is a subtype of, transitively.
The types `t` is a subtype of, transitively.
(handle-of conn sentence context)The handle for sentence in context, or nil.
The handle for `sentence` in `context`, or nil.
(health conn)The daemon's liveness reply, {:ok true} — a GET, so it needs no op.
The daemon's liveness reply, `{:ok true}` — a GET, so it needs no op.
(in? conn handle)Whether the sentex handle names is currently believed.
Whether the sentex `handle` names is currently believed.
(isa? conn x t)(isa? conn x t context)Whether individual x is of type t, through the genl closure.
Whether individual `x` is of type `t`, through the `genl` closure.
(provable? conn goal)(provable? conn goal context)Whether goal is provable.
Whether `goal` is provable.
(prove conn goal)(prove conn goal context)A proof tree for goal, as data.
A proof tree for `goal`, as data.
(query conn goal)(query conn goal context)(query conn goal context opts)Solutions for goal as binding maps — ({?x Fido}).
Solutions for `goal` as binding maps — `({?x Fido})`.
(retract! conn handle)Retract the sentex handle names, tearing down what it solely supported.
Retract the sentex `handle` names, tearing down what it solely supported.
(sentex conn handle)The sentex handle names, as a map.
The sentex `handle` names, as a map.
(sentexes-matching conn sentence)(sentexes-matching conn sentence context)The believed sentexes matching sentence (a pattern may carry ?vars), as maps.
The believed sentexes matching `sentence` (a pattern may carry `?vars`), as maps.
(specs conn t)The types that are subtypes of t, transitively.
The types that are subtypes of `t`, transitively.
(types-of conn x)(types-of conn x context)The types individual x belongs to.
The types individual `x` belongs to.
(violations conn)The recorded definitional violations.
The recorded definitional violations.
(why conn handle)Why the sentex handle names is believed — its supporting justifications, as data.
Why the sentex `handle` names is believed — its supporting justifications, as data.
(why-not conn handle)(why-not conn sentence context)Why a sentence is not believed, by handle or by sentence and context.
Why a sentence is *not* believed, by handle or by sentence and context.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |