Liking cljdoc? Tell your friends :D

precept.util


add-to-unique-index!clj/s

(add-to-unique-index! fact ks)

Prepreds :unique to keyseq path in second argument. Overwrites existing value and returns it if found.

Prepreds :unique to keyseq path in second argument. Overwrites existing value and returns it if
found.
sourceraw docstring

any-Tuple?clj/s

(any-Tuple? x)
source

check-unique-conflictclj/s

(check-unique-conflict fact ks)
source

clara-tups->mapsclj/s

(clara-tups->maps tups)

Takes seq of ms with keys :?e :?a :?v, joins on :?e and returns vec of ms (one m for each entity)

Takes seq of ms with keys :?e :?a :?v, joins on :?e and returns
vec of ms (one m for each entity)
sourceraw docstring

conflicting-logical-fact-errorclj/s

(conflicting-logical-fact-error facts to-insert to-retract)
source (clj)source (cljs)

conform-insertions-and-retractions!clj/s

(conform-insertions-and-retractions! facts)
source

dissoc-inclj/s

(dissoc-in m [k & ks :as keys])

Dissociates an entry from a nested associative structure returning a new nested structure. keys is a sequence of keys. Any empty maps that result will not be present in the new structure.

Dissociates an entry from a nested associative structure returning a new
nested structure. keys is a sequence of keys. Any empty maps that result
will not be present in the new structure.
sourceraw docstring

entity-map->Tuplesclj/s

(entity-map->Tuples m)

Transforms entity map to Tuple record {a1 v1 a2 v2 :db/id eid} -> [(Tuple eid a1 v1 t)...]

Transforms entity map to Tuple record
{a1 v1 a2 v2 :db/id eid} -> [(Tuple eid a1 v1 t)...]
sourceraw docstring

entity-Tuples->entity-mapsclj/s

(entity-Tuples->entity-maps coll)
source

fact-index-pathclj/s

(fact-index-path fact)

Returns path to store and access a fact in fact-index according to the fact's cardinality, uniqueness

Returns path to store and access a fact in fact-index according to the fact's cardinality,
uniqueness
sourceraw docstring

fact-index-pathsclj/s

(fact-index-paths fact)

Returns all index paths for a given fact as [[]...]

Returns all index paths for a given fact as [[]...]
sourceraw docstring

find-sub-by-nameclj/s

(find-sub-by-name name)
source

gen-Tuples-from-mapclj/s

(gen-Tuples-from-map m)
source

get-index-ofclj/s

(get-index-of coll x not-found-idx)
source

guidclj/s

(guid)
source

insertclj/s

(insert session facts)

Inserts facts from outside rule context. Accepts [e a v], [[e a v]...], {}, [{}...], where {} is a Datomic-style entity map

Inserts facts from outside rule context.
Accepts `[e a v]`, `[[e a v]...]`, `{}`, `[{}...]`, where `{}` is a Datomic-style entity map
sourceraw docstring

insert!clj/s

(insert! facts)

Insert facts logically within rule context

Insert facts logically within rule context
sourceraw docstring

insert-unconditional!clj/s

(insert-unconditional! facts)

Insert facts unconditionally within rule context

Insert facts unconditionally within rule context
sourceraw docstring

insertableclj/s

(insertable x)

Arguments can be any mixture of vectors and records Ensures [], [[]...], Tuple, '(Tuple ...) conform to Tuple record instances.

Arguments can be any mixture of vectors and records
Ensures [], [[]...], Tuple, '(Tuple ...) conform to Tuple record instances.
sourceraw docstring

key-byclj/s

(key-by f coll)
source

make-activation-group-fnclj/s

(make-activation-group-fn default-group)

Reads from optional third argument to rule. :super - boolean :group - keyword :salience - number Rules marked :super are given the highest priority.

Reads from optional third argument to rule.
`:super` - boolean
`:group` - keyword
`:salience` - number
 Rules marked `:super` are given the highest priority.
sourceraw docstring

make-activation-group-sort-fnclj/s

(make-activation-group-sort-fn groups default-group)
source

make-ancestors-fnclj/s

(make-ancestors-fn)
(make-ancestors-fn hierarchy)
(make-ancestors-fn hierarchy root-fact-type)

Returns a set. To be used when defining a session. Stored in atom for auto truth maintenance and schema enforcement.

Returns a set. To be used when defining a session. Stored in atom for auto truth maintenance
and schema enforcement.
sourceraw docstring

map->tuplesclj/s

(map->tuples m)

Transforms entity map to vector of tuples {a1 v1 a2 v2 :db/id eid} -> [[eid a1 v1]...]

Transforms entity map to vector of tuples
{a1 v1 a2 v2 :db/id eid} -> [[eid a1 v1]...]
sourceraw docstring

map-of-refs?clj/s

(map-of-refs? schemas x)

Returns true if every k is db.type/ref according to a schema

Returns true if every k is db.type/ref according to a schema
sourceraw docstring

next-fact-id!clj/s

(next-fact-id!)
source

record->mapclj/s

(record->map x)
source

record->vecclj/s

(record->vec r)
source

remove-fact-from-index!clj/s

(remove-fact-from-index! fact)
(remove-fact-from-index! fact paths)

Removes fact from all indexed locations according to schema if the indexed value is identical to the fact argument. Returns [bool...] indicating successful removal from each indexed location.

Removes fact from all indexed locations according to schema if the indexed value is identical
to the `fact` argument.
Returns `[bool...]` indicating successful removal from each indexed location.
sourceraw docstring

remove-from-fact-index!clj/s

(remove-from-fact-index! fact ks)

Removes fact from single path in index, returning a retract instruction if an exact match was found

Removes fact from single path in index, returning a retract instruction if an exact match
was found
sourceraw docstring

remove-rulegen-factsclj/s

(remove-rulegen-facts xs)
source

reset-fact-id!clj/s

(reset-fact-id!)
source

retractclj/s

(retract session facts)

Retract from outside rule context.

Retract from outside rule context.
sourceraw docstring

retract!clj/s

(retract! facts)

Wrapper around Clara's retract!. Use within RHS of rule only. Requires a fact that includes a fact-id produced by matching on a whole fact. e.g. ?fact in [?fact <- [?e :attr ?v]

Wrapper around Clara's `retract!`. Use within RHS of rule only.
Requires a fact that includes a fact-id produced by matching on a whole fact.
e.g. `?fact` in `[?fact <- [?e :attr ?v]`
sourceraw docstring

rulegen-fact-nsesclj/s

source

rulegen-fact?clj/s

(rulegen-fact? a)
source

rules-in-nsclj/s

(rules-in-ns ns-sym)
source

schema-enforcement-dtoclj/s

(schema-enforcement-dto inserted retracted index-path)
source

split-head-bodyclj/s

(split-head-body rule)

Takes macro body of a define and returns map of :head, :body

Takes macro body of a define and returns map of :head, :body
sourceraw docstring

thirdclj/s

(third xs)
source

traceclj/s

(trace & args)
source

Tuplecljs

source

tuple-entity->hash-map-entityclj/s

(tuple-entity->hash-map-entity tuples)

Takes list of tuples for a single entity and returns single map

Takes list of tuples for a *single* entity and returns single map
sourceraw docstring

Tuples->mapsclj/s

(Tuples->maps xs)
(Tuples->maps xs ancestry)
source

tuplize-into-vecclj/s

(tuplize-into-vec x)

Returns [[]...]. Arg may be {} [{}...] [] [[]...]

Returns [[]...].
Arg may be {} [{}...] [] [[]...]
sourceraw docstring

unknown-ancestry-errorclj/s

(unknown-ancestry-error fact ancestry)
source

update-index!clj/s

(update-index! fact)
(update-index! fact ks)

Primary function that updates fact-index. Requires fact to index. Generates key-seq to path in index.

Primary function that updates fact-index. Requires fact to index. Generates key-seq
to path in index.
sourceraw docstring

update-unique-index!clj/s

(update-unique-index! fact ks)
source

upsert-fact-index!clj/s

(upsert-fact-index! fact ks)

Writes value to path in ks. Returns existing fact to retract if overwriting.

Writes value to path in ks. Returns existing fact to retract if overwriting.
sourceraw docstring

upsert-unique-index!clj/s

(upsert-unique-index! fact ks)
source

vec->recordclj/s

(vec->record vec)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close