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_STORAGE_MODEL_H_ 00023 #define _SOPRANO_STORAGE_MODEL_H_ 00024 00025 #include "model.h" 00026 #include "soprano_export.h" 00027 00028 namespace Soprano { 00029 00030 class Backend; 00031 00044 class SOPRANO_EXPORT StorageModel : public Model 00045 { 00046 Q_OBJECT 00047 00048 public: 00049 virtual ~StorageModel(); 00050 00054 virtual bool isEmpty() const; 00055 00059 virtual bool containsStatement( const Statement &statement ) const; 00060 00064 virtual bool containsAnyStatement( const Statement &statement ) const; 00065 00069 virtual Error::ErrorCode removeAllStatements( const Statement &statement ); 00070 00071 /* 00072 * Default implementation uses Query::Serializer for Query::QueryLanguageSparql and 00073 * executeQuery( const QString&, Query::QueryLanguage, const QString& ) const. 00074 * 00075 * Be aware that one of the two query methods has to be re-implemented. 00076 * Otherwise calling one of them results in an endless loop. 00077 */ 00078 // virtual QueryResultIterator executeQuery( const Query::Query& query ) const; 00079 00080 /* 00081 * Default implementation uses Query::Parser and 00082 * executeQuery( const Query::Query& ) const. 00083 * 00084 * Be aware that one of the two query methods has to be re-implemented. 00085 * Otherwise calling one of them results in an endless loop. 00086 */ 00087 // virtual QueryResultIterator executeQuery( const QString& query, Query::QueryLanguage language, const QString& userQueryLanguage = QString() ) const; 00088 00092 const Backend* backend() const; 00093 00094 using Model::removeAllStatements; 00095 using Model::containsStatement; 00096 using Model::containsAnyStatement; 00097 00098 protected: 00102 StorageModel( const Backend* backend ); 00103 00104 private: 00105 class Private; 00106 Private* const d; 00107 }; 00108 } 00109 00110 #endif