Liking cljdoc? Tell your friends :D

naga.storage.store-util

Some common utilities for storage functions

Some common utilities for storage 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
raw docstring

group-exists?clj/s

(group-exists? storage group)

Inputs: [storage 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: [storage group :- [Axiom]]
Returns: [s/Any]

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

insert-projectclj/s

(insert-project storage patterns columns data)

Inputs: [storage patterns :- [[s/Any]] 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: [storage patterns :- [[s/Any]] 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.
raw 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.
raw 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.
raw docstring

offset-mappingsclj/s

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

Inputs: [storage 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: [storage 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.
raw docstring

projectclj/s

(project storage pattern data)

Inputs: [storage pattern :- [s/Any] 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: [storage pattern :- [s/Any] 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]]
raw docstring

project-rowclj/s

(project-row storage wide-pattern nodes mapping row)

Inputs: [storage 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: [storage 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
raw docstring

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

× close