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
Soprano::FilterModel::listStatements
virtual StatementIterator listStatements(const Statement &partial) const=0
Soprano::Util::AsyncModel::AsyncModelMode
AsyncModelMode
Definition: asyncmodel.h:89
soprano_export.h
Soprano::Vocabulary::RDF::subject
SOPRANO_EXPORT QUrl subject()
Soprano::Util::AsyncResult
A delayed result as returned by AsyncModel.
Definition: asyncresult.h:53
Soprano::Util::AsyncModel::removeStatementsAsync
AsyncResult * removeStatementsAsync(const QList< Statement > &statements)
Soprano::Util::AsyncModel::isEmptyAsync
AsyncResult * isEmptyAsync() const
Soprano::Vocabulary::RDF::Statement
SOPRANO_EXPORT QUrl Statement()
Soprano::Util::AsyncModel::statementCountAsync
AsyncResult * statementCountAsync() const
Soprano::FilterModel::containsAnyStatement
virtual bool containsAnyStatement(const Statement &statement) const=0
Soprano::Query::QueryLanguage
QueryLanguage
Definition: sopranotypes.h:129
Soprano::Vocabulary::RDF::predicate
SOPRANO_EXPORT QUrl predicate()
Soprano::FilterModel::addStatement
virtual Error::ErrorCode addStatement(const Statement &statement)=0
asyncresult.h
SOPRANO_EXPORT
#define SOPRANO_EXPORT
Definition: soprano_export.h:37
Soprano::Util::AsyncModel::addStatementAsync
AsyncResult * addStatementAsync(const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
Soprano::Util::AsyncModel::AsyncModel
AsyncModel(Model *parent=0)
Soprano::FilterModel
A FilterModel is a virtual model that wraps another Model.
Definition: filtermodel.h:49
QList
Soprano::Util::AsyncModel::addStatementsAsync
AsyncResult * addStatementsAsync(const QList< Statement > &statements)
Soprano::FilterModel::containsStatement
virtual bool containsStatement(const Statement &statement) const=0
Soprano::Statement
A Statement instance represents one RDF quadruple.
Definition: statement.h:48
Soprano::Util::AsyncModel
Filter model that allows to perform operations asyncroneously.
Definition: asyncmodel.h:68
Soprano::Util::AsyncModel::listStatements
StatementIterator listStatements(const Statement &partial) const
Soprano::Util::AsyncModel::listStatementsAsync
AsyncResult * listStatementsAsync(const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
Soprano::Util::AsyncModel::executeQueryAsync
AsyncResult * executeQueryAsync(const QString &query, Query::QueryLanguage language, const QString &userQueryLanguage=QString()) const
Soprano::Util::AsyncModel::addStatementAsync
AsyncResult * addStatementAsync(const Statement &statement)
Soprano::Util::AsyncModel::executeQuery
QueryResultIterator executeQuery(const QString &query, Query::QueryLanguage language, const QString &userQueryLanguage=QString()) const
Soprano::QueryResultIterator
An iterator for query results.
Definition: queryresultiterator.h:109
Soprano::Util::AsyncModel::containsAnyStatementAsync
AsyncResult * containsAnyStatementAsync(const Statement &statement) const
Soprano::Util::AsyncModel::setMode
void setMode(AsyncModelMode mode)
filtermodel.h
Soprano::Util::AsyncModel::listStatementsAsync
AsyncResult * listStatementsAsync(const Statement &statement) const
Soprano::Util::AsyncModel::listContextsAsync
AsyncResult * listContextsAsync() const
Soprano::FilterModel::removeStatement
virtual Error::ErrorCode removeStatement(const Statement &statement)=0
Soprano::Model
A Model is the central class in Soprano. It is a queryable collection of RDF quadruples,...
Definition: model.h:95
Soprano::Util::AsyncModel::listContexts
NodeIterator listContexts() const
Soprano::Util::AsyncModel::removeStatementAsync
AsyncResult * removeStatementAsync(const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
Soprano::StatementIterator
An iterator that provides a stream of Statements.
Definition: statementiterator.h:76
Soprano::Util::AsyncModel::mode
AsyncModelMode mode() const
Soprano
Definition: backend.h:36
Soprano::Util::AsyncModel::~AsyncModel
~AsyncModel()
Soprano::Util::AsyncModel::removeStatementAsync
AsyncResult * removeStatementAsync(const Statement &statement)
Soprano::Util::AsyncModel::containsAnyStatementAsync
AsyncResult * containsAnyStatementAsync(const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
Soprano::Util::AsyncModel::listStatementsAsync
AsyncResult * listStatementsAsync() const
Soprano::NodeIterator
An iterator that provides a stream of Nodes.
Definition: nodeiterator.h:73
Soprano::Util::AsyncModel::removeAllStatementsAsync
AsyncResult * removeAllStatementsAsync(const Node &subject, const Node &predicate, const Node &object, const Node &context=Node())
Soprano::Node
A Node represents one RDF resource.
Definition: node.h:54
Soprano::FilterModel::removeAllStatements
virtual Error::ErrorCode removeAllStatements(const Statement &statement)=0
Soprano::Util::AsyncModel::createBlankNodeAsync
AsyncResult * createBlankNodeAsync()
QString
Soprano::Vocabulary::Xesam::language
SOPRANO_EXPORT QUrl language()
Soprano::Util::AsyncModel::SingleThreaded
@ SingleThreaded
Definition: asyncmodel.h:95
Soprano::Util::AsyncModel::containsStatementAsync
AsyncResult * containsStatementAsync(const Node &subject, const Node &predicate, const Node &object, const Node &context=Node()) const
Soprano::Vocabulary::SIL::context
SOPRANO_EXPORT QUrl context()
Soprano::Util::AsyncModel::removeAllStatementsAsync
AsyncResult * removeAllStatementsAsync(const Statement &statement)
Soprano::Util::AsyncModel::containsStatementAsync
AsyncResult * containsStatementAsync(const Statement &statement) const