Soprano  2.9.4
asyncmodel.h
Go to the documentation of this file.
1 /*
2  * This file is part of Soprano Project.
3  *
4  * Copyright (C) 2008 Sebastian Trueg <trueg@kde.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef _SOPRANO_ASYNC_MODEL_H_
23 #define _SOPRANO_ASYNC_MODEL_H_
24 
25 #include "filtermodel.h"
26 #include "asyncresult.h" // backwards comp when AsyncResult was defined in this header
27 
28 #include "soprano_export.h"
29 
30 
31 namespace Soprano {
32 
33  class Statement;
34  class StatementIterator;
35  class Node;
36  class NodeIterator;
37  class QueryResultIterator;
38 
39  namespace Util {
40 
41  class AsyncModelPrivate;
42 
68  {
69  Q_OBJECT
70 
71  public:
77  AsyncModel( Model* parent = 0 );
78 
83 
96 
102  MultiThreaded
103  };
104 
113  void setMode( AsyncModelMode mode );
114 
123 
135 
141  AsyncResult* addStatementAsync( const Node& subject, const Node& predicate, const Node& object, const Node& context = Node() );
142 
149 
163 
169  AsyncResult* removeStatementAsync( const Node& subject, const Node& predicate, const Node& object, const Node& context = Node() );
170 
177 
191 
197  AsyncResult* removeAllStatementsAsync( const Node& subject, const Node& predicate, const Node& object, const Node& context = Node() );
198 
208 
218 
230  AsyncResult* listStatementsAsync( const Statement& statement ) const;
231 
237  AsyncResult* listStatementsAsync( const Node& subject, const Node& predicate, const Node& object, const Node& context = Node() ) const;
238 
247 
257 
278  const QString& userQueryLanguage = QString() ) const;
279 
292  AsyncResult* containsStatementAsync( const Statement& statement ) const;
293 
299  AsyncResult* containsStatementAsync( const Node& subject, const Node& predicate, const Node& object, const Node& context = Node() ) const;
300 
312  AsyncResult* containsAnyStatementAsync( const Statement& statement ) const;
313 
319  AsyncResult* containsAnyStatementAsync( const Node& subject, const Node& predicate, const Node& object, const Node& context = Node() ) const;
320 
330 
339  StatementIterator listStatements( const Statement& partial ) const;
340 
350 
359  QueryResultIterator executeQuery( const QString& query, Query::QueryLanguage language, const QString& userQueryLanguage = QString() ) const;
360 
367 
368  private:
369  AsyncModelPrivate* const d;
370 
371  Q_PRIVATE_SLOT( d, void _s_executeNextCommand() )
372  };
373  }
374 }
375 
376 #endif
A FilterModel is a virtual model that wraps another Model.
Definition: filtermodel.h:49
virtual StatementIterator listStatements(const Statement &partial) const=0
virtual bool containsStatement(const Statement &statement) const=0
virtual bool containsAnyStatement(const Statement &statement) const=0
virtual Error::ErrorCode removeStatement(const Statement &statement)=0
virtual Error::ErrorCode addStatement(const Statement &statement)=0
virtual Error::ErrorCode removeAllStatements(const Statement &statement)=0
A Model is the central class in Soprano. It is a queryable collection of RDF quadruples,...
Definition: model.h:95
An iterator that provides a stream of Nodes.
Definition: nodeiterator.h:73
A Node represents one RDF resource.
Definition: node.h:54
An iterator for query results.
An iterator that provides a stream of Statements.
A Statement instance represents one RDF quadruple.
Definition: statement.h:48
Filter model that allows to perform operations asyncroneously.
Definition: asyncmodel.h:68
AsyncResult * removeAllStatementsAsync(const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
AsyncResult * containsStatementAsync(const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
AsyncResult * addStatementAsync(const Statement &statement)
AsyncResult * addStatementsAsync(const QList< Statement > &statements)
AsyncResult * createBlankNodeAsync()
AsyncResult * removeStatementsAsync(const QList< Statement > &statements)
AsyncResult * listContextsAsync() const
AsyncResult * listStatementsAsync() const
StatementIterator listStatements(const Statement &partial) const
AsyncResult * containsAnyStatementAsync(const Statement &statement) const
void setMode(AsyncModelMode mode)
NodeIterator listContexts() const
AsyncResult * listStatementsAsync(const Statement &statement) const
AsyncResult * statementCountAsync() const
AsyncModel(Model *parent=0)
AsyncResult * removeStatementAsync(const Statement &statement)
AsyncModelMode mode() const
AsyncResult * listStatementsAsync(const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
AsyncResult * addStatementAsync(const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
AsyncResult * containsAnyStatementAsync(const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
AsyncResult * isEmptyAsync() const
QueryResultIterator executeQuery(const QString &query, Query::QueryLanguage language, const QString &userQueryLanguage=QString()) const
AsyncResult * executeQueryAsync(const QString &query, Query::QueryLanguage language, const QString &userQueryLanguage=QString()) const
AsyncResult * removeAllStatementsAsync(const Statement &statement)
AsyncResult * containsStatementAsync(const Statement &statement) const
AsyncResult * removeStatementAsync(const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
A delayed result as returned by AsyncModel.
Definition: asyncresult.h:53
SOPRANO_EXPORT QUrl predicate()
SOPRANO_EXPORT QUrl subject()
SOPRANO_EXPORT QUrl Statement()
SOPRANO_EXPORT QUrl context()
SOPRANO_EXPORT QUrl language()
#define SOPRANO_EXPORT