Debian Codegraph @

Source/Test/Evaluation/CReasonerEvaluationRequestClientSPARQLThread.h

raw
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
21 #ifndef KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONREQUESTCLIENTSPARQLTHREAD_H
22 #define KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONREQUESTCLIENTSPARQLTHREAD_H
23
24 // Libraries includes
25 #include <QDir>
26
27 // Namespace includes
28 #include "EvaluationSettings.h"
29 #include "CReasonerEvaluationRequestClientBaseThread.h"
30 #include "CReasonerEvaluationRequestResult.h"
31 #include "CReasonerEvaluationRequestResponseSPARQL.h"
32
33 // Other includes
34 #include "Config/CConfiguration.h"
35 #include "Config/CConfigDataReader.h"
36
37 #include "Test/Evaluation/Events/CReasonerEvaluationStartEvent.h"
38 #include "Test/Evaluation/Events/CReasonerEvaluationNextEvent.h"
39
40 #include "Concurrent/CIntervalThread.h"
41
42 #include "Network/HTTP/CQtHttpTransactionManager.h"
43
44 #include "Parser/CSPARQLKnowledgeBaseSplittingOperationParser.h"
45
46 // Logger includes
47 #include "Logger/CLogger.h"
48 #include "Logger/CLogIdentifier.h"
49
50
51
52 namespace Konclude {
53
54 using namespace Parser;
55 using namespace Config;
56 using namespace Concurrent;
57 using namespace Network::HTTP;
58
59 namespace Test {
60
61 namespace Evaluation {
62
63 using namespace Events;
64
65
66 /*!
67 *
68 * \class CReasonerEvaluationRequestClientThread
69 * \author Andreas Steigmiller
70 * \version 0.1
71 * \brief TODO
72 *
73 */
74 class CReasonerEvaluationRequestClientSPARQLThread : public CReasonerEvaluationRequestClientBaseThread {
75 // public methods
76 public:
77 //! Constructor
78 CReasonerEvaluationRequestClientSPARQLThread();
79
80 //! Destructor
81 virtual ~CReasonerEvaluationRequestClientSPARQLThread();
82
83 virtual bool canHandleRequestFile(const QString& testFileString) override;
84
85 // protected methods
86 protected:
87 virtual bool loadReasonerRequests(const QString& initFileString, const QString& testFileString) override;
88 virtual bool loadReasonerRequest(const QString& requestFileString) override;
89
90 virtual bool sendNextRequest() override;
91 virtual bool parseResponse(QIODevice* device) override;
92
93 QString getAdaptedRequestNode(const QString& reqeustString, CSPARQLKnowledgeBaseSplittingOperationData* operationData);
94
95 QString getIRI(const QString& iriString);
96
97 virtual CReasonerEvaluationRequestClientBaseThread* readConfig(CConfiguration* config);
98
99 virtual bool processTimer(qint64 timerID);
100 virtual bool closeRequestTimeoutContinueRestart();
101 virtual bool closeAllRequestTimeout();
102 virtual bool closeNextRequest();
103
104 // protected variables
105 protected:
106 QHash<QString, QString> mPrefixHash;
107 QString mBaseIRI;
108
109 QHash<QString, QString> mSPARQLOperationKeywordNameSet;
110
111 bool mConfSendPrepareBeforeQuerying;
112 bool mConfSupportsPrepareCommand;
113
114 cint64 mConfResponseSizeLimit;
115
116 QList<CReasonerEvaluationRequestResponse*> mAllRequestList;
117 cint64 mRemainingRestartRepeatingRequests;
118
119 cint64 mTotalInitRequests;
120 cint64 mRestartRepeatingRequests;
121
122 cint64 mConfSeparateQueryingTimeout;
123
124 // private methods
125 private:
126
127 // private variables
128 private:
129
130 };
131
132 }; // end namespace Evaluation
133
134 }; // end namespace Test
135
136 }; // end namespace Konclude
137
138 #endif // KONCLUDE_TEST_EVALUATION_CREASONEREVALUATIONREQUESTCLIENTSPARQLTHREAD_H