Debian Codegraph @

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