Soprano  2.7.6
dummymodel.h
Go to the documentation of this file.
1 /*
2  * This file is part of Soprano Project.
3  *
4  * Copyright (C) 2007 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_DUMMY_MODEL_H
23 #define SOPRANO_DUMMY_MODEL_H
24 
25 #include "soprano_export.h"
26 #include "model.h"
27 
28 
29 namespace Soprano {
30  namespace Util {
43  {
44  Q_OBJECT
45 
46  public:
50  DummyModel();
51 
55  ~DummyModel();
56 
58  Error::ErrorCode addStatement( const Statement &statement );
59  Error::ErrorCode addStatement( const Node& subject, const Node& predicate, const Node& object, const Node& context = Node() );
60  Error::ErrorCode addStatements( const QList<Statement> &statements );
62 
64  Error::ErrorCode removeStatement( const Statement &statement );
65  Error::ErrorCode removeStatement( const Node& subject, const Node& predicate, const Node& object, const Node& context = Node() );
66  Error::ErrorCode removeAllStatements( const Statement &statement );
67  Error::ErrorCode removeStatements( const QList<Statement> &statements );
68  Error::ErrorCode removeContext( const Node& );
69  Error::ErrorCode removeAllStatements();
71 
73  StatementIterator listStatements( const Statement &partial ) const;
74  StatementIterator listStatements( const Node& subject, const Node& predicate, const Node& object, const Node& context = Node() ) const;
75  StatementIterator listStatements() const;
76  StatementIterator listStatementsInContext( const Node &context ) const;
77  NodeIterator listContexts() const;
78 // QueryResultIterator executeQuery( const Query::Query& query ) const;
79  QueryResultIterator executeQuery( const QString& query, Query::QueryLanguage language, const QString& userQueryLanguage = QString() ) const;
81 
83  bool containsAnyStatement( const Statement &statement ) const;
84  bool containsAnyStatement( const Node& subject, const Node& predicate, const Node& object, const Node& context = Node() ) const;
85  bool containsStatement( const Statement &statement ) const;
86  bool containsStatement( const Node& subject, const Node& predicate, const Node& object, const Node& context = Node() ) const;
87  bool containsContext( const Node &context ) const;
88  bool isEmpty() const;
89  int statementCount() const;
91 
93  Error::ErrorCode write( QTextStream &os ) const;
95 
97  Node createBlankNode();
99 
100  private:
101  class Private;
102  Private* const d;
103  };
104  }
105 }
106 
107 #endif