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 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