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.
(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 & options)
(join-patterns G__3012 G__3013 & rest3014)
Inputs: [graph patterns :- [Pattern] & options] Returns: Results
Joins the resolutions for a series of patterns into a single result.
Inputs: [graph patterns :- [Pattern] & 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
(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.
(select-planner options)
Inputs: [options]
Selects a query planner function
Inputs: [options] Selects a query planner function
(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