Soprano  2.7.5
/builddir/build/BUILD/soprano-2.7.5/soprano/util/dummymodel.h
Go to the documentation of this file.
00001 /*
00002  * This file is part of Soprano Project.
00003  *
00004  * Copyright (C) 2007 Sebastian Trueg <trueg@kde.org>
00005  *
00006  * This library is free software; you can redistribute it and/or
00007  * modify it under the terms of the GNU Library General Public
00008  * License as published by the Free Software Foundation; either
00009  * version 2 of the License, or (at your option) any later version.
00010  *
00011  * This library is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014  * Library General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU Library General Public License
00017  * along with this library; see the file COPYING.LIB.  If not, write to
00018  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00019  * Boston, MA 02110-1301, USA.
00020  */
00021 
00022 #ifndef SOPRANO_DUMMY_MODEL_H
00023 #define SOPRANO_DUMMY_MODEL_H
00024 
00025 #include "soprano_export.h"
00026 #include "model.h"
00027 
00028 
00029 namespace Soprano {
00030     namespace Util {
00042         class SOPRANO_EXPORT DummyModel : public Model
00043         {
00044             Q_OBJECT
00045 
00046         public:
00050             DummyModel();
00051 
00055             ~DummyModel();
00056 
00058             Error::ErrorCode addStatement( const Statement &statement );
00059             Error::ErrorCode addStatement( const Node& subject, const Node& predicate, const Node& object, const Node& context = Node() );
00060             Error::ErrorCode addStatements( const QList<Statement> &statements );
00062 
00064             Error::ErrorCode removeStatement( const Statement &statement );
00065             Error::ErrorCode removeStatement( const Node& subject, const Node& predicate, const Node& object, const Node& context = Node() );
00066             Error::ErrorCode removeAllStatements( const Statement &statement );
00067             Error::ErrorCode removeStatements( const QList<Statement> &statements );
00068             Error::ErrorCode removeContext( const Node& );
00069             Error::ErrorCode removeAllStatements();
00071 
00073             StatementIterator listStatements( const Statement &partial ) const;
00074             StatementIterator listStatements( const Node& subject, const Node& predicate, const Node& object, const Node& context = Node() ) const;
00075             StatementIterator listStatements() const;
00076             StatementIterator listStatementsInContext( const Node &context ) const;
00077             NodeIterator listContexts() const;
00078 //    QueryResultIterator executeQuery( const Query::Query& query ) const;
00079             QueryResultIterator executeQuery( const QString& query, Query::QueryLanguage language, const QString& userQueryLanguage = QString() ) const;
00081 
00083             bool containsAnyStatement( const Statement &statement ) const;
00084             bool containsAnyStatement( const Node& subject, const Node& predicate, const Node& object, const Node& context = Node() ) const;
00085             bool containsStatement( const Statement &statement ) const;
00086             bool containsStatement( const Node& subject, const Node& predicate, const Node& object, const Node& context = Node() ) const;
00087             bool containsContext( const Node &context ) const;
00088             bool isEmpty() const;
00089             int statementCount() const;
00091 
00093             Error::ErrorCode write( QTextStream &os ) const;
00095 
00097             Node createBlankNode();
00099 
00100         private:
00101             class Private;
00102             Private* const d;
00103         };
00104     }
00105 }
00106 
00107 #endif