Soprano  2.9.4
queryresultiterator.h
Go to the documentation of this file.
1 /*
2  * This file is part of Soprano Project.
3  *
4  * Copyright (C) 2006 Daniele Galdi <daniele.galdi@gmail.com>
5  * Copyright (C) 2007-2009 Sebastian Trueg <trueg@kde.org>
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public License
18  * along with this library; see the file COPYING.LIB. If not, write to
19  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22 
23 #ifndef SOPRANO_RESULT_SET_H
24 #define SOPRANO_RESULT_SET_H
25 
26 #include "iterator.h"
27 #include "bindingset.h"
28 #include "statement.h"
29 #include "soprano_export.h"
30 
31 #include <QtCore/QString>
32 #include <QtCore/QStringList>
33 
34 
35 namespace Soprano {
36 
37  class Node;
38  class NodeIterator;
39  class QueryResultIteratorBackend;
40  class StatementIterator;
41  class BindingSet;
42 
108  class SOPRANO_EXPORT QueryResultIterator : public Iterator<BindingSet>
109  {
110  public:
112 
116 
121 
127 
131  virtual ~QueryResultIterator();
132 
136  QueryResultIterator& operator=( const QueryResultIterator& );
138 
140 
144  Statement currentStatement() const;
145 
150  BindingSet currentBindings() const;
151 
159  bool boolValue() const;
161 
163 
175  Node operator[]( int offset ) const;
176 
189  Node operator[]( const QString name ) const;
190 
201  Node binding( const QString &name ) const;
202 
213  Node binding( int offset ) const;
214 
222  int bindingCount() const;
223 
229  QStringList bindingNames() const;
231 
233 
239  bool isGraph() const;
240 
247  bool isBinding() const;
248 
257  bool isBool() const;
259 
261 
265  QList<BindingSet> allBindings();
266 
276  StatementIterator iterateStatements() const;
277 
290  NodeIterator iterateBindings( const QString& variableName ) const;
291 
304  NodeIterator iterateBindings( int offset ) const;
305 
336  StatementIterator iterateStatementsFromBindings( const QString& subjectBindingName,
337  const QString& predicateBindingName,
338  const QString& objectBindingName,
339  const QString& contextBindingName = QString(),
340  const Statement& templateStatement = Statement() ) const;
342  };
343 }
344 
345 #endif // SOPRANO_RESULT_SET_H
A Node represents one RDF resource.
Definition: node.h:53
QueryResultIteratorBackend is the actual working horse behind QueryResultIterator.
A Statement instance represents one RDF quadruple.
Definition: statement.h:47
An iterator for query results.
SOPRANO_EXPORT QUrl name()
An iterator that provides a stream of Statements.
The basic Soprano iterator class.
Definition: iterator.h:78
SOPRANO_EXPORT QUrl Statement()
Represents one set of bindings in the result of a select query.
Definition: bindingset.h:48
#define SOPRANO_EXPORT
An iterator that provides a stream of Nodes.
Definition: nodeiterator.h:72