Debian Codegraph @

Source/Control/Command/Instructions/CPrepareKnowledgeBaseCommand.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 "CPrepareKnowledgeBaseCommand.h"
22
23
24 namespace Konclude {
25
26 namespace Control {
27
28 namespace Command {
29
30 namespace Instructions {
31
32 CPrepareKnowledgeBaseCommand::CPrepareKnowledgeBaseCommand(CKnowledgeBaseRevisionCommandProvider* ontologyRevisionProviderCommand, CCommand *parentSuperCommand)
33 : CPreconditionCommand(parentSuperCommand) {
34
35
36 //COntologyProcessingStepVector* ontProStepVec = COntologyProcessingStepVector::getProcessingStepVectorInstance();
37 //mOntProReqList.append( new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSBUILD), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0) );
38 //mOntProReqList.append( new COntologyProcessingStepRequirement(ontProStepVec->getProcessingStep(COntologyProcessingStep::OPSPREPROCESS), COntologyProcessingStatus::PSCOMPLETELYYPROCESSED, 0, COntologyProcessingStatus::PSSUCESSFULL, 0) );
39 mRevProvider = ontologyRevisionProviderCommand;
40 mOntology = nullptr;
41 }
42
43 CPrepareKnowledgeBaseCommand::CPrepareKnowledgeBaseCommand(CConcreteOntology *ontology, CCommand *parentSuperCommand)
44 : CPreconditionCommand(parentSuperCommand) {
45
46 mOntology = ontology;
47 mRevProvider = nullptr;
48 }
49
50 CPrepareKnowledgeBaseCommand::~CPrepareKnowledgeBaseCommand() {
51 qDeleteAll(mOntProReqList);
52 }
53
54
55
56 QString CPrepareKnowledgeBaseCommand::getBriefCommandDescription() {
57 return QString("Prepare-Knowledge-Base Command");
58 }
59
60
61 QList<COntologyProcessingRequirement*>* CPrepareKnowledgeBaseCommand::getOntologyProcessingRequirementList() {
62 return &mOntProReqList;
63 }
64
65
66 CConcreteOntology* CPrepareKnowledgeBaseCommand::getOntology() {
67 CConcreteOntology* ontology = mOntology;
68 COntologyRevision* ontoRev = nullptr;
69 if (mRevProvider) {
70 ontoRev = mRevProvider->getOntologyRevision();
71 }
72 if (ontoRev) {
73 ontology = ontoRev->getOntology();
74 }
75 return ontology;
76 }
77
78 COntologyRevision* CPrepareKnowledgeBaseCommand::getOntologyRevision() {
79 return mRevProvider->getOntologyRevision();
80 }
81
82 CPrepareKnowledgeBaseCommand* CPrepareKnowledgeBaseCommand::addRequirement(COntologyProcessingStepRequirement* requirement) {
83 mOntProReqList.append(requirement);
84 return this;
85 }
86
87 qint64 CPrepareKnowledgeBaseCommand::getCommandTag() {
88 return PREPROCESSKNOWLEDGEBASEREQUIREMENTSFORQUERYCOMMANDCOMMAND;
89 }
90
91 }; // end namespace Instructions
92
93 }; // end namespace Command
94
95 }; // end namespace Control
96
97 }; // end namespace Konclude