Liking cljdoc? Tell your friends :D

zuko.projection

Projection functions

Projection functions
raw docstring

adorn-entitiesclj/s

(adorn-entities triples)

Inputs: [triples :- [Axiom]] Returns: [Axiom]

Marks new entities as Naga entities

Inputs: [triples :- [Axiom]]
Returns: [Axiom]

Marks new entities as Naga entities
sourceraw docstring

Axiomclj/s

source

dedupe-byclj/s

(dedupe-by pattern->data data)

Inputs: [pattern->data :- #:s{Num s/Num} data :- Results] Returns: Results

Removes duplicate rows, only considering the columns of the specified data for projection. This means the column keys for which the values are non-negative.

Inputs: [pattern->data :- #:s{Num s/Num} data :- Results]
Returns: Results

Removes duplicate rows, only considering the columns of the specified data for projection.
This means the column keys for which the values are non-negative.
sourceraw docstring

EntityPatternclj/s

source

EntityPropAxiomEltclj/s

source

EntityPropertyEltclj/s

source

EntityPropertyPatternclj/s

source

EntityPropValAxiomEltclj/s

source

EPVPatternclj/s

source

group-exists?clj/s

(group-exists? resolve-pattern-fn group)

Inputs: [resolve-pattern-fn group :- [Axiom]] Returns: [s/Any]

Determines if a group is instantiating a new piece of data, and if so checks if it already exists.

Inputs: [resolve-pattern-fn group :- [Axiom]]
Returns: [s/Any]

Determines if a group is instantiating a new piece of data,
 and if so checks if it already exists.
sourceraw docstring

insert-projectclj/s≠

clj
(insert-project store-fns patterns columns data)
(insert-project {:keys [resolve-pattern new-node node-label] :as store-fns}
                patterns
                vars-to-update
                columns
                data)
cljs
(insert-project G__18185 G__18186 G__18187 G__18188)
(insert-project G__18192 G__18193 G__18194 G__18195 G__18196)

Inputs: ([store-fns patterns :- [[s/Any]] columns :- [Symbol] data :- Results] [{:keys [resolve-pattern new-node node-label], :as store-fns} patterns :- [[s/Any]] vars-to-update :- #{Var} columns :- [Symbol] data :- Results]) Returns: Results

Similar to project, only the generated data will be in triples for insertion. If triples describe entities with existing dc/ident fields, then they will be dropped.

Inputs: ([store-fns patterns :- [[s/Any]] columns :- [Symbol] data :- Results] [{:keys [resolve-pattern new-node node-label], :as store-fns} patterns :- [[s/Any]] vars-to-update :- #{Var} columns :- [Symbol] data :- Results])
Returns: Results

Similar to project, only the generated data will be in triples for insertion.
 If triples describe entities with existing dc/ident fields, then they will be dropped.
sourceraw docstring

matching-varsclj/s

(matching-vars from to)

Inputs: [from :- [s/Any] to :- [Symbol]] Returns: #:s{Num s/Num}

Returns pairs of indexes into seqs where the vars match. For any variable that appears in both sequences, the column number in the 'from' parameter gets mapped to the column number of the same variable in the 'to' parameter.

Inputs: [from :- [s/Any] to :- [Symbol]]
Returns: #:s{Num s/Num}

Returns pairs of indexes into seqs where the vars match.
 For any variable that appears in both sequences, the column number in the
 'from' parameter gets mapped to the column number of the same variable
 in the 'to' parameter.
sourceraw docstring

new-nodesclj/s

(new-nodes offset-map)

Inputs: [offset-map :- #:s{Num s/Num}] Returns: [s/Num]

Returns all the new node references that appears in a map of offsets. Node references are negative numbers.

Inputs: [offset-map :- #:s{Num s/Num}]
Returns: [s/Num]

Returns all the new node references that appears in a map of offsets.
 Node references are negative numbers.
sourceraw docstring

offset-mappingsclj/s

(offset-mappings full-pattern data-vars data)

Inputs: [full-pattern :- [s/Any] data-vars :- [Symbol] data :- Results] Returns: #:s{Num s/Num}

Build a pattern->data mapping that returns offsets into a pattern mapped to corresponding offsets into data. If a data offset is negative, then this indicates a node must be built instead of reading from the data.

Inputs: [full-pattern :- [s/Any] data-vars :- [Symbol] data :- Results]
Returns: #:s{Num s/Num}

Build a pattern->data mapping that returns offsets into a pattern mapped to corresponding
 offsets into data. If a data offset is negative, then this indicates a node must be built
 instead of reading from the data.
sourceraw docstring

projectclj/s

(project {:keys [new-node node-label] :as store-fns} [v :as pattern] data)

Inputs: [{:keys [new-node node-label], :as store-fns} [v :as pattern] :- [s/Any] data :- Results] Returns: s/Any

Converts data from results, into just the requested columns, as per the patterns arg. Depending on the format of the pattern argument, different projections may occur.

  • If the pattern is a sequence of vars, then the associated column in each row of data will be copied into position in each row of results.
  • If the pattern is a var followed by a dot, then only the first row of data is processed and a single value matching the var will be returned.
  • If the pattern is a vector containing a var and 3 dots, then only a single value is selected from each row of data and a sequence of those values is returned.
  • If the pattern is a vector of multiple vars, then only the first row of data is processed and a single vector containing all of the requested results is returned.
Inputs: [{:keys [new-node node-label], :as store-fns} [v :as pattern] :- [s/Any] data :- Results]
Returns: s/Any

Converts data from results, into just the requested columns, as per the patterns arg.
 Depending on the format of the `pattern` argument, different projections may occur.
 - If the pattern is a sequence of vars, then the associated column in each row of data
 will be copied into position in each row of results.
 - If the pattern is a var followed by a dot, then only the first row of data is processed
 and a single value matching the var will be returned.
 - If the pattern is a vector containing a var and 3 dots, then only a single value is selected
 from each row of data and a sequence of those values is returned.
 - If the pattern is a vector of multiple vars, then only the first row of data is processed
 and a single vector containing all of the requested results is returned. 
sourceraw docstring

project-collectionclj/s

(project-collection v columns data)

Inputs: [v :- Var columns :- [Var] data :- Results] Returns: [s/Any]

Returns a single value from every row of results, selected by the variable.

Inputs: [v :- Var columns :- [Var] data :- Results]
Returns: [s/Any]

Returns a single value from every row of results, selected by the variable.
sourceraw docstring

project-resultsclj/s

(project-results {:keys [new-node node-label] :as store-fns}
                 pattern
                 columns
                 data)

Inputs: [{:keys [new-node node-label], :as store-fns} pattern :- [s/Any] columns :- [Var] data :- Results] Returns: Results

Converts each row from a result, into just the requested columns, as per the patterns arg. Any specified value in the patterns will be copied into that position in the projection. Unbound patterns will generate new nodes for each row. e.g. For pattern [?h1 :friend ?h2] data: [[h1=frodo h3=bilbo h2=gandalf] [h1=merry h3=pippin h2=frodo]] leads to: [[h1=frodo :friend h2=gandalf] [h1=merry :friend h2=frodo]]

Inputs: [{:keys [new-node node-label], :as store-fns} pattern :- [s/Any] columns :- [Var] data :- Results]
Returns: Results

Converts each row from a result, into just the requested columns, as per the patterns arg.
 Any specified value in the patterns will be copied into that position in the projection.
 Unbound patterns will generate new nodes for each row.
e.g. For pattern [?h1 :friend ?h2]
     data: [[h1=frodo h3=bilbo h2=gandalf]
            [h1=merry h3=pippin h2=frodo]]
leads to: [[h1=frodo :friend h2=gandalf]
           [h1=merry :friend h2=frodo]]
sourceraw docstring

project-rowclj/s

(project-row {:keys [new-node node-label] :as store-fns}
             wide-pattern
             nodes
             mapping
             row)

Inputs: [{:keys [new-node node-label], :as store-fns} wide-pattern :- [s/Any] nodes :- (s/maybe [s/Num]) mapping :- #:s{Num s/Num} row :- [Value]] Returns: [s/Any]

Creates a new EPVPattern from an existing one, based on existing bindings. Uses the mapping to copy from columns in 'row' to overwrite variables in 'pattern'. 'pattern' must be a vector. The index mappings have already been found and are in the 'mapping' argument

Inputs: [{:keys [new-node node-label], :as store-fns} wide-pattern :- [s/Any] nodes :- (s/maybe [s/Num]) mapping :- #:s{Num s/Num} row :- [Value]]
Returns: [s/Any]

Creates a new EPVPattern from an existing one, based on existing bindings.
 Uses the mapping to copy from columns in 'row' to overwrite variables in 'pattern'.
 'pattern' must be a vector.
 The index mappings have already been found and are in the 'mapping' argument
sourceraw docstring

project-singleclj/s

(project-single v columns data)

Inputs: [v :- Var columns :- [Var] data :- Results] Returns: s/Any

Returns a single value out of the first row of results, selected by the variable. Throws an exception if the variable does not exist.

Inputs: [v :- Var columns :- [Var] data :- Results]
Returns: s/Any

Returns a single value out of the first row of results, selected by the variable.
Throws an exception if the variable does not exist.
sourceraw docstring

project-tupleclj/s

(project-tuple tuple columns data)

Inputs: [tuple :- [Var] columns :- [Var] data :- Results] Returns: [s/Any]

Returns a tuple of values out of the first row of results, selected by the variables. Throws an exception if any of the variables do not exist.

Inputs: [tuple :- [Var] columns :- [Var] data :- Results]
Returns: [s/Any]

Returns a tuple of values out of the first row of results, selected by the variables.
Throws an exception if any of the variables do not exist.
sourceraw docstring

Resultsclj/s

source

Tripleclj/s

source

Valueclj/s

source

Varclj/s

source

vartest?clj/s

(vartest? x)

Inputs: [x] Returns: s/Bool

Inputs: [x]
Returns: s/Bool
sourceraw docstring

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

× close