# class AsyncModel

###

Module | soprano
Namespace | Soprano::Util
Class | AsyncModel
Inherits | Soprano::FilterModel

\class AsyncModel asyncmodel.h Soprano/Server/AsyncModel

Filter model that allows to perform operations asyncroneously.

The main purpose is to protect a Model against deadlocks in a single threaded situation.

Usage:

    AsyncResult* result = model->listStatementsAsync( s );
    connect( result, SIGNAL(resultReady(AsyncResult*)),
    this, SLOT(slotResultReady(AsyncResult*)) );

Author Sebastian Trueg <trueg@kde.org>

\since 2.1

### methods

- AsyncModel (parent)

  returns ctor

  Argument | Type | Default
  --- | --- | ---
  parent | Soprano.Model | 0

  Create a new Model.

  parent - The parent model to forward the operations to.

- addStatementAsync (statement)

  returns Soprano.Util.AsyncResult

  Argument | Type | Default
  --- | --- | ---
  statement | Soprano.Statement |

  Asyncroneously add the Statement to the Model.

  statement - The Statement to add.

  See also addStatement

  Returns an AsyncResult with result type Error.ErrorCode object which will signal when the result is ready.

- containsAnyStatementAsync (statement)

  returns Soprano.Util.AsyncResult

  Argument | Type | Default
  --- | --- | ---
  statement | Soprano.Statement |

  Asyncroneously check if the model contains certain statements.

  statement - A partially defined statement that serves as a pattern.

  See also containsAnyStatement

  Returns an AsyncResult with result type bool object which will signal when the result is ready.

- containsStatementAsync (statement)

  returns Soprano.Util.AsyncResult

  Argument | Type | Default
  --- | --- | ---
  statement | Soprano.Statement |

  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.

  See also containsStatement

  Returns an AsyncResult with result type bool object which will signal when the result is ready.

- createBlankNodeAsync ( )

  returns Soprano.Util.AsyncResult

  Asyncroneously create a new blank node with a unique identifier.

  See also createBlankNode

  Returns an AsyncResult with result type Node object which will signal when the result is ready.

- executeQueryAsync (query, language, userQueryLanguage)

  returns Soprano.Util.AsyncResult

  Argument | Type | Default
  --- | --- | ---
  query | QString |
  language | Soprano.Query.QueryLanguage |
  userQueryLanguage | QString | QString()

  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.

  See also executeQuery

  Returns an AsyncResult with result type QueryResultIterator object which will signal when the result is ready.

- isEmptyAsync ( )

  returns Soprano.Util.AsyncResult

  Asyncroneously check if the Model does contain any Statement.

  See also isEmpty

  Returns an AsyncResult with result type bool object which will signal when the result is ready.

- listContextsAsync ( )

  returns Soprano.Util.AsyncResult

  Asyncroneously list all contexts in the model, i.e. all named graphs.

  See also listContexts

  Returns an AsyncResult with result type NodeIterator object which will signal when the result is ready.

- listStatementsAsync (statement)

  returns Soprano.Util.AsyncResult

  Argument | Type | Default
  --- | --- | ---
  statement | Soprano.Statement |

  Asyncroneously return an iterator over Model Statements that "partial" match the input Statement.

  statement - The partial Statement to match.

  See also listStatements

  Returns an AsyncResult with result type StatementIterator object which will signal when the result is ready.

- removeAllStatementsAsync (statement)

  returns Soprano.Util.AsyncResult

  Argument | Type | Default
  --- | --- | ---
  statement | Soprano.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.

  See also removeAllStatements

  Returns an AsyncResult with result type Error.ErrorCode object which will signal when the result is ready.

- removeStatementAsync (statement)

  returns Soprano.Util.AsyncResult

  Argument | Type | Default
  --- | --- | ---
  statement | Soprano.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.

  See also removeStatement

  Returns an AsyncResult with result type Error.ErrorCode object which will signal when the result is ready.

- statementCountAsync ( )

  returns Soprano.Util.AsyncResult

  Asyncroneously determine the number of statements stored in this Model.

  See also statementCount

  Returns an AsyncResult with result type int object which will signal when the result is ready.