Debian Codegraph @

Source/Reasoner/Answerer/CRedlandRasqalModelSubQueryResolver.h

raw ◀ ▶
1 Debian patch touch this file
1 /*
2 * Copyright (C) 2013-2015, 2019 by the Konclude Developer Team.
3 *
4 * This file is part of the reasoning system Konclude.
5 * For details and support, see <http://konclude.com/>.
6 *
7 * Konclude is free software: you can redistribute it and/or modify
8 * it under the terms of version 3 of the GNU Lesser General Public
9 * License (LGPLv3) as published by the Free Software Foundation.
10 *
11 * Konclude 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
14 * GNU (Lesser) General Public License for more details.
15 *
16 * You should have received a copy of the GNU (Lesser) General Public
17 * License along with Konclude. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20 #ifdef KONCLUDE_REDLAND_INTEGRATION
21
22 #ifndef KONCLUDE_REASONER_ANSWERER_CREDLANDRASQALMODELSUBQUERYRESOLVER_H
23 #define KONCLUDE_REASONER_ANSWERER_CREDLANDRASQALMODELSUBQUERYRESOLVER_H
24
25 // Libraries includes
•26 #include <librdf.h>
27
28
29 // Namespace includes
30 #include "AnswererSettings.h"
31 #include "CRedlandRasqalSubQueryProcessingData.h"
32 #include "CRedlandRasqalSubQueryTripleResolvingData.h"
33 #include "CRedlandRasqalSubQueryBindingPositionResolvingHash.h"
34 #include "CRedlandRasqalSubQueryBoundNodeResolvingHash.h"
35
36
37 // Other includes
38 #include "Reasoner/Query/CVariableBindingsAnswersResult.h"
39 #include "Reasoner/Query/CVariableBindingsListAnswerResult.h"
40 #include "Reasoner/Query/CRedlandRasqalBGPsCompositionQuery.h"
41
42 // Logger includes
43 #include "Logger/CLogger.h"
44
45
46 namespace Konclude {
47
48 namespace Reasoner {
49
50 using namespace Query;
51
52 namespace Answerer {
53
54
55 #define KONCLUDE_REDLAND_RASQAL_SUBQUERY_DIRECT_RASQAL_LITERAL_RESOLVING
56 #ifndef KONCLUDE_REDLAND_RASQAL_SUBQUERY_DIRECT_RASQAL_LITERAL_RESOLVING
57 #define KONCLUDE_REDLAND_RASQAL_SUBQUERY_LIBRDF_NODE_RESOLVING
58 #endif
59
60 /*!
61 *
62 * \class CRedlandRasqalModelSubQueryResolver
63 * \author Andreas Steigmiller
64 * \version 0.1
65 * \brief TODO
66 *
67 */
68 class CRedlandRasqalModelSubQueryResolver {
69 // public methods
70 public:
71 //! Constructor
72 CRedlandRasqalModelSubQueryResolver(QVector<CRedlandRasqalSubQueryProcessingData*>* subQueryProcDataVec, librdf_world* world, librdf_query* redlandQuery, rasqal_query* rasqalQuery, QHash<QString, TDependentOntologyPair>* queryKbNameDepOntPair);
73
74 ~CRedlandRasqalModelSubQueryResolver();
75
76
77 librdf_model* getRedlandResolvingModel();
78 librdf_world* getRedlandWorld();
79 rasqal_query* getRasqalQuery();
80
81
82 QVector<CRedlandRasqalSubQueryProcessingData*>* getSubQueryProcessingDataVector();
83
84 QString getIterationStatusString();
85
86 QHash<QString, TDependentOntologyPair>* getQueryKnowledgeBaseNameDependentOntologyPairHash();
87 QHash<QString, TDependentOntologyPair>::const_iterator getQueryKnowledgeBaseNameDependentOntologyPairHashIterator();
88 CRedlandRasqalModelSubQueryResolver* setQueryKnowledgeBaseNameDependentOntologyPairHashIterator(QHash<QString, TDependentOntologyPair>::const_iterator it);
89
90 QVector<rasqal_literal*>* getTriplesContextLiteralVector();
91 bool isTriplesContextLiteralsReset();
92 CRedlandRasqalModelSubQueryResolver* setTriplesContextLiteralsReset(bool reset);
93
94
95 // protected methods
96 protected:
97 void releaseRedlandResolvingModel();
98
99 // protected variables
100 protected:
101
102 QVector<CRedlandRasqalSubQueryProcessingData*>* mSubQueryProcDataVec;
103 librdf_world* mWorld;
104 librdf_query* mRedlandQuery;
105 rasqal_query* mRasqalQuery;
106 librdf_model* mResolvingModel;
107
108 QString* mRasqalErrorString;
109 QHash<QString, TDependentOntologyPair>* mQueryKbNameDepOntPairHash;
110 QHash<QString, TDependentOntologyPair>::const_iterator mQueryKbNameDepOntPairHashIt;
111
112 QVector<rasqal_literal*> mTriplesContextLiteralVector;
113 bool mTriplesContextLiteralsReset;
114
115
116 // private methods
117 private:
118
119 // private variables
120 private:
121
122 };
123
124 }; // end namespace Answerer
125
126 }; // end namespace Reasoner
127
128 }; // end namespace Konclude
129
130 #endif // KONCLUDE_REASONER_ANSWERER_CREDLANDRASQALMODELSUBQUERYRESOLVER_H
131
132 #endif // KONCLUDE_REDLAND_INTEGRATION