A storage implementation over in-memory indexing. Includes full query engine.
A storage implementation over in-memory indexing. Includes full query engine.
(as-connection graph)
(as-connection graph uri)
(as-connection G__27485)
(as-connection G__27489 G__27490)
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.
(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
(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.
(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.
(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
(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.
(import-data connection 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
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
(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.
(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.
(transact {: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. This is currently synchronous, but returns a future or delay for compatibility with Datomic. 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] 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 :executor Executor to be used to run the CompletableFuture
Inputs: [{:keys [name state], :as connection} :- ConnectionType {:keys [tx-data tx-triples executor update-fn], :as tx-info} :- TransactData] Updates a database. This is currently synchronous, but returns a future or delay for compatibility with Datomic. 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] 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 :executor Executor to be used to run the CompletableFuture
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close