soprano/inference/inferencemodel.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_INFERENCE_MODEL_H_
00023 #define _SOPRANO_INFERENCE_MODEL_H_
00024 
00025 #include "filtermodel.h"
00026 #include "soprano_export.h"
00027 
00028 class QUrl;
00029 
00030 namespace Soprano {
00031 
00032     class Statement;
00033 
00034     namespace Inference {
00035 
00036         class Rule;
00037 
00071         class SOPRANO_EXPORT InferenceModel : public FilterModel
00072         {
00073             Q_OBJECT
00074 
00075         public:
00076             InferenceModel( Model* parent );
00077             ~InferenceModel();
00078 
00083             Error::ErrorCode addStatement( const Statement& );
00084 
00088             Error::ErrorCode removeStatement( const Statement& );
00089 
00093             Error::ErrorCode removeAllStatements( const Statement& );
00094 
00100             void addRule( const Rule& );
00101 
00107             void setRules( const QList<Rule>& rules );
00108         
00109         public Q_SLOTS:
00119             void performInference();
00120 
00126             void clearInference();
00127 
00142             void setCompressedSourceStatements( bool b );
00143 
00156             void setOptimizedQueriesEnabled( bool b );
00157 
00158         private:
00167             int inferStatement( const Statement& statement, bool recurse = false );
00168 
00177             int inferRule( const Rule& rule, bool recurse );
00178 
00183             QList<Node> inferedGraphsForStatement( const Statement& statement ) const;
00184 
00189             QUrl storeUncompressedSourceStatement( const Statement& sourceStatement );
00190 
00191             class Private;
00192             Private* const d;
00193         };
00194     }
00195 }
00196 
00197 uint qHash( const Soprano::Node& node );
00198 
00199 #endif

Generated on Fri Mar 7 18:57:44 2008 for Soprano by  doxygen 1.5.4