Debian Codegraph @

Source/Reasoner/Answerer/CRedlandRasqalSubQueryTripleResolvingData.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_CREDLANDRASQALSUBQUERYTRIPLERESOLVINGDATA_H
23 #define KONCLUDE_REASONER_ANSWERER_CREDLANDRASQALSUBQUERYTRIPLERESOLVINGDATA_H
24
25 // Libraries includes
•26 #include <librdf.h>
27
28
29 // Namespace includes
30 #include "AnswererSettings.h"
31 #include "CAnsweringHandlingStatistics.h"
32 #include "CComplexQueryCompositionProcessingData.h"
33
34
35
36 // Other includes
37 #include "Reasoner/Query/CComplexAnsweringExpressionQuery.h"
38 #include "Reasoner/Query/CVariableBindingsAnswersResultIterator.h"
39
40 #include "Concurrent/Callback/CCallbackData.h"
41
42 // Logger includes
43 #include "Logger/CLogger.h"
44
45
46 namespace Konclude {
47
48 using namespace Concurrent::Callback;
49
50 namespace Reasoner {
51
52 using namespace Query;
53
54 namespace Answerer {
55
56
57 /*!
58 *
59 * \class CRedlandRasqalSubQueryTripleResolvingData
60 * \author Andreas Steigmiller
61 * \version 0.1
62 * \brief TODO
63 *
64 */
65 class CRedlandRasqalSubQueryTripleResolvingData {
66 // public methods
67 public:
68 //! Constructor
69 CRedlandRasqalSubQueryTripleResolvingData(CRedlandRasqalSubQueryProcessingData* subQueryData, cint64 triplePos, cint64 subjectPos, cint64 predicatePos, cint64 objectPos);
70
71 ~CRedlandRasqalSubQueryTripleResolvingData();
72
73 cint64 getTriplePosition();
74 CRedlandRasqalSubQueryProcessingData* getSubQueryProcessingData();
75
76
77 bool isResolved();
78 CRedlandRasqalSubQueryTripleResolvingData* setResolved(bool resolved);
79
80 cint64 getBindingsVectorResolvingPosition(cint64 pos);
81
82 cint64 getSubjectBindingsVectorResolvingPosition();
83 cint64 getPredicateBindingsVectorResolvingPosition();
84 cint64 getObjectBindingsVectorResolvingPosition();
85
86
87 bool getVariableBound(cint64 pos);
88 bool getSubjectVariableBound();
89 bool getPredicateVariableBound();
90 bool getObjectVariableBound();
91
92 CRedlandRasqalSubQueryTripleResolvingData* setSubjectVariableBound(bool bound);
93 CRedlandRasqalSubQueryTripleResolvingData* setPredicateVariableBound(bool bound);
94 CRedlandRasqalSubQueryTripleResolvingData* setObjectVariableBound(bool bound);
95
96 rasqal_variable* getVariable(cint64 pos);
97 CRedlandRasqalSubQueryTripleResolvingData* setVariable(cint64 pos, rasqal_variable* var);
98
99 rasqal_variable* getSubjectVariable();
100 rasqal_variable* getPredicateVariable();
101 rasqal_variable* getObjectVariable();
102
103 CRedlandRasqalSubQueryTripleResolvingData* setSubjectVariable(rasqal_variable* var);
104 CRedlandRasqalSubQueryTripleResolvingData* setPredicateVariable(rasqal_variable* var);
105 CRedlandRasqalSubQueryTripleResolvingData* setObjectVariable(rasqal_variable* var);
106
107
108 librdf_node* getBoundNode(cint64 pos);
109 CRedlandRasqalSubQueryTripleResolvingData* setBoundNode(cint64 pos, librdf_node* node);
110
111 CRedlandRasqalSubQueryTripleResolvingData* setSubjectBoundNode(librdf_node* node);
112 CRedlandRasqalSubQueryTripleResolvingData* setPredicateBoundNode(librdf_node* node);
113 CRedlandRasqalSubQueryTripleResolvingData* setObjectBoundNode(librdf_node* node);
114
115 rasqal_literal* getBoundLiteral(cint64 pos);
116 CRedlandRasqalSubQueryTripleResolvingData* setBoundLiteral(cint64 pos, rasqal_literal* node);
117
118 CRedlandRasqalSubQueryTripleResolvingData* setSubjectBoundLiteral(rasqal_literal* node);
119 CRedlandRasqalSubQueryTripleResolvingData* setPredicateBoundLiteral(rasqal_literal* node);
120 CRedlandRasqalSubQueryTripleResolvingData* setObjectBoundLiteral(rasqal_literal* node);
121
122 librdf_statement* getNextTransferringStatement();
123
124
125 // protected methods
126 protected:
127
128 // protected variables
129 protected:
130 bool mResolved;
131 cint64 mTriplePos;
132 CRedlandRasqalSubQueryProcessingData* mSubQueryData;
133 cint64 mPos[3];
134 bool mVariableBound[3];
135 rasqal_variable* mVariable[3];
136 librdf_node* mBoundNode[3];
137 rasqal_literal* mBoundLiteral[3];
138
139 librdf_statement* mTransferringStatement[3];
140 cint64 mNextTransferrringStatementPos = 0;
141
142 // private methods
143 private:
144
145 // private variables
146 private:
147
148 };
149
150 }; // end namespace Answerer
151
152 }; // end namespace Reasoner
153
154 }; // end namespace Konclude
155
156 #endif // KONCLUDE_REASONER_ANSWERER_CREDLANDRASQALSUBQUERYTRIPLERESOLVINGDATA_H
157
158 #endif // KONCLUDE_REDLAND_INTEGRATION