Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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 using FilterModel::addStatement;
00110 using FilterModel::removeStatement;
00111 using FilterModel::removeAllStatements;
00112
00113 public Q_SLOTS:
00123 void performInference();
00124
00130 void clearInference();
00131
00146 void setCompressedSourceStatements( bool b );
00147
00160 void setOptimizedQueriesEnabled( bool b );
00161
00162 private:
00171 int inferStatement( const Statement& statement, bool recurse = false );
00172
00181 int inferRule( const Rule& rule, bool recurse );
00182
00187 QList<Node> inferedGraphsForStatement( const Statement& statement ) const;
00188
00193 QUrl storeUncompressedSourceStatement( const Statement& sourceStatement );
00194
00195 class Private;
00196 Private* const d;
00197 };
00198 }
00199 }
00200
00201 #endif