knowrob
2.1.0
A Knowledge Base System for Cognition-enabled Robots
|
#include <StorageInterface.h>
Public Types | |
enum | TransactionType { Insert , Remove , Insert , Remove } |
enum | BackendSelection { Including , Excluding , Including , Excluding } |
enum | TransactionType { Insert , Remove , Insert , Remove } |
enum | BackendSelection { Including , Excluding , Including , Excluding } |
Public Member Functions | |
StorageInterface (const std::shared_ptr< StorageManager > &backendManager) | |
auto & | vocabulary () const |
auto & | backendManager () const |
std::shared_ptr< transaction::Transaction > | createTransaction (const QueryableBackendPtr &queryable, TransactionType type, BackendSelection mode=Excluding, const std::vector< std::shared_ptr< NamedBackend >> &backends={}) |
bool | removeAllWithOrigin (std::string_view origin) |
bool | mergeInsert (const QueryableBackendPtr &backend, const Triple &triple) |
bool | contains (const QueryableBackendPtr &backend, const Triple &triple) const |
void | match (const QueryableBackendPtr &backend, const TriplePattern &query, const TripleVisitor &visitor) const |
void | query (const QueryableBackendPtr &backend, const GraphQueryPtr &q, const BindingsHandler &callback) const |
TokenBufferPtr | getAnswerCursor (const QueryableBackendPtr &backend, const GraphPathQueryPtr &query) |
StorageInterface (const std::shared_ptr< StorageManager > &backendManager) | |
auto & | vocabulary () const |
auto & | backendManager () const |
std::shared_ptr< transaction::Transaction > | createTransaction (const QueryableBackendPtr &queryable, TransactionType type, BackendSelection mode=Excluding, const std::vector< std::shared_ptr< NamedBackend >> &backends={}) |
bool | removeAllWithOrigin (std::string_view origin) |
bool | mergeInsert (const QueryableBackendPtr &backend, const Triple &triple) |
bool | contains (const QueryableBackendPtr &backend, const Triple &triple) const |
void | match (const QueryableBackendPtr &backend, const TriplePattern &query, const TripleVisitor &visitor) const |
void | query (const QueryableBackendPtr &backend, const GraphQueryPtr &q, const BindingsHandler &callback) const |
TokenBufferPtr | getAnswerCursor (const QueryableBackendPtr &backend, const GraphPathQueryPtr &query) |
Static Public Member Functions | |
static void | foreach (const QueryableBackendPtr &backend, const TripleVisitor &visitor) |
static void | batch (const QueryableBackendPtr &backend, const TripleHandler &callback) |
static void | foreach (const QueryableBackendPtr &backend, const TripleVisitor &visitor) |
static void | batch (const QueryableBackendPtr &backend, const TripleHandler &callback) |
Protected Member Functions | |
void | pushIntoCursor (const QueryableBackendPtr &backend, const GraphPathQueryPtr &query, const TokenBufferPtr &resultStream) const |
void | pushIntoCursor (const QueryableBackendPtr &backend, const GraphPathQueryPtr &query, const TokenBufferPtr &resultStream) const |
Protected Attributes | |
std::shared_ptr< StorageManager > | backendManager_ |
A high-level interface to the storage manager. It includes methods for querying and modifying the extensional database.
Definition at line 18 of file StorageInterface.h.
Determines how storages are selected for a transaction.
Enumerator | |
---|---|
Including | |
Excluding | |
Including | |
Excluding |
Definition at line 29 of file StorageInterface.h.
Determines how storages are selected for a transaction.
Enumerator | |
---|---|
Including | |
Excluding | |
Including | |
Excluding |
Definition at line 29 of file StorageInterface.h.
The type of a transaction.
Enumerator | |
---|---|
Insert | |
Remove | |
Insert | |
Remove |
Definition at line 23 of file StorageInterface.h.
The type of a transaction.
Enumerator | |
---|---|
Insert | |
Remove | |
Insert | |
Remove |
Definition at line 23 of file StorageInterface.h.
|
inlineexplicit |
Definition at line 33 of file StorageInterface.h.
|
inlineexplicit |
Definition at line 33 of file StorageInterface.h.
|
inline |
|
inline |
|
static |
Executes a visitor on all triples in the extensional database.
backend | the backend to query. |
callback | the visitor to execute. |
Definition at line 173 of file StorageInterface.cpp.
|
static |
Executes a visitor on all triples in the extensional database.
backend | the backend to query. |
callback | the visitor to execute. |
bool StorageInterface::contains | ( | const QueryableBackendPtr & | backend, |
const Triple & | triple | ||
) | const |
Checks if a triple is contained in the extensional database.
backend | the storage to query. |
triple | the triple to check. |
Definition at line 122 of file StorageInterface.cpp.
bool knowrob::StorageInterface::contains | ( | const QueryableBackendPtr & | backend, |
const Triple & | triple | ||
) | const |
Checks if a triple is contained in the extensional database.
backend | the storage to query. |
triple | the triple to check. |
std::shared_ptr< transaction::Transaction > StorageInterface::createTransaction | ( | const QueryableBackendPtr & | queryable, |
TransactionType | type, | ||
BackendSelection | mode = Excluding , |
||
const std::vector< std::shared_ptr< NamedBackend >> & | backends = {} |
||
) |
Creates a new transaction.
queryable | a storage used to perform any queries needed to complete the transaction. |
type | the type of the transaction. |
mode | determines how storages are selected for the transaction. |
backends | the storages to include or exclude from the transaction. |
Definition at line 17 of file StorageInterface.cpp.
std::shared_ptr<transaction::Transaction> knowrob::StorageInterface::createTransaction | ( | const QueryableBackendPtr & | queryable, |
TransactionType | type, | ||
BackendSelection | mode = Excluding , |
||
const std::vector< std::shared_ptr< NamedBackend >> & | backends = {} |
||
) |
Creates a new transaction.
queryable | a storage used to perform any queries needed to complete the transaction. |
type | the type of the transaction. |
mode | determines how storages are selected for the transaction. |
backends | the storages to include or exclude from the transaction. |
|
static |
Executes a visitor on all triples in the extensional database.
backend | the backend to query. |
visitor | the visitor to execute. |
Definition at line 138 of file StorageInterface.cpp.
|
static |
Executes a visitor on all triples in the extensional database.
backend | the backend to query. |
visitor | the visitor to execute. |
TokenBufferPtr StorageInterface::getAnswerCursor | ( | const QueryableBackendPtr & | backend, |
const GraphPathQueryPtr & | query | ||
) |
Evaluates a query on the extensional database and fills a token buffer with the results in a separate thread.
backend | the backend to query. |
query | the query to evaluate. |
Definition at line 361 of file StorageInterface.cpp.
TokenBufferPtr knowrob::StorageInterface::getAnswerCursor | ( | const QueryableBackendPtr & | backend, |
const GraphPathQueryPtr & | query | ||
) |
Evaluates a query on the extensional database and fills a token buffer with the results in a separate thread.
backend | the backend to query. |
query | the query to evaluate. |
void StorageInterface::match | ( | const QueryableBackendPtr & | backend, |
const TriplePattern & | query, | ||
const TripleVisitor & | visitor | ||
) | const |
Evaluates a query on the extensional database and executes a visitor on the results which are returned in the form of triples.
backend | the backend to query. |
query | the query to evaluate. |
visitor | the visitor to execute. |
Definition at line 250 of file StorageInterface.cpp.
void knowrob::StorageInterface::match | ( | const QueryableBackendPtr & | backend, |
const TriplePattern & | query, | ||
const TripleVisitor & | visitor | ||
) | const |
Evaluates a query on the extensional database and executes a visitor on the results which are returned in the form of triples.
backend | the backend to query. |
query | the query to evaluate. |
visitor | the visitor to execute. |
bool StorageInterface::mergeInsert | ( | const QueryableBackendPtr & | backend, |
const Triple & | triple | ||
) |
Inserts a triple into the extensional database and merges it with existing ones if possible.
backend | the storage to modify. |
triple | the triple to insert. |
Definition at line 88 of file StorageInterface.cpp.
bool knowrob::StorageInterface::mergeInsert | ( | const QueryableBackendPtr & | backend, |
const Triple & | triple | ||
) |
Inserts a triple into the extensional database and merges it with existing ones if possible.
backend | the storage to modify. |
triple | the triple to insert. |
|
protected |
Definition at line 339 of file StorageInterface.cpp.
|
protected |
void StorageInterface::query | ( | const QueryableBackendPtr & | backend, |
const GraphQueryPtr & | q, | ||
const BindingsHandler & | callback | ||
) | const |
Evaluates a query on the extensional database and executes a visitor on the results which are returned in as bindings.
backend | the backend to query. |
q | the query to evaluate. |
callback | the visitor to execute. |
Definition at line 325 of file StorageInterface.cpp.
void knowrob::StorageInterface::query | ( | const QueryableBackendPtr & | backend, |
const GraphQueryPtr & | q, | ||
const BindingsHandler & | callback | ||
) | const |
Evaluates a query on the extensional database and executes a visitor on the results which are returned in as bindings.
backend | the backend to query. |
q | the query to evaluate. |
callback | the visitor to execute. |
bool StorageInterface::removeAllWithOrigin | ( | std::string_view | origin | ) |
Removes all triples with a given origin from all storages.
origin | the origin of the triples to remove. |
Definition at line 52 of file StorageInterface.cpp.
bool knowrob::StorageInterface::removeAllWithOrigin | ( | std::string_view | origin | ) |
Removes all triples with a given origin from all storages.
origin | the origin of the triples to remove. |
|
inline |
|
inline |
|
protected |
Definition at line 127 of file StorageInterface.h.