Soprano  2.9.4
inferencemodel.h
Go to the documentation of this file.
1 /*
2  * This file is part of Soprano Project.
3  *
4  * Copyright (C) 2007 Sebastian Trueg <trueg@kde.org>
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Library General Public
8  * License as published by the Free Software Foundation; either
9  * version 2 of the License, or (at your option) any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Library General Public License for more details.
15  *
16  * You should have received a copy of the GNU Library General Public License
17  * along with this library; see the file COPYING.LIB. If not, write to
18  * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19  * Boston, MA 02110-1301, USA.
20  */
21 
22 #ifndef _SOPRANO_INFERENCE_MODEL_H_
23 #define _SOPRANO_INFERENCE_MODEL_H_
24 
25 #include "filtermodel.h"
26 #include "soprano_export.h"
27 
28 class QUrl;
29 
30 namespace Soprano {
31 
32  class Statement;
33 
34  namespace Inference {
35 
36  class Rule;
37 
72  {
73  Q_OBJECT
74 
75  public:
76  InferenceModel( Model* parent );
78 
84 
89 
94 
100  void addRule( const Rule& );
101 
107  void setRules( const QList<Rule>& rules );
108 
112 
113  public Q_SLOTS:
124 
131 
147 
161 
162  private:
171  int inferStatement( const Statement& statement, bool recurse = false );
172 
181  int inferRule( const Rule& rule, bool recurse );
182 
187  QList<Node> inferedGraphsForStatement( const Statement& statement ) const;
188 
193  QUrl storeUncompressedSourceStatement( const Statement& sourceStatement );
194 
195  class Private;
196  Private* const d;
197  };
198  }
199 }
200 
201 #endif
soprano_export.h
Soprano::Vocabulary::SIL::sourceStatement
SOPRANO_EXPORT QUrl sourceStatement()
Soprano::Inference::InferenceModel::~InferenceModel
~InferenceModel()
QUrl
Soprano::Vocabulary::RDF::Statement
SOPRANO_EXPORT QUrl Statement()
Soprano::FilterModel::addStatement
virtual Error::ErrorCode addStatement(const Statement &statement)=0
Soprano::Inference::InferenceModel
The Soprano Inference Model provides a simple forward chaining inference engine which uses the underl...
Definition: inferencemodel.h:72
SOPRANO_EXPORT
#define SOPRANO_EXPORT
Definition: soprano_export.h:37
Soprano::FilterModel
A FilterModel is a virtual model that wraps another Model.
Definition: filtermodel.h:49
QList
Soprano::Inference::Rule
A rule used by the InferenceModel to generate inferenced statements.
Definition: inferencerule.h:50
Soprano::Statement
A Statement instance represents one RDF quadruple.
Definition: statement.h:48
Soprano::Inference::InferenceModel::addRule
void addRule(const Rule &)
Soprano::Inference::InferenceModel::clearInference
void clearInference()
filtermodel.h
Soprano::Inference::InferenceModel::performInference
void performInference()
Soprano::Inference::InferenceModel::setOptimizedQueriesEnabled
void setOptimizedQueriesEnabled(bool b)
Soprano::FilterModel::removeStatement
virtual Error::ErrorCode removeStatement(const Statement &statement)=0
Soprano::Model
A Model is the central class in Soprano. It is a queryable collection of RDF quadruples,...
Definition: model.h:95
Soprano::Inference::InferenceModel::setCompressedSourceStatements
void setCompressedSourceStatements(bool b)
Soprano::Inference::InferenceModel::addStatement
Error::ErrorCode addStatement(const Statement &)
Soprano::Inference::InferenceModel::InferenceModel
InferenceModel(Model *parent)
Soprano
Definition: backend.h:36
Soprano::Inference::InferenceModel::removeAllStatements
Error::ErrorCode removeAllStatements(const Statement &)
Soprano::Inference::InferenceModel::removeStatement
Error::ErrorCode removeStatement(const Statement &)
Soprano::Error::ErrorCode
ErrorCode
Definition: error.h:40
Soprano::Vocabulary::NRL::rule
SOPRANO_EXPORT QUrl rule()
Soprano::FilterModel::removeAllStatements
virtual Error::ErrorCode removeAllStatements(const Statement &statement)=0
Soprano::Inference::InferenceModel::setRules
void setRules(const QList< Rule > &rules)