Debian Codegraph @

Source/Reasoner/Preprocess/CSubroleTransformationPreProcess.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_CSUBROLETRANSFORMATIONPREPROCESS_H
22 #define KONCLUDE_REASONER_PREPROCESS_CSUBROLETRANSFORMATIONPREPROCESS_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/CRoleDependence.h"
36 #include "Reasoner/Ontology/CMBox.h"
37
38 #include "Parser/Expressions/CInverseObjectPropertyOfExpression.h"
39
40 #include "Utilities/CSortedNegLinker.hpp"
41
42 // Logger includes
43 #include "Logger/CLogger.h"
44
45
46
47 namespace Konclude {
48
49 using namespace Parser::Expression;
50
51 namespace Reasoner {
52
53 using namespace Ontology;
54
55 namespace Preprocess {
56
57 /*!
58 *
59 * \class CSubroleTransformationPreProcess
60 * \author Andreas Steigmiller
61 * \version 0.1
62 * \brief TODO
63 *
64 */
65 class CSubroleTransformationPreProcess : public CConcreteOntologyContinuablePreProcess {
66 // public methods
67 public:
68 //! Constructor
69 CSubroleTransformationPreProcess();
70
71 //! Destructor
72 virtual ~CSubroleTransformationPreProcess();
73
74
75 virtual CConcreteOntology *preprocess(CConcreteOntology *ontology, CPreProcessContext* context);
76 virtual CConcreteOntology* continuePreprocessing();
77
78 // protected methods
79 protected:
80
81 void addIndirectSuperRoles(bool inverse, CRole *modifingSubRole, CSortedNegLinker<CRole *> *superRoleLinker, QSet< QPair<CRole*,bool> > *singleSuperRoleAddSet);
82
83 void makeUniversalSuperRole();
84 void makeUniversalConnectionIndividual();
85
86 void makeDataSuperRole();
87
88 void makeBottomObjectRoleDomain();
89 void makeBottomDataRoleDomain();
90 void makeBottomRoleDomain(CRole* role);
91
92 bool hasUniversalRolePropagation();
93
94 // private methods
95 private:
96 CSubroleTransformationPreProcess* collectInverseEquivalentRoles(CRole* role, bool negated, QSet< QPair<CRole*,bool> >* roleSet);
97 CSubroleTransformationPreProcess* updateDirectSuperRoles(CRole* role, bool negated, QSet< QPair<CRole*,bool> >* roleSet);
98
99 CRole* getLocalizedRole(CRole* role);
100 CIndividual* getLocalizedIndividual(CIndividual* individual);
101
102 // private variables
103 private:
104 CABox* mABox;
105 CTBox* mTBox;
106 CRBox* mRBox;
107 CMBox* mMBox;
108 CIndividualVector* mIndiVec;
109 CRoleVector* mRolesVector;
110 CConceptVector* mConceptVector;
111 CRoleChainVector* mRoleChainVector;
112 CRole* mBottomObjectRole;
113 CRole* mTopObjectRole;
114 CRole* mBottomDataRole;
115 CRole* mTopDataRole;
116
117 CBUILDHASH<CRole*,CObjectPropertyTermExpression*>* roleObjPropTermHash;
118
119 CMemoryAllocationManager* mMemMan;
120
121 cint64 mLastConceptId;
122 };
123
124 }; // end namespace Preprocess
125
126 }; // end namespace Reasoner
127
128 }; // end namespace Konclude
129
130 #endif // KONCLUDE_REASONER_PREPROCESS_CSUBROLETRANSFORMATIONPREPROCESS_H