Soprano  2.7.56
Public Member Functions
Soprano::Client::DBusModel Class Reference

Interface to a DBus server model. More...

#include <Soprano/Client/DBusModel>

+ Inheritance diagram for Soprano::Client::DBusModel:

List of all members.

Public Member Functions

 DBusModel (const QString &serviceName, const QString &dbusObject, const Backend *backend=0)
 ~DBusModel ()
void setAsyncCalls (bool b)
bool asyncCalls () const
Error::ErrorCode addStatement (const Statement &statement)
NodeIterator listContexts () const
QueryResultIterator executeQuery (const QString &query, Query::QueryLanguage language, const QString &userQueryLanguage=QString()) const
StatementIterator listStatements (const Statement &partial) const
Error::ErrorCode removeStatement (const Statement &statement)
Error::ErrorCode removeAllStatements (const Statement &statement)
int statementCount () const
bool isEmpty () const
bool containsStatement (const Statement &statement) const
bool containsAnyStatement (const Statement &statement) const
Node createBlankNode ()

Detailed Description

Interface to a DBus server model.

The DBusModel provides a fully functional interface to a Model provided through a Soprano DBus server. It can thus, be seen as the counterpart to Server::DBusExportModel.

Given the DBus service name and the object path of the Model in question it handles all DBus communication transparently.

Normally there is no need to use this class directly as DBusClient does create instances of it on request.

DBusModel is not thread-safe by default and has to be protected if is is to be used from different threads (This can be done via Soprano::Util::MutexModel in Soprano::Util::MutexModel::ReadWriteMultiThreading mode or via setting the model to async mode via setAsyncCalls()).
Sebastian Trueg
See also:
Soprano D-Bus Interface

Definition at line 56 of file dbusmodel.h.

Constructor & Destructor Documentation

Soprano::Client::DBusModel::DBusModel ( const QString serviceName,
const QString dbusObject,
const Backend backend = 0 

Create a new DBus Model interface.

serviceNameThe name of the DBus service that provides the Model.
dbusObjectThe path to the Model object in the DBus service.
backendThe backend that created this model. Should always be set to 0.

Member Function Documentation

Configure DBusModel to use asyncronous calls over DBus. With asyncronous calls DBusModel will enter local event loops while waiting for the reply. This way multiple calls can be performed interweaved. However, the application does not block, i.e. events (such as signals and slots) are handled which might not be wanted. If that is the case it is better to use Util::MutexModel instead.

bIf true asyncronous calls are enabled.

Per default asyncronous calls are disabled.

Asyncronous calls only work in combination with a QCoreApplication instance.
See also:
true if asyncronous calls are enabled.

Add the Statement to the Model.

statementThe Statement to add.

Implements Soprano::Model.

List all contexts in the model, i.e. all named graphs.

An iterator over context Nodes, on error an invalid iterator is returned.

Implements Soprano::Model.

QueryResultIterator Soprano::Client::DBusModel::executeQuery ( const QString query,
Query::QueryLanguage  language,
const QString userQueryLanguage = QString() 
) const [virtual]

query_api_disabled 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.

queryThe query to evaluate.
languageThe query language used to encode query.
userQueryLanguageIf language equals Query::QueryLanguageUser userQueryLanguage defines the language to use.
An iterator over all results matching the query, on error an invalid iterator is returned.

Implements Soprano::Model.

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

partialThe partial Statement to match.
An iterator for all the matched Statements, on error an invalid iterator is returned.

Implements Soprano::Model.

Remove one statement. For removing statements with wildward matching see removeAllStatements().

statementThe statement that should be removed. This has to be a valid statement.
Error::ErrorNone on success and an error code if statement was invalid or an error occured.

Implements Soprano::Model.

Default implementation is based on listStatements() and removeStatement().

Reimplemented from Soprano::StorageModel.

The number of statements stored in this Model.

The size of the Model, or -1 on error.

Implements Soprano::Model.

bool Soprano::Client::DBusModel::isEmpty ( ) const [virtual]

Default implementation is based on Model::statementCount

Reimplemented from Soprano::StorageModel.

bool Soprano::Client::DBusModel::containsStatement ( const Statement statement) const [virtual]

Default implementation is based on Model::listStatements

Reimplemented from Soprano::StorageModel.

bool Soprano::Client::DBusModel::containsAnyStatement ( const Statement statement) const [virtual]

Default implementation is based on Model::listStatements

Reimplemented from Soprano::StorageModel.

Creates a new blank node with a unique identifier.

A blank node that can be used to create new statements.

Implements Soprano::Model.

The documentation for this class was generated from the following file: