Liking cljdoc? Tell your friends :D

cascalog.logic.parse


<-cljmacro

(<- outvars & predicates)

Constructs a query or predicate macro from a list of predicates. Predicate macros support destructuring of the input and output variables.

Constructs a query or predicate macro from a list of
predicates. Predicate macros support destructuring of the input and
output variables.
raw docstring

add-ops-fixed-pointclj

(add-ops-fixed-point tail)

Adds operations to tail until can't anymore. Returns new tail and any unapplied operations.

Adds operations to tail until can't anymore. Returns new tail and
any unapplied operations.
raw docstring

aggregation-assertions!clj

(aggregation-assertions! buffers aggs options)

apply-equality-opsclj

(apply-equality-ops tail equality-pairs)

Accepts a TailStruct instance and a sequence of pairs of input variables, and applies an equality filter for every pair.

Accepts a TailStruct instance and a sequence of pairs of input
variables, and applies an equality filter for every pair.
raw docstring

attempt-joinclj

(attempt-join tails options)

Attempt to reduce the supplied set of tails by joining.

Attempt to reduce the supplied set of tails by joining.
raw docstring

build-agg-tailclj

(build-agg-tail tail aggs grouping-fields options)

build-queryclj

(build-query output-fields raw-predicates)

build-ruleclj

(build-rule {:keys [fields predicates options] :as input})

chainclj

(chain tail f)

default-selectorclj

(default-selector op)

Default selector (either input or output) for this operation. Dispatches based on type.

Default selector (either input or output) for this
operation. Dispatches based on type.
raw docstring

desugar-selectorsclj

(desugar-selectors arg-m & sugar-full-pairs)

Accepts a map of cascalog input or output symbol (:< or :>, for example) to var sequence, a <sugary input or output selector> and a <full vector input or output selector> and either destructures the non-sugary input or moves the sugary input into its proper place. For example:

(desugar-selectors {:>> (["?a"])} :> :>>) ;=> {:>> ["?a"]}

(desugar-selectors {:> ["?a"] :<< [["?b"]]} :> :>> :< :<<) ;=> {:>> ["?a"], :<< ["?b"]}

Accepts a map of cascalog input or output symbol (:< or :>, for
 example) to var sequence, a <sugary input or output selector> and a
 <full vector input or output selector> and either destructures the
 non-sugary input or moves the sugary input into its proper
 place. For example:

(desugar-selectors {:>> (["?a"])} :> :>>)
;=> {:>> ["?a"]}

(desugar-selectors {:> ["?a"] :<< [["?b"]]} :> :>> :< :<<)
;=>  {:>> ["?a"], :<< ["?b"]}
raw docstring

existence-branch?clj


existence-fieldclj

(existence-field node)

Returns true if this location directly descends from an ExistenceNode, false otherwise. Short-circuits at any merge.

Returns true if this location directly descends from an
ExistenceNode, false otherwise. Short-circuits at any merge.
raw docstring

expand-outvarsclj

(expand-outvars {:keys [op input output] :as pred})

expand-positional-selectorclj

(expand-positional-selector arg-m)

Accepts a map of cascalog selector to var sequence and, if the map contains an entry for Cascalog's positional selector, expands out the proper number of logic vars and replaces each entry specified within the positional map. This function returns the updated map.

Accepts a map of cascalog selector to var sequence and, if the map
contains an entry for Cascalog's positional selector, expands out
the proper number of logic vars and replaces each entry specified
within the positional map. This function returns the updated map.
raw docstring

find-join-fieldsclj

(find-join-fields l r)

fixed-point-pruneclj

(fixed-point-prune base-necessary-fields ops-invar-fields ops)

Handle pruning chained operation

Handle pruning chained operation
raw docstring

grouping-inputclj

(grouping-input aggs sort-fields)

These are the operations that go into the aggregators.

These are the operations that go into the aggregators.
raw docstring

grouping-outputclj

(grouping-output aggs grouping-fields)

Returns the union of all grouping fields and all outputs for every aggregation field. These are the only fields available after the aggregation.

Returns the union of all grouping fields and all outputs for every
aggregation field. These are the only fields available after the
aggregation.
raw docstring

IApplyToTailcljprotocol

accept?clj

(accept? this tail)

Returns true if this op can be applied to the current tail

Returns true if this op can be applied to the current tail

apply-to-tailclj

(apply-to-tail this tail)

Accepts a tail and performs some modification on that tail, returning a new tail.

Accepts a tail and performs some modification on that tail,
returning a new tail.

initial-tailsclj

(initial-tails generators operations)

Builds up a sequence of tail structs from the supplied generators and operations.

Builds up a sequence of tail structs from the supplied generators
and operations.
raw docstring

INumOutFieldscljprotocol

num-out-fieldsclj

(num-out-fields _)

IOutputFieldscljprotocol

get-out-fieldsclj

(get-out-fields _)

Get the fields of a generator.

Get the fields of a generator.

ISelectFieldscljprotocol

select-fieldsclj

(select-fields gen fields)

Select fields of a named generator.

Example: (<- [?a ?b ?sum] (+ ?a ?b :> ?sum) ((select-fields generator ["?a" "?b"]) ?a ?b))

Select fields of a named generator.

Example:
(<- [?a ?b ?sum]
    (+ ?a ?b :> ?sum)
    ((select-fields generator ["?a" "?b"]) ?a ?b))

joinable?clj

(joinable? tail joinfields)

Returns true if the supplied tail can be joined with the supplied join fields, false otherwise.

A join works if the join fields are all available in the given tail AND the tail's either fully ground, or every non-join variable is unground.

Returns true if the supplied tail can be joined with the supplied
join fields, false otherwise.

A join works if the join fields are all available in the given tail
AND the tail's either fully ground, or every non-join variable is
unground.
raw docstring

maximal-joinclj

(maximal-join tail-seq)

Returns the between the two generators with the largest intersection of joinable fields.

Returns the between the two generators with the largest
intersection of joinable fields.
raw docstring

merge-tailsclj

(merge-tails tails options)

The first call begins with a bunch of generator tails, each with a list of operations that could be applied. Based on the op-allowed logic, these tails try to consume as many operations as possible before giving up at a fixed point.

The first call begins with a bunch of generator tails, each with a
list of operations that could be applied. Based on the op-allowed
logic, these tails try to consume as many operations as possible
before giving up at a fixed point.
raw docstring

necessary-opsclj

(necessary-ops necessary-fields ops)

Return only operations whose outvars intersect with necessary-fields

Return only operations whose outvars intersect with necessary-fields
raw docstring

op-allowed?clj

(op-allowed? {:keys [ground? available-fields node]} op)

An operation can be applied to a tail if all of the following conditions apply:

  • It only consumes fields that are available in the supplied TailStruct,

  • It's a filter (or the branch is NOT a GeneratorSet)

  • It only consumes ground variables (or the generator itself is ground)

An operation can be applied to a tail if all of the following
conditions apply:

- It only consumes fields that are available in the supplied
TailStruct,

- It's a filter (or the branch is NOT a GeneratorSet)

- It only consumes ground variables (or the generator itself is
ground)
raw docstring

parse-exec-argsclj

(parse-exec-args [f & rest :as args])

Accept a sequence of (maybe) string and other items and returns a vector of [theString or "", [other items]].

Accept a sequence of (maybe) string and other items and returns a
vector of [theString or "", [other items]].
raw docstring

parse-subqueryclj

(parse-subquery output-fields raw-predicates)

Parses predicates and output fields and returns a proper subquery.

Parses predicates and output fields and returns a proper subquery.
raw docstring

parse-variablesclj

(parse-variables vars default-selector)

parses variables of the form ['?a' '?b' :> '!!c'] and returns a map of input variables, output variables, If there is no :>, defaults to selector-default.

parses variables of the form ['?a' '?b' :> '!!c'] and returns a map
of input variables, output variables, If there is no :>, defaults
to selector-default.
raw docstring

prefer-filterclj

(prefer-filter op)

prepare-operationclj

(prepare-operation op tail)

When an operation produces fields that are already present in the tail, this is interpreted as an implicit filter against the existing values. This function accepts an operation and a TailStruct and returns a sequence of all pairs of output variable substitutions, plus a new operation with output fields swapped as necessary

When an operation produces fields that are already present in the
tail, this is interpreted as an implicit filter against the existing
values. This function accepts an operation and a TailStruct and
returns a sequence of all pairs of output variable substitutions,
plus a new operation with output fields swapped as necessary
raw docstring

prepare-subqueryclj

(prepare-subquery output-fields raw-predicates)

projectclj

(project tail fields)

projection-inputclj

(projection-input aggs grouping-fields options)

These are the fields that go into a projection.

These are the fields that go into a projection.
raw docstring

prune-operationsclj

(prune-operations fields grouped options)

Remove non-generator & non-filter operations whose outvar(s) is not used, i.e., when the outvar(s) do not intersect with the query's out-fields, generators outvars (for joins), invars of other operations, and :sort option. Additionally, do not prune operations if a no-input operator exists

Remove non-generator & non-filter operations whose outvar(s) is not used, i.e., when the outvar(s)
do *not* intersect with the query's out-fields, generators outvars (for joins), invars of other operations,
and :sort option. Additionally, do not prune operations if a no-input operator exists
raw docstring

query-signature?clj

(query-signature? vars)

Accepts the normalized return vector of a Cascalog form and returns true if the return vector is from a subquery, false otherwise. (A predicate macro would trigger false, for example.)

Accepts the normalized return vector of a Cascalog form and returns
true if the return vector is from a subquery, false otherwise. (A
predicate macro would trigger false, for example.)
raw docstring

renameclj

(rename tail fields)

select-joinclj

(select-join tails)

Returns the join fields that will join the maximum number of fields at a time. If the search fails, select-join throws.

This is unoptimal. It's better to rewrite this as a search problem to find optimal joins.

Returns the join fields that will join the maximum number of fields
at a time. If the search fails, select-join throws.

 This is unoptimal. It's better to rewrite this as a search problem
 to find optimal joins.
raw docstring

split-outvar-constantsclj

(split-outvar-constants output)

Accepts a sequence of output variables and returns a 2-vector:

[new-outputs, [seq-of-new-raw-predicates]]

By creating a new output predicate for every constant in the output field.

Accepts a sequence of output variables and returns a 2-vector:

[new-outputs, [seq-of-new-raw-predicates]]

By creating a new output predicate for every constant in the output
field.
raw docstring

tail-fields-intersectionclj

(tail-fields-intersection & tails)

tail?clj

Returns true if the supplied item is a TailStruct, false otherwise.

Returns true if the supplied item is a TailStruct, false
otherwise.
raw docstring

unground-assertions!clj

(unground-assertions! gens ops)

Performs various validations on the supplied set of parsed predicates. If all validations pass, returns the sequence unchanged.

Performs various validations on the supplied set of parsed
predicates. If all validations pass, returns the sequence
unchanged.
raw docstring

unground-outvarsclj

(unground-outvars predicates)

For the supplied sequence of RawPredicate instances, returns a seq of all ungrounding vars in the output position.

For the supplied sequence of RawPredicate instances, returns a seq
of all ungrounding vars in the output position.
raw docstring

validate-aggregation!clj

(validate-aggregation! tail aggs options)

Makes sure that all fields are available for the aggregation.

Makes sure that all fields are available for the aggregation.
raw docstring

validate-generator-set!clj

(validate-generator-set! input output)

GeneratorSets can't be unground, ever.

GeneratorSets can't be unground, ever.
raw docstring

validate-predicates!clj

(validate-predicates! preds opts)

validate-projection!clj

(validate-projection! remaining-ops needed available)

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

× close