Built-in predicates or functions for Datalog query, i.e. used in q
Built-in predicates or functions for Datalog query, i.e. used in `q`
Predicate that is similar to Clojure and
e.g. [(and (= ?g "f"") (like ?n "A%""))]
Predicate that is similar to Clojure `and` e.g. [(and (= ?g "f"") (like ?n "A%""))]
Function similar to Clojure array-map
Function similar to Clojure `array-map`
Aggregation function that calculates the average.
Aggregation function that calculates the average.
Function similar to Clojure compare
Function similar to Clojure `compare`
Function similar to Clojure complement
Function similar to Clojure `complement`
Function similar to Clojure contains?
Function similar to Clojure `contains?`
(count-distinct coll)
Aggregation function that count the distinctive values of a collection.
Aggregation function that count the distinctive values of a collection.
(distinct coll)
Aggregation function that returns the distinctive values of a collection.
Aggregation function that returns the distinctive values of a collection.
Function similar to Clojure empty?
Function similar to Clojure `empty?`
Predicate similar to Clojure false?
Predicate similar to Clojure `false?`
(fulltext db query)
(fulltext db arg1 arg2)
(fulltext db arg1 arg2 arg3)
Function that does fulltext search. Returns matching datoms in the form of [e a v] for convenient vector destructuring.
The last argument of the 4 arity function is the search option map. See [[datalevin.core.search]].
When neither an attribute nor a :domans
is specified, a full DB search
is performed.
For example:
Full DB search: [(fulltext $ "red") [[?e ?a ?v]]]
Attribute specific search: [(fulltext $ :color "red") [[?e ?a ?v]]]
Domain specific search:
[(fulltext $ "red" {:domains ["color"]} [[?e ?a ?v]])]
Function that does fulltext search. Returns matching datoms in the form of [e a v] for convenient vector destructuring. The last argument of the 4 arity function is the search option map. See [[datalevin.core.search]]. When neither an attribute nor a `:domans` is specified, a full DB search is performed. For example: * Full DB search: `[(fulltext $ "red") [[?e ?a ?v]]]` * Attribute specific search: `[(fulltext $ :color "red") [[?e ?a ?v]]]` * Domain specific search: `[(fulltext $ "red" {:domains ["color"]} [[?e ?a ?v]])]`
(get-else db e a else-val)
Function. Return the value of attribute a
of entity e
, or else-val
if
it doesn't exist. e.g. [(get-else $ ?a :artist/name "N/A") ?name]
Function. Return the value of attribute `a` of entity `e`, or `else-val` if it doesn't exist. e.g. `[(get-else $ ?a :artist/name "N/A") ?name]`
(get-some db e & as)
Function. Takes a DB, an entity, and one or more cardinality one attributes,
return a tuple of the first found attribute and its value. e.g.
[(get-some $ ?e :country :artist :book) [?attr ?val]]
Function. Takes a DB, an entity, and one or more cardinality one attributes, return a tuple of the first found attribute and its value. e.g. `[(get-some $ ?e :country :artist :book) [?attr ?val]]`
Function. Same as Clojure identity
. E.g.
[(ground [:a :e :i :o :u]) [?vowel ...]]
Function. Same as Clojure `identity`. E.g. `[(ground [:a :e :i :o :u]) [?vowel ...]]`
Function similar to Clojure hash-map
Function similar to Clojure `hash-map`
Predicate similar to Clojure identical?
Predicate similar to Clojure `identical?`
Function similar to Clojure identity
Function similar to Clojure `identity`
(in input coll)
(in input coll not?)
Predicate similar to IN
in SQL, e.g.
[(in ?name ["Smith" "Cohen" "Doe"])]
Predicate similar to `IN` in SQL, e.g. `[(in ?name ["Smith" "Cohen" "Doe"])]`
Function similar to Clojure keyword
Function similar to Clojure `keyword`
(like input pattern)
(like input pattern opts)
(like input pattern {:keys [escape]} not?)
Predicate similar to LIKE
in SQL, e.g. [(like ?name "%Smith")]
Predicate similar to `LIKE` in SQL, e.g. `[(like ?name "%Smith")]`
Aggregation function that calculates the median.
Aggregation function that calculates the median.
(missing? db e a)
Predicate that returns true if the entity has no value for the attribute in DB e.g. [(missing? $ ?e :sales)]
Predicate that returns true if the entity has no value for the attribute in DB e.g. [(missing? $ ?e :sales)]
Function similar to Clojure namespace
Function similar to Clojure `namespace`
Function similar to Clojure not-empty
Function similar to Clojure `not-empty`
(not-in input coll)
Predicate similar to NOT IN
in SQL,
e.g. [(not-in ?name ["Smith" "Cohen" "Doe"])]
Predicate similar to `NOT IN` in SQL, e.g. `[(not-in ?name ["Smith" "Cohen" "Doe"])]`
(not-like input pattern)
(not-like input pattern opts)
Predicate similar to NOT LIKE
in SQL, e.g. [(no-like ?name "%Smith")]
Predicate similar to `NOT LIKE` in SQL, e.g. `[(no-like ?name "%Smith")]`
Predicate that is similar to Clojure or
e.g. [(or (= ?g "f"") (like ?n "A%""))]
Predicate that is similar to Clojure `or` e.g. [(or (= ?g "f"") (like ?n "A%""))]
Function similar to Clojure print-str
Function similar to Clojure `print-str`
Function similar to Clojure println-str
Function similar to Clojure `println-str`
Function similar to Clojure prn-str
Function similar to Clojure `prn-str`
Function similar to Clojure rand-int
Function similar to Clojure `rand-int`
Function similar to Clojure re-find
Function similar to Clojure `re-find`
Function similar to Clojure re-matches
Function similar to Clojure `re-matches`
Function similar to Clojure re-pattern
Function similar to Clojure `re-pattern`
Function similar to Clojure re-seq
Function similar to Clojure `re-seq`
(sample n coll)
Aggregation function that randomly sample from a collection.
Aggregation function that randomly sample from a collection.
Aggregation function that calculates the stddev.
Aggregation function that calculates the stddev.
Aggregation function that adds up collection
Aggregation function that adds up collection
Function similar to Clojure identity
Function similar to Clojure `identity`
Aggregation function that calculates the variance.
Aggregation function that calculates the variance.
(vec-neighbors db query)
(vec-neighbors db arg1 arg2)
(vec-neighbors db arg1 arg2 arg3)
Function that does vector similarity search. Returns matching datoms in the form of [e a v] for convenient vector destructuring.
The last argument of the 4 arity function is the search option map. See [[datalevin.core.search-vec]].
When neither an attribute nor a :domains
is specified, an exception will
be thrown.
For example:
Attribute specific search:
[(vec-neighbors $ :color ?query-vec) [[?e ?a ?v]]]
Domain specific search:
[(vec-neighbors $ ?query-vec {:domains ["color"]} [[?e ?a ?v]])]
Function that does vector similarity search. Returns matching datoms in the form of [e a v] for convenient vector destructuring. The last argument of the 4 arity function is the search option map. See [[datalevin.core.search-vec]]. When neither an attribute nor a `:domains` is specified, an exception will be thrown. For example: * Attribute specific search: `[(vec-neighbors $ :color ?query-vec) [[?e ?a ?v]]]` * Domain specific search: `[(vec-neighbors $ ?query-vec {:domains ["color"]} [[?e ?a ?v]])]`
Function similar to Clojure vector
Function similar to Clojure `vector`
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close