Liking cljdoc? Tell your friends :D

asami.core

A storage implementation over in-memory indexing. Includes full query engine.

A storage implementation over in-memory indexing. Includes full query engine.
raw docstring

as-connectionclj/s≠

clj
(as-connection graph)
(as-connection graph uri)
cljs
(as-connection G__18779)
(as-connection G__18783 G__18784)

Inputs: ([graph :- Graphable] [graph :- Graphable uri :- s/Str]) Returns: ConnectionType

Creates a Database/Connection around an existing Graph. graph: The graph or graph wrapper to build a database around. uri: The uri of the database.

Inputs: ([graph :- Graphable] [graph :- Graphable uri :- s/Str])
Returns: ConnectionType

Creates a Database/Connection around an existing Graph.
 graph: The graph or graph wrapper to build a database around.
 uri: The uri of the database.
sourceraw docstring

as-ofclj/s

source

as-of-tclj/s

source

as-of-timeclj/s

source

check-attachmentclj/s

(check-attachment connection)

Checks if a connection is attached to the connections map. If not, then connect. Returns the connection if previously connected, false if it needed to be reconnected.

Checks if a connection is attached to the connections map.
If not, then connect. Returns the connection if previously connected,
false if it needed to be reconnected.
sourceraw docstring

connectclj/s

(connect uri)

Inputs: [uri :- s/Str] Returns: ConnectionType

Connects to the specified database, returning a Connection. In-memory databases get created if they do not exist already. Memory graphs: asami:mem://dbname A standard graph asami:multi://dbname A multigraph

Inputs: [uri :- s/Str]
Returns: ConnectionType

Connects to the specified database, returning a Connection.
In-memory databases get created if they do not exist already.
Memory graphs:
asami:mem://dbname    A standard graph
asami:multi://dbname  A multigraph
sourceraw docstring

connectionsclj/s

source

create-databaseclj/s

(create-database uri)

Inputs: [uri :- s/Str] Returns: s/Bool

Creates database specified by uri. Returns true if the database was created, false if it already exists.

Inputs: [uri :- s/Str]
Returns: s/Bool

Creates database specified by uri. Returns true if the
 database was created, false if it already exists.
sourceraw docstring

dbclj/s

source

default-tx-timeoutclj

source

delete-databaseclj/s

(delete-database uri)

Inputs: [uri :- s/Str] Returns: s/Bool

Deletes the database specified by the URI. Returns true if the delete occurred.

Inputs: [uri :- s/Str]
Returns: s/Bool

Deletes the database specified by the URI.
 Returns true if the delete occurred.
sourceraw docstring

entityclj/s

source

export-dataclj/s

(export-data database)

Returns a simplified data structures of all statements in a database

Returns a simplified data structures of all statements in a database
sourceraw docstring

export-strclj/s

(export-str database)

A wrapper on export-data to serialize to a string

A wrapper on export-data to serialize to a string
sourceraw docstring

get-database-namesclj/s

(get-database-names)

Inputs: []

Returns a seq of database names that this instance is aware of.

Inputs: []

Returns a seq of database names that this instance is aware of.
sourceraw docstring

get-timeoutclj

(get-timeout)

Retrieves the timeout value to use in ms

Retrieves the timeout value to use in ms
sourceraw docstring

graphclj/s

source

Graphableclj/s

source

import-dataclj/s

(import-data connection data)
(import-data connection opts data)

Loads raw statements into a connection. This does no checking of existing contents of storage. Accepts either a seq of tuples, or an EDN string which contains a seq of tuples. Optionally accepts options for reading a string (will be ignored if the data is not a string). These options are the same as for clojure.edn/read and cljs.reader/read.

Loads raw statements into a connection. This does no checking of existing contents of storage.
Accepts either a seq of tuples, or an EDN string which contains a seq of tuples.
Optionally accepts options for reading a string (will be ignored if the data is not a string).
These options are the same as for clojure.edn/read and cljs.reader/read.
sourceraw docstring

instantclj/s

source

instant?clj/s

source

long-timeclj/s

source

nowclj/s

source

qclj/s

(q query & inputs)

Execute a query against the provided inputs. The query can be a map, a seq, or a string. See the documentation at https://github.com/threatgrid/asami/wiki/Querying for a full description of queries. The end of the parameters may include a series of key/value pairs for query options. The only recognized option for now is: :planner :user This ensures that a query is executed in user-specified order, and not the order calculated by the optimizing planner.

Execute a query against the provided inputs.
The query can be a map, a seq, or a string.
See the documentation at https://github.com/threatgrid/asami/wiki/Querying
for a full description of queries.
The end of the parameters may include a series of key/value pairs for query options.
The only recognized option for now is:
  `:planner :user`
This ensures that a query is executed in user-specified order, and not the order calculated by the optimizing planner.
sourceraw docstring

releaseclj/s

source

show-planclj/s

(show-plan query & inputs)

Return a query plan and do not execute the query. All parameters are identical to the q function.

Return a query plan and do not execute the query.
All parameters are identical to the `q` function.
sourceraw docstring

shutdownclj/s

(shutdown)

Releases all connection resources for a clean shutdown

Releases all connection resources for a clean shutdown
sourceraw docstring

sinceclj/s

source

since-tclj/s

source

transactclj/s≠

(transact connection tx-info)
clj

Inputs: [connection :- ConnectionType tx-info :- TransactData]

This returns a completed future with the data from a transaction. See the documentation for transact-async for full details on arguments. If the transaction times out, the call to transact will throw an ExceptionInfo exception. The default is 100 seconds

The result derefs to a map of:
 :db-before database value before the transaction
 :db-after database value after the transaction
 :tx-data a sequence of the transacted datom operations
 :tempids a map of temporary id values and the db identifiers that were allocated for them}
Inputs: [connection :- ConnectionType tx-info :- TransactData]

This returns a completed future with the data from a transaction.
    See the documentation for transact-async for full details on arguments.
    If the transaction times out, the call to transact will throw an ExceptionInfo exception.
    The default is 100 seconds

    The result derefs to a map of:
     :db-before database value before the transaction
     :db-after database value after the transaction
     :tx-data a sequence of the transacted datom operations
     :tempids a map of temporary id values and the db identifiers that were allocated for them}
cljs

Inputs: [connection :- ConnectionType tx-info :- TransactData]

This is a thin wrapper around the transact-async function. TODO: convert this to a promise-based approach for the async implementation See the documentation for transact-async for full details on arguments. returns a deref'able object that derefs to a map of: :db-before database value before the transaction :db-after database value after the transaction :tx-data a sequence of the transacted datom operations :tempids a map of temporary id values and the db identifiers that were allocated for them}

Inputs: [connection :- ConnectionType tx-info :- TransactData]

This is a thin wrapper around the transact-async function.
    TODO: convert this to a promise-based approach for the async implementation
    See the documentation for transact-async for full details on arguments.
    returns a deref'able object that derefs to a map of:
     :db-before database value before the transaction
     :db-after database value after the transaction
     :tx-data a sequence of the transacted datom operations
     :tempids a map of temporary id values and the db identifiers that were allocated for them}
source (clj)source (cljs)raw docstring

transact-asyncclj/s

(transact-async {:keys [name state] :as connection}
                {:keys [tx-data tx-triples executor update-fn] :as tx-info})

Inputs: [{:keys [name state], :as connection} :- ConnectionType {:keys [tx-data tx-triples executor update-fn], :as tx-info} :- TransactData]

Updates a database. connection: The connection to the database to be updated. tx-info: This is either a seq of items to be transacted, or a map. If this is a map, then a :tx-data value will contain the same type of seq that tx-info may have. Each item to be transacted is one of: - vector of the form: [:db/add entity attribute value] - creates a datom - vector of the form: [:db/retract entity attribute value] - removes a datom - map: an entity to be inserted/updated. Alternatively, a map may have a :tx-triples key. If so, then this is a seq of 3 element vectors. Each vector in a :tx-triples seq will contain the raw values for [entity attribute value] :executor An optional value in the tx-info containing an executor to be used to run the CompletableFuture Entities and assertions may have attributes that are keywords with a trailing ' character. When these appear an existing attribute without that character will be replaced. This only occurs for the top level entity, and is not applied to attributes appearing in nested structures. Entities can be assigned a :db/id value. If this is a negative number, then it is considered a temporary value and will be mapped to a system-allocated ID. Other entities can reference such an entity using that ID. Entities can be provided a :db/ident value of any type. This will be considered unique, and can be used to identify entities for updates in subsequent transactions.

Returns a future/delay object that will hold a map containing the following: :db-before database value before the transaction :db-after database value after the transaction :tx-data sequence of datoms produced by the transaction :tempids mapping of the temporary IDs in entities to the allocated nodes

Inputs: [{:keys [name state], :as connection} :- ConnectionType {:keys [tx-data tx-triples executor update-fn], :as tx-info} :- TransactData]

Updates a database.
 connection: The connection to the database to be updated.
 tx-info: This is either a seq of items to be transacted, or a map.
          If this is a map, then a :tx-data value will contain the same type of seq that tx-info may have.
          Each item to be transacted is one of:
          - vector of the form: [:db/add entity attribute value] - creates a datom
          - vector of the form: [:db/retract entity attribute value] - removes a datom
          - map: an entity to be inserted/updated.
          Alternatively, a map may have a :tx-triples key. If so, then this is a seq of 3 element vectors.
          Each vector in a :tx-triples seq will contain the raw values for [entity attribute value]
          :executor An optional value in the tx-info containing an executor to be used to run the CompletableFuture
Entities and assertions may have attributes that are keywords with a trailing ' character.
When these appear an existing attribute without that character will be replaced. This only occurs for the top level
entity, and is not applied to attributes appearing in nested structures.
Entities can be assigned a :db/id value. If this is a negative number, then it is considered a temporary value and
will be mapped to a system-allocated ID. Other entities can reference such an entity using that ID.
Entities can be provided a :db/ident value of any type. This will be considered unique, and can be used to identify
entities for updates in subsequent transactions.

Returns a future/delay object that will hold a map containing the following:
:db-before    database value before the transaction
:db-after     database value after the transaction
:tx-data      sequence of datoms produced by the transaction
:tempids      mapping of the temporary IDs in entities to the allocated nodes
sourceraw docstring

TransactDataclj/s

source

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

× close