1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
|
/*
* Copyright (C) 2013-2015, 2019 by the Konclude Developer Team.
*
* This file is part of the reasoning system Konclude.
* For details and support, see <http://konclude.com/>.
*
* Konclude is free software: you can redistribute it and/or modify
* it under the terms of version 3 of the GNU Lesser General Public
* License (LGPLv3) as published by the Free Software Foundation.
*
* Konclude is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU (Lesser) General Public License for more details.
*
* You should have received a copy of the GNU (Lesser) General Public
* License along with Konclude. If not, see <http://www.gnu.org/licenses/>.
*
*/
#ifdef KONCLUDE_REDLAND_INTEGRATION
#ifndef KONCLUDE_REASONER_ANSWERER_CREDLANDRASQALSUBQUERYPROCESSINGDATA_H
#define KONCLUDE_REASONER_ANSWERER_CREDLANDRASQALSUBQUERYPROCESSINGDATA_H
// Libraries includes
#include <librdf.h>
// Namespace includes
#include "AnswererSettings.h"
#include "CAnsweringHandlingStatistics.h"
#include "CComplexQueryCompositionProcessingData.h"
#include "CRedlandRasqalSubQueryBoundNodeResolvingHashData.h"
// Other includes
#include "Reasoner/Query/CComplexAnsweringExpressionQuery.h"
#include "Reasoner/Query/CVariableBindingsAnswersResultIterator.h"
#include "Reasoner/Query/CVariableBindingsAnswersResult.h"
#include "Reasoner/Query/CBooleanQueryResult.h"
#include "Concurrent/Callback/CCallbackData.h"
// Logger includes
#include "Logger/CLogger.h"
namespace Konclude {
using namespace Concurrent::Callback;
namespace Reasoner {
using namespace Query;
namespace Answerer {
/*!
*
* \class CRedlandRasqalSubQueryProcessingData
* \author Andreas Steigmiller
* \version 0.1
* \brief TODO
*
*/
class CRedlandRasqalSubQueryProcessingData {
// public methods
public:
//! Constructor
CRedlandRasqalSubQueryProcessingData(cint64 subQueryId, CComplexAnsweringExpressionQuery* subQuery, rasqal_graph_pattern* subqueryGraphPattern, int gpTripleStartPos, int gpTriplesEndPos, librdf_world* world);
~CRedlandRasqalSubQueryProcessingData();
CComplexAnsweringExpressionQuery* getSubQuery();
bool isProcessed();
CRedlandRasqalSubQueryProcessingData* setProcessed(bool processed);
bool isProcessing();
CRedlandRasqalSubQueryProcessingData* setProcessing(bool processing);
cint64 getSubQueryId();
CVariableBindingsAnswersResultIterator* getAnswersIterator();
CVariableBindingsResultIterator* getVariableBindingsIterator();
CRedlandRasqalSubQueryProcessingData* setAnswersIterator(CVariableBindingsAnswersResultIterator* answersIterator);
CRedlandRasqalSubQueryProcessingData* setVariableBindingsIterator(CVariableBindingsResultIterator* variableBindingsIterator);
CVariableBindingResult* getCurrentVariableBinding();
CRedlandRasqalSubQueryProcessingData* setCurrentVariableBinding(CVariableBindingResult* varBin);
librdf_world* getRedlandWorld();
librdf_node* getDefaultReturningNode();
CRedlandRasqalSubQueryProcessingData* setDefaultReturningNode(librdf_node* node);
bool isInitialized();
CRedlandRasqalSubQueryProcessingData* setInitialized(bool initialized);
cint64 getNextReturningPosition();
CRedlandRasqalSubQueryProcessingData* setNextReturningPosition(cint64 pos);
QVector<CRedlandRasqalSubQueryTripleResolvingData*>* getTriplesResolvingDataVector();
QVector<CVariableBindingResult*>* getCurrentBindingsVector();
QVector<CVariableBindingResult*>* getNextBindingsVector();
QStringList* getTriplesRemainingBindingVariableList();
cint64 getNextBindingsVariablePosition();
CRedlandRasqalSubQueryProcessingData* incNextBindingsVariablePosition(cint64 incCount = 1);
rasqal_graph_pattern* getSubqueryGraphPattern();
int getGPTripleStartPos();
int getGPTriplesEndPos();
cint64 getBindingsCount();
CRedlandRasqalSubQueryProcessingData* setBindingsCount(cint64 count);
QVector<rasqal_literal*>* getBindingPositionVariableBoundRedlandNodeVector();
bool hasBoundVariables();
CRedlandRasqalSubQueryProcessingData* setBoundVariables(bool boundVariables);
CRedlandRasqalSubQueryBoundNodeResolvingHashData* getBoundResolvingDataBase();
CRedlandRasqalSubQueryBoundNodeResolvingHashData* getLastBoundResolvingData();
CRedlandRasqalSubQueryProcessingData* setLastBoundResolvingData(CRedlandRasqalSubQueryBoundNodeResolvingHashData* resolvedData);
CRedlandRasqalSubQueryProcessingData* deleteBoundResolvingData();
CVariableBindingsAnswersResult* getBaseAnswerResult();
CRedlandRasqalSubQueryProcessingData* setBaseAnswerResult(CVariableBindingsAnswersResult* baseAnswerResult);
bool isBooleanSubQuery();
bool getBooleanQueryResult();
cint64 getVisitedResultCountStatistics();
cint64 getResultOrderingCountStatistics();
cint64 getTotalResultCountStatistics();
CRedlandRasqalSubQueryProcessingData* incVisitedResultCountStatistics(cint64 incCount = 1);
CRedlandRasqalSubQueryProcessingData* incResultOrderingCountStatistics(cint64 incCount = 1);
CRedlandRasqalSubQueryProcessingData* setTotalResultCountStatistics(cint64 count);
cint64 getFirstTripleReturningBinding();
CRedlandRasqalSubQueryProcessingData* setFirstTripleReturningBinding(cint64 triplePos);
QSet<cint64>* getDependentSubQueryIdSet();
// protected methods
protected:
// protected variables
protected:
cint64 mVisitedCount = 0;
cint64 mOrderingCount = 0;
cint64 mTotalCount = 0;
int mGPTripleStartPos;
int mGPTriplesEndPos;
cint64 mFirstTripleReturningBinding;
bool mProcessed;
bool mProcessing;
bool mBooleanSubQuery;
bool mBooleanQueryResult;
bool mBooleanSubQueryChecked;
cint64 mSubQueryId;
cint64 mBindingsCount;
CComplexAnsweringExpressionQuery* mSubQuery;
rasqal_graph_pattern* mSubqueryGraphPattern;
librdf_world* mRedlandWorld;
CVariableBindingsAnswersResultIterator* mAnswersIt;
CVariableBindingsResultIterator* mVarBindIt;
CVariableBindingResult* mCurrentVariableBinding;
QVector<CVariableBindingResult*> mCurrentBindingsVec;
QVector<CVariableBindingResult*> mNextBindingsVec;
QVector<CRedlandRasqalSubQueryTripleResolvingData*> mTriplesResolvingDataVec;
QStringList mTriplesRemainingBindingVarList;
librdf_node* mDefaultReturningNode;
bool mInitialized;
cint64 mNextReturningPosition;
cint64 mNextBindingsVariablePosition;
QVector<rasqal_literal*> mBindingsPositionVariableBoundVector;
bool mBoundVariables;
CRedlandRasqalSubQueryBoundNodeResolvingHashData* mBaseResolvingData;
CRedlandRasqalSubQueryBoundNodeResolvingHashData* mLastResolvingData;
CVariableBindingsAnswersResult* mBaseAnswerResult;
QSet<cint64> mDependentSubQueryIdSet;
// private methods
private:
// private variables
private:
};
}; // end namespace Answerer
}; // end namespace Reasoner
}; // end namespace Konclude
#endif // KONCLUDE_REASONER_ANSWERER_CREDLANDRASQALSUBQUERYPROCESSINGDATA_H
#endif // KONCLUDE_REDLAND_INTEGRATION
|