Debian Codegraph @

Source/Reasoner/Preprocess/CDatatypeNormalizerPreProcess.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_PREPROCESS_CDATATYPENORMALIZERPREPROCESS_H
22 #define KONCLUDE_REASONER_PREPROCESS_CDATATYPENORMALIZERPREPROCESS_H
23
24 // Libraries includes
25 #include <QSet>
26
27 // Namespace includes
28 #include "CConcreteOntologyContinuablePreProcess.h"
29 #include "CConceptRoleIndividualLocator.h"
30
31
32 // Other includes
33 #include "Reasoner/Ontology/CBoxContext.h"
34 #include "Reasoner/Ontology/CConcept.h"
35 #include "Reasoner/Ontology/CMBox.h"
36
37
38 // Logger includes
39 #include "Logger/CLogger.h"
40
41
42
43 namespace Konclude {
44
45 namespace Reasoner {
46
47 using namespace Ontology;
48
49 namespace Preprocess {
50
51 /*!
52 *
53 * \class CDatatypeNormalizerPreProcess
54 * \author Andreas Steigmiller
55 * \version 0.1
56 * \brief TODO
57 *
58 */
59 class CDatatypeNormalizerPreProcess : public CConcreteOntologyContinuablePreProcess {
60 // public methods
61 public:
62 //! Constructor
63 CDatatypeNormalizerPreProcess();
64
65 //! Destructor
66 virtual ~CDatatypeNormalizerPreProcess();
67
68
69 virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context);
70 virtual CConcreteOntology* continuePreprocessing();
71
72 // protected methods
73 protected:
74 CDatatypeNormalizerPreProcess* normalizeDatatype(CDatatype* datatype, CPreProcessContext* context);
75
76 CConcept* createDatatypeConcept(CDatatype* datatype);
77 CConcept* createConcept();
78 CConcept* addConceptOperand(CConcept* concept, CConcept* operand, bool negated);
79
80
81 CDatatype* getDatatype(const QString& datatypeIRI);
82
83
84 CConcept* getNumberRestrictionConcept(cint64 restrictionCode, const QString& value);
85 CConcept* getIntegerRestrictionConcept();
86
87 CConcept* getStringRestrictionConcept();
88 CConcept* getNormalizedStringRestrictionConcept();
89 CConcept* getTokenRestrictionConcept();
90 CConcept* getNMTokenRestrictionConcept();
91 CConcept* getNameRestrictionConcept();
92 CConcept* getNCNameRestrictionConcept();
93 CConcept* getLanguageRestrictionConcept();
94 CConcept* getDateTimeStampRestrictionConcept();
95
96
97 // private methods
98 private:
99
100 // private variables
101 private:
102 CABox* mABox;
103 CTBox* mTBox;
104 CRBox* mRBox;
105 CMBox* mMBox;
106 CContext* mBoxContext;
107 CIndividualVector* mIndiVec;
108 CRoleVector* mRolesVector;
109 CConceptVector* mConceptVector;
110
111 CConcept* mTopDataRangeConcept;
112
113 CDatatypeVector* mDatatypeVector;
114
115 CDatatypeValueSpaceTypes* mValueSpaceTypes;
116
117 QHash<QString,CDatatype*> mIRIDatatypeHash;
118
119 CBUILDHASH<CDataRangeTermExpression*,CConcept*>* mDataRangeConceptHash;
120 CBUILDHASH<CConcept*,CDataRangeTermExpression*>* mConceptDataRangeHash;
121
122 CBUILDHASH<CDatatypeExpression*,CDatatype*>* mDatatypeExpressionDatatpyeHash;
123 CBUILDHASH<CDatatype*,CDatatypeExpression*>* mDatatpyeDatatypeExpressionHash;
124
125 CMemoryAllocationManager* mMemMan;
126
127
128 QHash< QPair<cint64,QString>,CConcept* > mNumberRestrictionConceptHash;
129
130 CConcept* mIntegerRestrictionConcept;
131 CConcept* mStringRestrictionConcept;
132 CConcept* mNormalizedStringRestrictionConcept;
133 CConcept* mTokenRestrictionConcept;
134 CConcept* mNMTokenRestrictionConcept;
135 CConcept* mNameRestrictionConcept;
136 CConcept* mNCNameRestrictionConcept;
137 CConcept* mLanguageRestrictionConcept;
138 CConcept* mDatetimeStampRestrictionConcept;
139
140 CPreProcessContext* mContext;
141
142 cint64 mLastDataTypeId;
143
144 };
145
146 }; // end namespace Preprocess
147
148 }; // end namespace Reasoner
149
150 }; // end namespace Konclude
151
152 #endif // KONCLUDE_REASONER_PREPROCESS_CDATATYPENORMALIZERPREPROCESS_H