AsyncModel Class Reference
from PyKDE4.soprano import *
Inherits: Soprano.FilterModel
Namespace: Soprano::Util
Detailed Description
\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*)) );
- Since:
- 2.1
Methods | |
__init__ (self, Soprano.Model parent=0) | |
Soprano.Util.AsyncResult | addStatementAsync (self, Soprano.Statement statement) |
Soprano.Util.AsyncResult | containsAnyStatementAsync (self, Soprano.Statement statement) |
Soprano.Util.AsyncResult | containsStatementAsync (self, Soprano.Statement statement) |
Soprano.Util.AsyncResult | createBlankNodeAsync (self) |
Soprano.Util.AsyncResult | executeQueryAsync (self, QString query, Soprano.Query.QueryLanguage language, QString userQueryLanguage=QString()) |
Soprano.Util.AsyncResult | isEmptyAsync (self) |
Soprano.Util.AsyncResult | listContextsAsync (self) |
Soprano.Util.AsyncResult | listStatementsAsync (self, Soprano.Statement statement) |
Soprano.Util.AsyncResult | removeAllStatementsAsync (self, Soprano.Statement statement) |
Soprano.Util.AsyncResult | removeStatementAsync (self, Soprano.Statement statement) |
Soprano.Util.AsyncResult | statementCountAsync (self) |
Method Documentation
__init__ | ( | self, | ||
Soprano.Model | parent=0 | |||
) |
Create a new Model.
- Parameters:
-
parent The parent model to forward the operations to.
Soprano.Util.AsyncResult addStatementAsync | ( | self, | ||
Soprano.Statement | statement | |||
) |
Asyncroneously add the Statement to the Model.
- Parameters:
-
statement The Statement to add.
\sa addStatement
- Returns:
- an AsyncResult with result type Error.ErrorCode object which will signal when the result is ready.
Soprano.Util.AsyncResult containsAnyStatementAsync | ( | self, | ||
Soprano.Statement | statement | |||
) |
Asyncroneously check if the model contains certain statements.
- Parameters:
-
statement A partially defined statement that serves as a pattern.
\sa containsAnyStatement
- Returns:
- an AsyncResult with result type bool object which will signal when the result is ready.
Soprano.Util.AsyncResult containsStatementAsync | ( | self, | ||
Soprano.Statement | statement | |||
) |
AsyncResult check if the model contains a statements.
- Parameters:
-
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.
\sa containsStatement
- Returns:
- an AsyncResult with result type bool object which will signal when the result is ready.
Soprano.Util.AsyncResult createBlankNodeAsync | ( | self ) |
Asyncroneously create a new blank node with a unique identifier.
\sa createBlankNode
- Returns:
- an AsyncResult with result type Node object which will signal when the result is ready.
Soprano.Util.AsyncResult executeQueryAsync | ( | self, | ||
QString | query, | |||
Soprano.Query.QueryLanguage | language, | |||
QString | userQueryLanguage=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.
- Parameters:
-
query The query to evaluate.
- Parameters:
-
language The %query language used to encode query.
- Parameters:
-
userQueryLanguage If language equals Query.QueryLanguageUser userQueryLanguage defines the language to use.
\sa executeQuery
- Returns:
- an AsyncResult with result type QueryResultIterator object which will signal when the result is ready.
Soprano.Util.AsyncResult isEmptyAsync | ( | self ) |
Asyncroneously check if the Model does contain any Statement.
\sa isEmpty
- Returns:
- an AsyncResult with result type bool object which will signal when the result is ready.
Soprano.Util.AsyncResult listContextsAsync | ( | self ) |
Asyncroneously list all contexts in the model, i.e. all named graphs.
\sa listContexts
- Returns:
- an AsyncResult with result type NodeIterator object which will signal when the result is ready.
Soprano.Util.AsyncResult listStatementsAsync | ( | self, | ||
Soprano.Statement | statement | |||
) |
Asyncroneously return an iterator over Model Statements that "partial" match the input Statement.
- Parameters:
-
statement The partial Statement to match.
\sa listStatements
- Returns:
- an AsyncResult with result type StatementIterator object which will signal when the result is ready.
Soprano.Util.AsyncResult removeAllStatementsAsync | ( | self, | ||
Soprano.Statement | statement | |||
) |
Asyncroneously remove all statements that match the partial statement. For removing one specific statement see removeStatement().
- Parameters:
-
statement A possible partially defined statement that serves as a filter for all statements that should be removed.
\sa removeAllStatements
- Returns:
- an AsyncResult with result type Error.ErrorCode object which will signal when the result is ready.
Soprano.Util.AsyncResult removeStatementAsync | ( | self, | ||
Soprano.Statement | statement | |||
) |
Asyncroneously remove one statement. For removing statements with wildward matching see removeAllStatementsAsync().
- Parameters:
-
statement The statement that should be removed. This has to be a valid statement.
\sa removeStatement
- Returns:
- an AsyncResult with result type Error.ErrorCode object which will signal when the result is ready.
Soprano.Util.AsyncResult statementCountAsync | ( | self ) |
Asyncroneously determine the number of statements stored in this Model.
\sa statementCount
- Returns:
- an AsyncResult with result type int object which will signal when the result is ready.