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 :- [KeyValue]] 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 :- [KeyValue]]
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 [KeyValue])

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 [KeyValue])

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__15556)
(delta->str G__15560 G__15561)

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

EntityTriplesPairclj/s

source

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__15506 G__15507)
(id->json G__15511 G__15512 G__15513)

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

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/cond-pre s/Keyword s/Str)})])
Returns: MapOrList

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: MapOrList

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

Inputs: [store :- StorageType ident :- s/Any]
Returns: MapOrList

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__15411)
(ident-map->triples G__15406 G__15407)

Inputs: ([storage j] [j]) Returns: [Triple]

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

Inputs: ([storage j] [j])
Returns: [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

KeyValueclj/s

source

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: EntityTriplesPair

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: EntityTriplesPair

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

MapOrListclj/s

source

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__15488 G__15489)
(pairs->json G__15493 G__15494 G__15495)

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

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

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

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] :- KeyValue] Returns: [Triple]

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

Inputs: [entity-id :- s/Any [property value] :- KeyValue]
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: [KeyValue]

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: [KeyValue]

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] :- KeyValue] 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] :- KeyValue]
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__15527)
(store->json G__15531 G__15532)

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

Pulls all top level JSON out of a store

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

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__15539)
(store->str G__15543 G__15544)

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: EntityTriplesPair

Inputs: [vlist :- [s/Any]]
Returns: EntityTriplesPair
sourceraw docstring

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

× close