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


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.
raw 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.
raw 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
raw 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
raw docstring

delta->strclj/s≠

clj
(delta->str store)
(delta->str store indent)
cljs
(delta->str G__9723)
(delta->str G__9727 G__9728)

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
raw docstring

existing-triplesclj/s

(existing-triples storage id [k v])

Inputs: [storage id [k v]]

Inputs: [storage id [k v]]
raw 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.
raw docstring

id->jsonclj/s≠

clj
(id->json store entity-id)
(id->json store entity-id exclusions)
cljs
(id->json G__9673 G__9674)
(id->json G__9678 G__9679 G__9680)

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
raw 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
raw docstring

ident-map->triplesclj/s≠

clj
(ident-map->triples j)
(ident-map->triples storage j)
cljs
(ident-map->triples G__9584)
(ident-map->triples G__9579 G__9580)

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
raw 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.
raw docstring

json-generate-stringclj/s

(json-generate-string data)
(json-generate-string data indent)

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
raw 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
raw 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.
raw 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
raw docstring

pairs->jsonclj/s≠

clj
(pairs->json store prop-vals)
(pairs->json store prop-vals seen)
cljs
(pairs->json G__9659 G__9660)
(pairs->json G__9664 G__9665 G__9666)

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
raw docstring

parse-json-stringclj/s


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
raw 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
raw 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
raw docstring

store->jsonclj/s≠

clj
(store->json store)
(store->json store exclusions)
cljs
(store->json G__9694)
(store->json G__9698 G__9699)

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
raw docstring

store->strclj/s≠

clj
(store->str store)
(store->str store indent)
cljs
(store->str G__9706)
(store->str G__9710 G__9711)

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
raw 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]
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
raw docstring

Tripleclj/s


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.
raw 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")]
raw docstring

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

× close