Liking cljdoc? Tell your friends :D

naga.data

Converts external data into a graph format (triples).

Converts external data into a graph format (triples).
raw docstring

*current-storage*clj/s

source

build-listclj/s

(build-list store seen pairs)

Inputs: [store :- StorageType seen :- #{s/Any} pairs :- [[s/Keyword s/Any]]] Returns: [s/Any]

Takes property/value pairs and if they represent a list node, returns the list. else, nil.

Inputs: [store :- StorageType seen :- #{s/Any} pairs :- [[s/Keyword s/Any]]]
Returns: [s/Any]

Takes property/value pairs and if they represent a list node, returns the list.
 else, nil.
sourceraw docstring

check-structureclj/s

(check-structure store prop v)

Inputs: [store :- StorageType prop :- s/Any v :- s/Any] Returns: (s/maybe [[s/Keyword s/Any]])

Determines if a value represents a structure. If so, return the property/values for it. Otherwise, return nil.

Inputs: [store :- StorageType prop :- s/Any v :- s/Any]
Returns: (s/maybe [[s/Keyword s/Any]])

Determines if a value represents a structure. If so, return the property/values for it.
 Otherwise, return nil.
sourceraw docstring

containership-triplesclj/s

(containership-triples node triples)

Inputs: [node :- s/Any triples :- [Triple]]

Finds the list of entity nodes referred to in a list and builds triples describing a flat 'contains' property

Inputs: [node :- s/Any triples :- [Triple]]

Finds the list of entity nodes referred to in a list and builds
 triples describing a flat 'contains' property
sourceraw docstring

delta->jsonclj/s

(delta->json store)

Inputs: [store :- StorageType] Returns: [#:s{Keyword s/Any}]

Pulls all top level JSON out of a store

Inputs: [store :- StorageType]
Returns: [#:s{Keyword s/Any}]

Pulls all top level JSON out of a store
sourceraw docstring

delta->strclj/s≠

clj
(delta->str store)
(delta->str store indent)
cljs
(delta->str G__1812)
(delta->str G__1816 G__1817)

Inputs: ([store :- StorageType] [store :- StorageType indent :- s/Num]) Returns: s/Str

Reads a store into JSON strings

Inputs: ([store :- StorageType] [store :- StorageType indent :- s/Num])
Returns: s/Str

Reads a store into JSON strings
sourceraw docstring

existing-triplesclj/s

(existing-triples storage id [k v])

Inputs: [storage id [k v]]

Inputs: [storage id [k v]]
sourceraw docstring

get-naga-firstclj/s

(get-naga-first struct)

Finds the naga/first property in a map, and gets the value.

Finds the naga/first property in a map, and gets the value.
sourceraw docstring

id->jsonclj/s≠

clj
(id->json store entity-id)
(id->json store entity-id exclusions)
cljs
(id->json G__1762 G__1763)
(id->json G__1767 G__1768 G__1769)

Inputs: ([store :- StorageType entity-id :- s/Any] [store :- StorageType entity-id :- s/Any exclusions :- (s/maybe #{s/Keyword})]) Returns: #:s{Keyword s/Any}

Uses an id node to load up a nested data structure from the graph

Inputs: ([store :- StorageType entity-id :- s/Any] [store :- StorageType entity-id :- s/Any exclusions :- (s/maybe #{s/Keyword})])
Returns: #:s{Keyword s/Any}

Uses an id node to load up a nested data structure from the graph
sourceraw docstring

ident->jsonclj/s

(ident->json store ident)

Inputs: [store :- StorageType ident :- s/Any] Returns: #:s{Keyword s/Any}

Converts data in a database to data structures suitable for JSON encoding

Inputs: [store :- StorageType ident :- s/Any]
Returns: #:s{Keyword s/Any}

Converts data in a database to data structures suitable for JSON encoding
sourceraw docstring

ident-map->triplesclj/s≠

clj
(ident-map->triples j)
(ident-map->triples storage j)
cljs
(ident-map->triples G__1667)
(ident-map->triples G__1662 G__1663)

Inputs: ([storage j] [j]) Returns: [s/Any [Triple]]

Converts a single map to triples for an ID'ed map

Inputs: ([storage j] [j])
Returns: [s/Any [Triple]]

Converts a single map to triples for an ID'ed map
sourceraw docstring

json->triplesclj/s

(json->triples storage j)

Inputs: [storage j] Returns: [Triple]

Converts parsed JSON into a sequence of triples for a provided storage.

Inputs: [storage j]
Returns: [Triple]

Converts parsed JSON into a sequence of triples for a provided storage.
sourceraw docstring

json-generate-stringclj/s

(json-generate-string data)
(json-generate-string data indent)
source (clj)source (cljs)

json-update->triplesclj/s

(json-update->triples storage id j)

Inputs: [storage id j] Returns: [(s/one [Triple] "assertions") (s/one [Triple] "retractions")]

Takes a single structure and converts it into triples to be added and triples to be retracted to create a change

Inputs: [storage id j]
Returns: [(s/one [Triple] "assertions") (s/one [Triple] "retractions")]

Takes a single structure and converts it into triples to be added and triples to be retracted to create a change
sourceraw docstring

list-triplesclj/s

(list-triples [v & vs :as vlist])

Inputs: [[v & vs :as vlist]]

Creates the triples for a list

Inputs: [[v & vs :as vlist]]

Creates the triples for a list
sourceraw docstring

map->triplesclj/s

(map->triples data)

Inputs: [data :- #:s{Keyword s/Any}] Returns: [s/Any [Triple]]

Converts a single map to triples. Returns a pair of the map's ID and the triples for the map.

Inputs: [data :- #:s{Keyword s/Any}]
Returns: [s/Any [Triple]]

Converts a single map to triples. Returns a pair of the map's ID and the triples for the map.
sourceraw docstring

name-forclj/s

(name-for id)

Inputs: [id :- s/Any]

Convert an id (probably a number) to a keyword for identification

Inputs: [id :- s/Any]

Convert an id (probably a number) to a keyword for identification
sourceraw docstring

pairs->jsonclj/s≠

clj
(pairs->json store prop-vals)
(pairs->json store prop-vals seen)
cljs
(pairs->json G__1744 G__1745)
(pairs->json G__1749 G__1750 G__1751)

Inputs: ([store :- StorageType prop-vals :- [[s/Keyword s/Any]]] [store :- StorageType prop-vals :- [[s/Keyword s/Any]] seen :- #{s/Keyword}]) Returns: #:s{Keyword s/Any}

Uses a set of property-value pairs to load up a nested data structure from the graph

Inputs: ([store :- StorageType prop-vals :- [[s/Keyword s/Any]]] [store :- StorageType prop-vals :- [[s/Keyword s/Any]] seen :- #{s/Keyword}])
Returns: #:s{Keyword s/Any}

Uses a set of property-value pairs to load up a nested data structure from the graph
sourceraw docstring

parse-json-stringclj/s

source (clj)source (cljs)

property-valsclj/s

(property-vals entity-id [property value])

Inputs: [entity-id :- s/Any [property value] :- [s/Keyword s/Any]] Returns: [Triple]

Takes a property-value pair associated with an entity, and builds triples around it

Inputs: [entity-id :- s/Any [property value] :- [s/Keyword s/Any]]
Returns: [Triple]

Takes a property-value pair associated with an entity,
 and builds triples around it
sourceraw docstring

property-valuesclj/s

(property-values store entity)

Inputs: [store :- StorageType entity :- s/Any] Returns: [[s/Keyword s/Any]]

Return all the property/value pairs for a given entity in the store. Skips non-keyword properties, as these are not created by naga.data

Inputs: [store :- StorageType entity :- s/Any]
Returns: [[s/Keyword s/Any]]

Return all the property/value pairs for a given entity in the store.
 Skips non-keyword properties, as these are not created by naga.data
sourceraw docstring

recurse-nodeclj/s

(recurse-node store seen [prop v :as prop-val])

Inputs: [store :- StorageType seen :- #{s/Keyword} [prop v :as prop-val] :- [s/Keyword s/Any]] Returns: s/Any

Determines if the val of a map entry is a node to be recursed on, and loads if necessary. If referring directly to a top level node, then short circuit and return the ID

Inputs: [store :- StorageType seen :- #{s/Keyword} [prop v :as prop-val] :- [s/Keyword s/Any]]
Returns: s/Any

Determines if the val of a map entry is a node to be recursed on, and loads if necessary.
If referring directly to a top level node, then short circuit and return the ID
sourceraw docstring

store->jsonclj/s≠

clj
(store->json store)
(store->json store exclusions)
cljs
(store->json G__1783)
(store->json G__1787 G__1788)

Inputs: ([store :- StorageType] [store :- StorageType exclusions :- (s/maybe #{s/Keyword})]) Returns: [#:s{Keyword s/Any}]

Pulls all top level JSON out of a store

Inputs: ([store :- StorageType] [store :- StorageType exclusions :- (s/maybe #{s/Keyword})])
Returns: [#:s{Keyword s/Any}]

Pulls all top level JSON out of a store
sourceraw docstring

store->strclj/s≠

clj
(store->str store)
(store->str store indent)
cljs
(store->str G__1795)
(store->str G__1799 G__1800)

Inputs: ([store :- StorageType] [store :- StorageType indent :- s/Num]) Returns: s/Str

Reads a store into JSON strings

Inputs: ([store :- StorageType] [store :- StorageType indent :- s/Num])
Returns: s/Str

Reads a store into JSON strings
sourceraw docstring

stream->triplesclj/s≠

(stream->triples storage io)
clj

Inputs: [storage io] Returns: [Triple]

Converts a stream to triples relevant to a store

Inputs: [storage io]
Returns: [Triple]

Converts a stream to triples relevant to a store
cljs

Inputs: [storage io] Returns: [Triple]

Inputs: [storage io]
Returns: [Triple]
source (clj)source (cljs)raw docstring

string->triplesclj/s

(string->triples storage s)

Inputs: [storage :- StorageType s :- s/Str] Returns: [Triple]

Converts a string to triples relevant to a store

Inputs: [storage :- StorageType s :- s/Str]
Returns: [Triple]

Converts a string to triples relevant to a store
sourceraw docstring

Tripleclj/s

source

value-triplesclj/s

(value-triples v)

Inputs: [v]

Converts a value into a list of triples. Return the entity ID of the data coupled with the sequence of triples. NOTE: This may need to be dispatched to storage. e.g. Datomic could use properties to determine how to encode data.

Inputs: [v]

Converts a value into a list of triples.
 Return the entity ID of the data coupled with the sequence of triples.
 NOTE: This may need to be dispatched to storage.
       e.g. Datomic could use properties to determine how to encode data.
sourceraw docstring

value-triples-listclj/s

(value-triples-list vlist)

Inputs: [vlist :- [s/Any]] Returns: [(s/one s/Any "node ID") (s/one [Triple] "current list of triples")]

Inputs: [vlist :- [s/Any]]
Returns: [(s/one s/Any "node ID") (s/one [Triple] "current list of triples")]
sourceraw docstring

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

× close