Debian Codegraph @

Source/Reasoner/Query/CWriteClassSubsumptionsHierarchyQuery.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_REASONER_QUERY_CWRITECLASSSUBSUMPTIONSHIERARCHYQUERY_H
22 #define KONCLUDE_REASONER_QUERY_CWRITECLASSSUBSUMPTIONSHIERARCHYQUERY_H
23
24 // Libraries includes
25 #include <QString>
26 #include <QStringList>
27
28
29 // Namespace includes
30 #include "CQuery.h"
31 #include "CTaxonomyPremisingQuery.h"
32 #include "CQueryUnspecifiedStringError.h"
33 #include "CQueryInconsitentOntologyError.h"
34 #include "CWriteQuery.h"
35
36 #include "Config/CConfigDataReader.h"
37
38 // Other includes
39
40 // Logger includes
41 #include "Logger/CLogger.h"
42
43
44
45 namespace Konclude {
46
47 using namespace Config;
48
49 namespace Reasoner {
50
51 namespace Query {
52
53 /*!
54 *
55 * \class CWriteClassSubsumptionsHierarchyQuery
56 * \author Andreas Steigmiller
57 * \version 0.1
58 * \brief TODO
59 *
60 */
61 class CWriteClassSubsumptionsHierarchyQuery : public CTaxonomyPremisingQuery, public CWriteQuery {
62 // public methods
63 public:
64 //! Constructor
65 CWriteClassSubsumptionsHierarchyQuery(CConcreteOntology *premisingTaxonomyOntology, CConfigurationBase *configuration, const QString& outputName, const QString &superClassName = QString(""), const QString &subClassHierarchyQueryName = QString("UnnamedWriteClassHierarchyQuery"));
66
67 virtual CQueryResult *constructResult(CTaxonomy *taxonomy);
68
69 virtual WRITEQUERYTYPE getWriteQueryType();
70
71 virtual QString getQueryName();
72 virtual QString getQueryString();
73 virtual bool hasAnswer();
74 virtual QString getAnswerString();
75
76 virtual CQueryResult *getQueryResult();
77
78 virtual bool hasError();
79
80 virtual CQuery* addQueryError(CQueryError* queryError);
81
82 // protected methods
83 protected:
84 bool writeInconsistentHierarchyResult();
85 bool writeSubClassHierarchyResult(CTaxonomy *taxonomy);
86 void writeDeclarations(CHierarchyNode* node);
87 void writeEquivalences(CHierarchyNode* node);
88 void writeBottomEquivalences(CHierarchyNode* node);
89 void writeTopEquivalences(CHierarchyNode* node);
90
91 virtual void writeSubClassRelations(CHierarchyNode* superNode, CHierarchyNode* subNode);
92 virtual void writeEquivalenceRelations(CHierarchyNode* node);
93
94
95 virtual void writeDeclaration(const QString& className) = 0;
96 virtual void writeSubClassRelation(const QString& subClassName, const QString& superClassName) = 0;
97 virtual void writeEquivalenceRelations(const QStringList& classNameList) = 0;
98
99 virtual void writeOntologyStart() = 0;
100 virtual void writeOntologyEnd() = 0;
101 virtual void writeOntologyPrefix(const QString& prefixName, const QString& prefixIRI) = 0;
102
103
104 virtual bool startWritingOutput() = 0;
105 virtual bool endWritingOutput() = 0;
106
107
108 // protected variables
109 protected:
110 QString mClassName;
111 QString mQueryName;
112 QString mQueryString;
113
114 QString mBottomClassNameString;
115 QString mTopClassNameString;
116
117 QString mOutputFileNameString;
118
119
120 bool mUseAbbreviatedIRIs;
121 bool mWriteDeclarations;
122
123 bool mQueryAnswered;
124 bool mQueryConstructError;
125 bool mTaxCalcError;
126
127
128 // private methods
129 private:
130
131 // private variables
132 private:
133
134 };
135
136 }; // end namespace Query
137
138 }; // end namespace Reasoner
139
140 }; // end namespace Konclude
141
142 #endif // KONCLUDE_REASONER_QUERY_CWRITECLASSSUBSUMPTIONSHIERARCHYQUERY_H