| 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_REASONER_CONSISTISER_CINCREMENTALONTOLOGYPRECOMPUTATIONITEM_H |
| 22 |
#define KONCLUDE_REASONER_CONSISTISER_CINCREMENTALONTOLOGYPRECOMPUTATIONITEM_H |
| 23 |
|
| 24 |
// Libraries includes |
| 25 |
#include <QAtomicPointer> |
| 26 |
|
| 27 |
// Namespace includes |
| 28 |
#include "ConsistiserSettings.h" |
| 29 |
#include "CConsistenceObserver.h" |
| 30 |
#include "CSaturationObserver.h" |
| 31 |
#include "COntologyPrecomputationItem.h" |
| 32 |
#include "CPrecomputationTestingStep.h" |
| 33 |
#include "CSaturationConceptDataItem.h" |
| 34 |
#include "CSaturationIndividualDataItem.h" |
| 35 |
#include "CSaturationIndividualAnalysationObserver.h" |
| 36 |
|
| 37 |
|
| 38 |
// Other includes |
| 39 |
#include "Reasoner/Consistence/CConsistenceData.h" |
| 40 |
#include "Reasoner/Consistence/CSaturationData.h" |
| 41 |
#include "Reasoner/Consistence/CConsistence.h" |
| 42 |
|
| 43 |
#include "Reasoner/Ontology/OntologySettings.h" |
| 44 |
#include "Reasoner/Ontology/COntologyProcessingStepRequirement.h" |
| 45 |
#include "Reasoner/Ontology/CConceptProcessData.h" |
| 46 |
#include "Reasoner/Ontology/CIndividualProcessData.h" |
| 47 |
#include "Reasoner/Ontology/CConceptSaturationReferenceLinkingData.h" |
| 48 |
#include "Reasoner/Ontology/COntologyProcessingConceptSaturationRequirement.h" |
| 49 |
|
| 50 |
#include "Reasoner/Kernel/Task/CCalculationConfigurationExtension.h" |
| 51 |
|
| 52 |
#include "Reasoner/Query/CApproximatedSaturationCalculationJob.h" |
| 53 |
|
| 54 |
// Logger includes |
| 55 |
#include "Logger/CLogger.h" |
| 56 |
|
| 57 |
|
| 58 |
namespace Konclude { |
| 59 |
|
| 60 |
namespace Reasoner { |
| 61 |
|
| 62 |
using namespace Kernel::Task; |
| 63 |
using namespace Consistence; |
| 64 |
using namespace Ontology; |
| 65 |
using namespace Query; |
| 66 |
|
| 67 |
namespace Consistiser { |
| 68 |
|
| 69 |
|
| 70 |
typedef QPair<CRole*,TConceptNegPair> TRoleConceptNegTriple; |
| 71 |
|
| 72 |
|
| 73 |
/*! |
| 74 |
* |
| 75 |
* \class CIncrementalOntologyPrecomputationItem |
| 76 |
* \author Andreas Steigmiller |
| 77 |
* \version 0.1 |
| 78 |
* \brief TODO |
| 79 |
* |
| 80 |
*/ |
| 81 |
class CIncrementalOntologyPrecomputationItem : public COntologyPrecomputationItem, public CConsistenceObserver { |
| 82 |
// public methods |
| 83 |
public: |
| 84 |
//! Constructor |
| 85 |
CIncrementalOntologyPrecomputationItem(); |
| 86 |
~CIncrementalOntologyPrecomputationItem(); |
| 87 |
|
| 88 |
CIncrementalOntologyPrecomputationItem* initTotallyPrecomputationItem(CConcreteOntology* ontology, CConfigurationBase* config); |
| 89 |
|
| 90 |
virtual COntologyPrecomputationItem* addPrecomputationRequirement(COntologyProcessingRequirement* ontoRequirement); |
| 91 |
|
| 92 |
CIncrementalOntologyPrecomputationItem* setConsistenceCheched(bool consistenceChecked); |
| 93 |
bool hasConsistenceCheched(); |
| 94 |
|
| 95 |
CIncrementalOntologyPrecomputationItem* setConsistenceCheckCreated(bool consistenceCheckCreated); |
| 96 |
bool hasConsistenceCheckCreated(); |
| 97 |
|
| 98 |
virtual CConsistenceObserver* tellConsistenceData(CConsistenceData* consData); |
| 99 |
CConsistenceData* getConsistenceData(); |
| 100 |
|
| 101 |
|
| 102 |
CConsistence* getConsistence(); |
| 103 |
CIncrementalOntologyPrecomputationItem* setConsistence(CConsistence* consistence); |
| 104 |
|
| 105 |
CCalculationConfigurationExtension* getCalculationConfiguration(); |
| 106 |
|
| 107 |
|
| 108 |
|
| 109 |
CIncrementalOntologyPrecomputationItem* setPrecomputation(CPrecomputation* precomputation); |
| 110 |
CPrecomputation* getPrecomputation(); |
| 111 |
|
| 112 |
|
| 113 |
CPrecomputationTestingStep* getConsistencePrecomputationStep(); |
| 114 |
bool isConsistenceStepFinished(); |
| 115 |
bool isConsistenceStepRequired(); |
| 116 |
bool areConsistenceStepProcessingRequirementSatisfied(); |
| 117 |
|
| 118 |
|
| 119 |
CPrecomputationTestingStep* getCyclePrecomputationStep(); |
| 120 |
bool isCycleStepFinished(); |
| 121 |
bool isCycleStepRequired(); |
| 122 |
bool areCycleStepProcessingRequirementSatisfied(); |
| 123 |
|
| 124 |
|
| 125 |
CPrecomputationTestingStep* getSaturationPrecomputationStep(); |
| 126 |
bool isSaturationStepFinished(); |
| 127 |
bool isSaturationStepRequired(); |
| 128 |
bool areSaturationStepProcessingRequirementSatisfied(); |
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
CPrecomputationTestingStep* getIndividualPrecomputationStep(); |
| 133 |
bool isIndividualStepRunning(); |
| 134 |
bool isIndividualStepFinished(); |
| 135 |
bool isIndividualStepRequired(); |
| 136 |
bool areIndividualStepProcessingRequirementSatisfied(); |
| 137 |
CIncrementalOntologyPrecomputationItem* setIndividualStepRunning(bool satStepRunning); |
| 138 |
|
| 139 |
|
| 140 |
bool isIndividualComputationRunning(); |
| 141 |
CIncrementalOntologyPrecomputationItem* setIndividualComputationRunning(bool indiCompRunning); |
| 142 |
|
| 143 |
|
| 144 |
CIncrementalOntologyPrecomputationItem* setIndividualPrecomputationCreated(bool initialized); |
| 145 |
bool hasIndividualPrecomputationCreated(); |
| 146 |
CIncrementalOntologyPrecomputationItem* setIndividualPrecomputationChecked(bool checked); |
| 147 |
bool hasIndividualPrecomputationChecked(); |
| 148 |
|
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
bool areAllStepFinished(); |
| 153 |
bool hasRemainingProcessingRequirements(); |
| 154 |
|
| 155 |
|
| 156 |
CConcreteOntology* getLastConsistentlyTestedVersion(); |
| 157 |
CIncrementalOntologyPrecomputationItem* setLastConsistentlyTestedVersion(CConcreteOntology* ontology); |
| 158 |
|
| 159 |
|
| 160 |
QSet<CIndividual*>* getDirectlyChangedIndividualSet(); |
| 161 |
|
| 162 |
bool hasDirectlyChangedIndividualsIdentified(); |
| 163 |
bool setDirectlyChangedIndividualsIdentified(bool identified); |
| 164 |
|
| 165 |
cint64 getIncrementalExpansionID(); |
| 166 |
|
| 167 |
|
| 168 |
QTime* getInitializationTime(); |
| 169 |
|
| 170 |
// protected methods |
| 171 |
protected: |
| 172 |
|
| 173 |
// protected variables |
| 174 |
protected: |
| 175 |
CPrecomputation* mPrecomputation; |
| 176 |
|
| 177 |
CConcreteOntology* mLastConsistentlyTestedVersion; |
| 178 |
QSet<CIndividual*> mDirectlyChangedIndividualSet; |
| 179 |
bool mDirectlyChangedIndividualsIdentified; |
| 180 |
|
| 181 |
CConsistence* mConsistence; |
| 182 |
bool mConsistenceCheckCreated; |
| 183 |
bool mConsistenceCheched; |
| 184 |
QAtomicPointer<CConsistenceData> mConsData; |
| 185 |
|
| 186 |
|
| 187 |
|
| 188 |
|
| 189 |
bool mIndividualTestRunning; |
| 190 |
|
| 191 |
bool mIndividualComputationRunning; |
| 192 |
bool mIndividualPrecomputationCreated; |
| 193 |
bool mIndividualPrecomputationChecked; |
| 194 |
|
| 195 |
CPrecomputationTestingStep* mConsistencePrecomputationStep; |
| 196 |
CPrecomputationTestingStep* mCyclePrecomputationStep; |
| 197 |
CPrecomputationTestingStep* mSaturationPrecomputationStep; |
| 198 |
CPrecomputationTestingStep* mIndividualPrecomputationStep; |
| 199 |
QList<CPrecomputationTestingStep*> mProcessingSteps; |
| 200 |
|
| 201 |
|
| 202 |
CCalculationConfigurationExtension* mCalculationConfig; |
| 203 |
|
| 204 |
|
| 205 |
QTime mInitTime; |
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
// private methods |
| 210 |
private: |
| 211 |
|
| 212 |
// private variables |
| 213 |
private: |
| 214 |
|
| 215 |
}; |
| 216 |
|
| 217 |
}; // end namespace Consistiser |
| 218 |
|
| 219 |
}; // end namespace Reasoner |
| 220 |
|
| 221 |
}; // end namespace Konclude |
| 222 |
|
| 223 |
#endif // KONCLUDE_REASONER_CONSISTISER_CIncrementalOntologyPrecomputationItem_H |