| 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 "COntologyProcessingStep.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Reasoner { |
| 27 |
|
| 28 |
namespace Ontology { |
| 29 |
|
| 30 |
|
| 31 |
COntologyProcessingStep::COntologyProcessingStep(PROCESSINGSTEPTYPE processingType, cint64 id, PROCESSORTYPE processorType) { |
| 32 |
mProcessingType = processingType; |
| 33 |
mProcessorType = processorType; |
| 34 |
mProcessingStepID = id; |
| 35 |
} |
| 36 |
|
| 37 |
COntologyProcessingStep::PROCESSINGSTEPTYPE COntologyProcessingStep::getOntologyProcessingType() { |
| 38 |
return mProcessingType; |
| 39 |
} |
| 40 |
|
| 41 |
COntologyProcessingStep* COntologyProcessingStep::addProcessingRequirement(COntologyProcessingRequirement* requirement) { |
| 42 |
mProcessingRequirementList.append(requirement); |
| 43 |
return this; |
| 44 |
} |
| 45 |
|
| 46 |
cint64 COntologyProcessingStep::getProcessingStepID() { |
| 47 |
return mProcessingStepID; |
| 48 |
} |
| 49 |
|
| 50 |
COntologyProcessingStep::PROCESSORTYPE COntologyProcessingStep::getProcessorType() { |
| 51 |
return mProcessorType; |
| 52 |
} |
| 53 |
|
| 54 |
QList<COntologyProcessingRequirement*>* COntologyProcessingStep::getProcessingRequirementList() { |
| 55 |
return &mProcessingRequirementList; |
| 56 |
} |
| 57 |
|
| 58 |
bool COntologyProcessingStep::areAllRequirementsSatisfied(COntology* ontology) { |
| 59 |
for (QList<COntologyProcessingRequirement*>::const_iterator it = mProcessingRequirementList.constBegin(), itEnd = mProcessingRequirementList.constEnd(); it != itEnd; ++it) { |
| 60 |
COntologyProcessingRequirement* ontReq(*it); |
| 61 |
if (!ontReq->isRequirementSatisfied(ontology)) { |
| 62 |
return false; |
| 63 |
} |
| 64 |
} |
| 65 |
return true; |
| 66 |
} |
| 67 |
|
| 68 |
|
| 69 |
const QString COntologyProcessingStep::getProcessingStepName() { |
| 70 |
QString stepName; |
| 71 |
if (mProcessingType == OPSTRIPLESMAPPING) { |
| 72 |
stepName = QString("Triples-Mapping"); |
| 73 |
} else if (mProcessingType == OPSACTIVECOUNT) { |
| 74 |
stepName = QString("Active-Entity-Counting"); |
| 75 |
} else if (mProcessingType == OPSBUILD) { |
| 76 |
stepName = QString("Representation-Building"); |
| 77 |
} else if (mProcessingType == OPSPREPROCESS) { |
| 78 |
stepName = QString("Preprocessing"); |
| 79 |
} else if (mProcessingType == OPSTRIPLESINDEXING) { |
| 80 |
stepName = QString("Triples-Assertions-Indexing"); |
| 81 |
} else if (mProcessingType == OPSCONSISTENCY) { |
| 82 |
stepName = QString("Consistency-Checking"); |
| 83 |
} else if (mProcessingType == OPSPRECOMPUTESATURATION) { |
| 84 |
stepName = QString("Saturation-Precomputing"); |
| 85 |
} else if (mProcessingType == OPSPRECOMPUTEINDIVIDUAL) { |
| 86 |
stepName = QString("Individual-Precomputing"); |
| 87 |
} else if (mProcessingType == OPSPRECOMPUTECYCLES) { |
| 88 |
stepName = QString("Cycles-Precomputing"); |
| 89 |
} else if (mProcessingType == OPSCLASSCLASSIFY) { |
| 90 |
stepName = QString("Classification"); |
| 91 |
} else if (mProcessingType == OPSINITREALIZE) { |
| 92 |
stepName = QString("Realization-Initialization"); |
| 93 |
} else if (mProcessingType == OPSCONCEPTREALIZE) { |
| 94 |
stepName = QString("Types-Realization"); |
| 95 |
} else if (mProcessingType == OPSSAMEINDIVIDUALSREALIZE) { |
| 96 |
stepName = QString("Same-Individual-Realization"); |
| 97 |
} else if (mProcessingType == OPSROLEREALIZE) { |
| 98 |
stepName = QString("Role-Realization"); |
| 99 |
} else if (mProcessingType == OPSANSWERCOMPLEXQUERY) { |
| 100 |
stepName = QString("Complex-Query-Answering"); |
| 101 |
} else if (mProcessingType == OPSPRECOMPUTEOCCURRENCESTATISTICS) { |
| 102 |
stepName = QString("Occurrence-Statistics-Collection"); |
| 103 |
} |
| 104 |
return stepName; |
| 105 |
} |
| 106 |
|
| 107 |
|
| 108 |
}; // end namespace Ontology |
| 109 |
|
| 110 |
}; // end namespace Reasoner |
| 111 |
|
| 112 |
}; // end namespace Konclude |