Implements a full query engine based on fully indexed data.
Implements a full query engine based on fully indexed data.
(add-to-graph graph data)
Inputs: [graph data :- Results]
Inputs: [graph data :- Results]
(binding-join graph part [expr bnd-var])
Inputs: [graph part :- Results [expr bnd-var] :- FilterPattern]
Binds a var and adds to results.
Inputs: [graph part :- Results [expr bnd-var] :- FilterPattern] Binds a var and adds to results.
(create-binding nm values)
Inputs: [nm :- InSpec values] Returns: Bindings
Creates a bindings between a name and a set of values. If the name is singular, then that name is bound to the values. If the name is a seq, then each name in the seq is bound to the corresponding offset in each value.
Inputs: [nm :- InSpec values] Returns: Bindings Creates a bindings between a name and a set of values. If the name is singular, then that name is bound to the values. If the name is a seq, then each name in the seq is bound to the corresponding offset in each value.
(create-bindings in values)
Inputs: [in :- [InSpec] values :- (s/cond-pre (s/protocol Storage) s/Any)] Returns: [(s/one Bindings "The bindings for other params") (s/one (s/maybe StorageType) "The default storage")]
Converts user provided data for a query into bindings
Inputs: [in :- [InSpec] values :- (s/cond-pre (s/protocol Storage) s/Any)] Returns: [(s/one Bindings "The bindings for other params") (s/one (s/maybe StorageType) "The default storage")] Converts user provided data for a query into bindings
(delete-from-graph graph data)
Inputs: [graph data :- Results]
Inputs: [graph data :- Results]
(disjunction graph part [_ & patterns])
Inputs: [graph part :- Results [_ & patterns]]
NOTE: This is a placeholder implementation. There is no optimization.
Inputs: [graph part :- Results [_ & patterns]] NOTE: This is a placeholder implementation. There is no optimization.
(filter-join graph part [fltr])
Inputs: [graph part :- Results [fltr] :- FilterPattern]
Filters down results.
Inputs: [graph part :- Results [fltr] :- FilterPattern] Filters down results.
(find-start pattern-counts patterns)
Inputs: [pattern-counts :- {EPVPattern s/Num} patterns :- [EPVPattern]] Returns: EPVPattern
Returns the first pattern with the smallest count
Inputs: [pattern-counts :- {EPVPattern s/Num} patterns :- [EPVPattern]] Returns: EPVPattern Returns the first pattern with the smallest count
(first-group* [fp & rp])
Inputs: [[fp & rp] :- [Pattern]] Returns: [(s/one [Pattern] "group") (s/one [Pattern] "remainder")]
Finds a group from a sequence of patterns. A group is defined by every pattern sharing at least one var with at least one other pattern. Returns a pair. The first returned element is the Patterns in the group, the second is what was left over.
Inputs: [[fp & rp] :- [Pattern]] Returns: [(s/one [Pattern] "group") (s/one [Pattern] "remainder")] Finds a group from a sequence of patterns. A group is defined by every pattern sharing at least one var with at least one other pattern. Returns a pair. The first returned element is the Patterns in the group, the second is what was left over.
(get-vars pattern)
Returns all vars used by a pattern
Returns all vars used by a pattern
(join-patterns graph patterns bindings & options)
(join-patterns G__3415 G__3416 G__3417 & rest3418)
Inputs: [graph patterns :- [Pattern] bindings :- [[s/Any]] & options] Returns: Results
Joins the resolutions for a series of patterns into a single result.
Inputs: [graph patterns :- [Pattern] bindings :- [[s/Any]] & options] Returns: Results Joins the resolutions for a series of patterns into a single result.
(left-join pattern results graph)
Joins a partial result (on the left) to a pattern (on the right). The pattern type will determine dispatch.
Joins a partial result (on the left) to a pattern (on the right). The pattern type will determine dispatch.
(merge-filters epv-patterns filter-patterns)
Inputs: [epv-patterns filter-patterns]
Merges filters into the sequence of patterns, so that they appear as soon as all their variables are first bound
Inputs: [epv-patterns filter-patterns] Merges filters into the sequence of patterns, so that they appear as soon as all their variables are first bound
(merge-ops patterns op-patterns)
Inputs: [patterns op-patterns]
Merges operator patterns into the sequence of patterns, so that they appear as soon as all their variables are first bound
Inputs: [patterns op-patterns] Merges operator patterns into the sequence of patterns, so that they appear as soon as all their variables are first bound
(min-join-path patterns count-map)
Inputs: [patterns :- [Pattern] count-map :- {EPVPattern s/Num}] Returns: [EPVPattern]
Calculates a plan based on no outer joins (a cross product), and minimized joins. A plan is the order in which to evaluate constraints and join them to the accumulated evaluated data. If it is not possible to create a path without a cross product, then return a plan of the patterns in the provided order.
Inputs: [patterns :- [Pattern] count-map :- {EPVPattern s/Num}] Returns: [EPVPattern] Calculates a plan based on no outer joins (a cross product), and minimized joins. A plan is the order in which to evaluate constraints and join them to the accumulated evaluated data. If it is not possible to create a path without a cross product, then return a plan of the patterns in the provided order.
(minus graph part [_ & patterns])
Inputs: [graph part :- Results [_ & patterns]]
Removes matches.
Inputs: [graph part :- Results [_ & patterns]] Removes matches.
(modify-pattern existing mapping pattern)
Inputs: [existing :- [Value] mapping :- #:s{Num s/Num} pattern :- EPVPattern] Returns: [s/Any]
Creates a new EPVPattern from an existing one, based on existing bindings. Uses the mapping to copy from columns in 'existing' to overwrite variables in 'pattern'. The variable locations have already been found and are in the 'mapping' argument
Inputs: [existing :- [Value] mapping :- #:s{Num s/Num} pattern :- EPVPattern] Returns: [s/Any] Creates a new EPVPattern from an existing one, based on existing bindings. Uses the mapping to copy from columns in 'existing' to overwrite variables in 'pattern'. The variable locations have already been found and are in the 'mapping' argument
(outer-product leftb rightb)
Inputs: [leftb :- Bindings rightb :- Bindings] Returns: Bindings
Creates an outer product between 2 sets of bindings
Inputs: [leftb :- Bindings rightb :- Bindings] Returns: Bindings Creates an outer product between 2 sets of bindings
(paths patterns pattern-counts)
Inputs: [patterns :- [EPVPattern] pattern-counts :- {EPVPattern s/Num}] Returns: [[EPVPattern]]
Returns a seq of all paths through the constraints. A path is defined by new patterns containing at least one variable common to the patterns that appeared before it. Patterns must form a group.
Inputs: [patterns :- [EPVPattern] pattern-counts :- {EPVPattern s/Num}] Returns: [[EPVPattern]] Returns a seq of all paths through the constraints. A path is defined by new patterns containing at least one variable common to the patterns that appeared before it. Patterns must form a group.
(pattern-left-join graph part pattern)
Inputs: [graph part :- Results pattern :- EPVPattern] Returns: Results
Takes a partial result, and joins on the resolution of a pattern
Inputs: [graph part :- Results pattern :- EPVPattern] Returns: Results Takes a partial result, and joins on the resolution of a pattern
(plan-path graph patterns options)
Inputs: [graph patterns :- [Pattern] options] Returns: [(s/one [Pattern] "Patterns in planned order") (s/one {EPVPattern Results} "Single patterns mapped to their resolutions")]
Determines the order in which to perform the elements that go into a query. Tries to optimize, so it uses the graph to determine some of the properties of the query elements. Options can describe which planner to use. Planning will determine the resolution map, and this is returned with the plan. By default the min-join-path function is used. This can be overriden with options: [:planner plan] The plan can be one of :user, :min. :min is the default. :user means to execute in provided order.
Inputs: [graph patterns :- [Pattern] options] Returns: [(s/one [Pattern] "Patterns in planned order") (s/one {EPVPattern Results} "Single patterns mapped to their resolutions")] Determines the order in which to perform the elements that go into a query. Tries to optimize, so it uses the graph to determine some of the properties of the query elements. Options can describe which planner to use. Planning will determine the resolution map, and this is returned with the plan. By default the min-join-path function is used. This can be overriden with options: [:planner plan] The plan can be one of :user, :min. :min is the default. :user means to execute in provided order.
(prebound-left-join part bindings)
Inputs: [part :- Results bindings :- Results] Returns: Results
Takes a bindings (Results) and joins on the current results
Inputs: [part :- Results bindings :- Results] Returns: Results Takes a bindings (Results) and joins on the current results
(select-planner options)
Inputs: [options]
Selects a query planner function
Inputs: [options] Selects a query planner function
(symb? s)
Inputs: [s]
Similar to symbol? but excludes the special ... form
Inputs: [s] Similar to symbol? but excludes the special ... form
(user-plan patterns _)
Inputs: [patterns :- [EPVPattern] _ :- {EPVPattern s/Num}] Returns: [EPVPattern]
Returns the original path specified by the user
Inputs: [patterns :- [EPVPattern] _ :- {EPVPattern s/Num}] Returns: [EPVPattern] Returns the original path specified by the user
(without e s)
Inputs: [e :- s/Any s :- [s/Any]] Returns: [s/Any]
Returns a sequence minus a specific element
Inputs: [e :- s/Any s :- [s/Any]] Returns: [s/Any] Returns a sequence minus a specific element
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close