Soprano
2.7.2
|
Filter model that allows to perform operations asyncroneously. More...
#include <Soprano/Server/AsyncModel>
Filter model that allows to perform operations asyncroneously.
AsyncModel has two modes: AsyncModel::SingleThreaded and AsyncModel::MultiThreaded. The main purpose of the AsyncModel::SingleThreaded mode is to protect a Model against deadlocks in a single threaded situation.
AsyncModel::MultiThreaded mode provides real asyncroneous execution of Model commands.
Usage:
AsyncResult* result = model->listStatementsAsync( s ); connect( result, SIGNAL(resultReady(AsyncResult*)), this, SLOT(slotResultReady(AsyncResult*)) );
Definition at line 41 of file asyncmodel.h.
The mode of the model, single vs. multi threaded execution.
Definition at line 89 of file asyncmodel.h.
Soprano::Util::AsyncModel::AsyncModel | ( | Model * | parent = 0 | ) |
Create a new Model.
parent | The parent model to forward the operations to. |
Soprano::Util::AsyncModel::~AsyncModel | ( | ) |
Destructor.
void Soprano::Util::AsyncModel::setMode | ( | AsyncModelMode | mode | ) |
Set the mode to be used. For historical reasons the default mode is SingleThreaded.
AsyncModelMode Soprano::Util::AsyncModel::mode | ( | ) | const |
AsyncResult* Soprano::Util::AsyncModel::addStatementAsync | ( | const Statement & | statement | ) |
Asyncroneously add the Statement to the Model.
statement | The Statement to add. |
AsyncResult* Soprano::Util::AsyncModel::addStatementAsync | ( | const Node & | subject, |
const Node & | predicate, | ||
const Node & | object, | ||
const Node & | context = Node() |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
AsyncResult* Soprano::Util::AsyncModel::addStatementsAsync | ( | const QList< Statement > & | statements | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
AsyncResult* Soprano::Util::AsyncModel::removeStatementAsync | ( | const Statement & | statement | ) |
Asyncroneously remove one statement. For removing statements with wildward matching see removeAllStatementsAsync().
statement | The statement that should be removed. This has to be a valid statement. |
AsyncResult* Soprano::Util::AsyncModel::removeStatementAsync | ( | const Node & | subject, |
const Node & | predicate, | ||
const Node & | object, | ||
const Node & | context = Node() |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
AsyncResult* Soprano::Util::AsyncModel::removeStatementsAsync | ( | const QList< Statement > & | statements | ) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
AsyncResult* Soprano::Util::AsyncModel::removeAllStatementsAsync | ( | const Statement & | statement | ) |
Asyncroneously remove all statements that match the partial statement. For removing one specific statement see removeStatement().
statement | A possible partially defined statement that serves as a filter for all statements that should be removed. |
AsyncResult* Soprano::Util::AsyncModel::removeAllStatementsAsync | ( | const Node & | subject, |
const Node & | predicate, | ||
const Node & | object, | ||
const Node & | context = Node() |
||
) |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
AsyncResult* Soprano::Util::AsyncModel::isEmptyAsync | ( | ) | const |
Asyncroneously check if the Model does contain any Statement.
AsyncResult* Soprano::Util::AsyncModel::statementCountAsync | ( | ) | const |
Asyncroneously determine the number of statements stored in this Model.
AsyncResult* Soprano::Util::AsyncModel::listStatementsAsync | ( | const Statement & | statement | ) | const |
Asyncroneously return an iterator over Model Statements that "partial" match the input Statement.
statement | The partial Statement to match. |
AsyncResult* Soprano::Util::AsyncModel::listStatementsAsync | ( | const Node & | subject, |
const Node & | predicate, | ||
const Node & | object, | ||
const Node & | context = Node() |
||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
AsyncResult* Soprano::Util::AsyncModel::listStatementsAsync | ( | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Lists all statements in the Model asyncroneously.
AsyncResult* Soprano::Util::AsyncModel::listContextsAsync | ( | ) | const |
Asyncroneously list all contexts in the model, i.e. all named graphs.
AsyncResult* Soprano::Util::AsyncModel::executeQueryAsync | ( | const QString & | query, |
Query::QueryLanguage | language, | ||
const QString & | userQueryLanguage = QString() |
||
) | const |
Asyncroneously execute the given query over the Model.
This is a const read-only method. As such Model implementations should not support SPARQL extensions such as INSERT or UPDATE through this method. A future version of Soprano will provide an additional API for queries that change the Model.
query | The query to evaluate. |
language | The query language used to encode query . |
userQueryLanguage | If language equals Query::QueryLanguageUser userQueryLanguage defines the language to use. |
AsyncResult* Soprano::Util::AsyncModel::containsStatementAsync | ( | const Statement & | statement | ) | const |
AsyncResult check if the model contains a statements.
statement | The statement in question. This has to be a valid statement, i.e. subject, predicate, and object need to be defined. If the context node is empty the default graph is searched. |
AsyncResult* Soprano::Util::AsyncModel::containsStatementAsync | ( | const Node & | subject, |
const Node & | predicate, | ||
const Node & | object, | ||
const Node & | context = Node() |
||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
AsyncResult* Soprano::Util::AsyncModel::containsAnyStatementAsync | ( | const Statement & | statement | ) | const |
Asyncroneously check if the model contains certain statements.
statement | A partially defined statement that serves as a pattern. |
AsyncResult* Soprano::Util::AsyncModel::containsAnyStatementAsync | ( | const Node & | subject, |
const Node & | predicate, | ||
const Node & | object, | ||
const Node & | context = Node() |
||
) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
AsyncResult* Soprano::Util::AsyncModel::createBlankNodeAsync | ( | ) |
Asyncroneously create a new blank node with a unique identifier.
StatementIterator Soprano::Util::AsyncModel::listStatements | ( | const Statement & | partial | ) | const [virtual] |
The call is directly delivered to the parent model. However, the iterator is counted so that interweaving asyncroneous and non-asyncroneous calls does not result in unwanted behaviour.
Reimplemented from Soprano::FilterModel.
NodeIterator Soprano::Util::AsyncModel::listContexts | ( | ) | const [virtual] |
The call is directly delivered to the parent model. However, the iterator is counted so that interweaving asyncroneous and non-asyncroneous calls does not result in unwanted behaviour.
Reimplemented from Soprano::FilterModel.
QueryResultIterator Soprano::Util::AsyncModel::executeQuery | ( | const QString & | query, |
Query::QueryLanguage | language, | ||
const QString & | userQueryLanguage = QString() |
||
) | const [virtual] |
The call is directly delivered to the parent model. However, the iterator is counted so that interweaving asyncroneous and non-asyncroneous calls does not result in unwanted behaviour.
Reimplemented from Soprano::FilterModel.