Debian Codegraph @

Source/Reasoner/Query/CComplexAnsweringQuery.cpp

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 #include "CComplexAnsweringQuery.h"
22
23
24 namespace Konclude {
25
26 namespace Reasoner {
27
28 namespace Query {
29
30 CComplexAnsweringQuery::CComplexAnsweringQuery(CConcreteOntology* baseOntology, CConcreteOntology* expressionOntology, CConfigurationBase* configuration, const QString& queryName) {
31 mOntology = baseOntology;
32 mExpressionsOntology = expressionOntology;
33 mConfig = configuration;
34 mQueryStats = nullptr;
35 mQueryResult = nullptr;
36 mQueryName = queryName;
37 }
38
39 CComplexAnsweringQuery::~CComplexAnsweringQuery() {
40 delete mQueryStats;
41 }
42
43 CComplexAnsweringQuery* CComplexAnsweringQuery::setQueryResult(CQueryResult* queryResult) {
44 if (mQueryResult) {
45 delete mQueryResult;
46 }
47 mQueryResult = queryResult;
48 return this;
49 }
50
51 CQueryResult* CComplexAnsweringQuery::getQueryResult() {
52 return mQueryResult;
53 }
54
55 QString CComplexAnsweringQuery::getQueryName() {
56 return mQueryName;
57 }
58
59 QString CComplexAnsweringQuery::getQueryString() {
60 return "Complex-Answering-Query";
61 }
62
63 QString CComplexAnsweringQuery::getAnswerString() {
64 return "Unknown";
65 }
66
67 bool CComplexAnsweringQuery::hasAnswer() {
68 return mQueryResult != nullptr;
69 }
70
71
72 CConcreteOntology* CComplexAnsweringQuery::getBaseOntology() {
73 return mOntology;
74 }
75
76 CConcreteOntology* CComplexAnsweringQuery::getExrpessionOntology() {
77 return mExpressionsOntology;
78 }
79
80 CConfigurationBase* CComplexAnsweringQuery::getConfiguration() {
81 return mConfig;
82 }
83
84 CComplexAnsweringQuery* CComplexAnsweringQuery::setQueryStatistics(CQueryStatistics* stats) {
85 mQueryStats = stats;
86 return this;
87 }
88
89 CQueryStatistics* CComplexAnsweringQuery::getQueryStatistics() {
90 return mQueryStats;
91 }
92
93
94 }; // end namespace Query
95
96 }; // end namespace Reasoner
97
98 }; // end namespace Konclude