Debian Codegraph @

Source/Reasoner/Kernel/Algorithm/CIndexedIndividualAssertionConvertionVisitor.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_KERNEL_ALGORITHM_CINDEXEDINDIVIDUALASSERTIONCONVERTIONVISITOR_H
22 #define KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDEXEDINDIVIDUALASSERTIONCONVERTIONVISITOR_H
23
24 // Libraries includes
25
26
27 // Namespace includes
28 #include "AlgorithmSettings.h"
29 #include "CCalculationAlgorithmContext.h"
30
31 // Other includes
32 #include "Context/CContextBase.h"
33
34 #include "Utilities/Container/CLinker.h"
35
36 #include "Reasoner/Preprocess/CPreProcessContextProviding.h"
37 #include "Reasoner/Preprocess/CDataLiteralNormalizerPreProcess.h"
38
39 #include "Reasoner/Ontology/COntologyTriplesIndividualAssertionsVisitor.h"
40 #include "Reasoner/Ontology/CConceptAssertionLinker.h"
41 #include "Reasoner/Ontology/CRoleAssertionLinker.h"
42 #include "Reasoner/Ontology/CReverseRoleAssertionLinker.h"
43 #include "Reasoner/Ontology/CDataAssertionLinker.h"
44 #include "Reasoner/Ontology/CIndividualProcessData.h"
45
46 // Logger includes
47 #include "Logger/CLogger.h"
48
49
50
51 namespace Konclude {
52
53 using namespace Context;
54 using namespace Utilities::Container;
55
56 namespace Reasoner {
57
58 using namespace Preprocess;
59 using namespace Ontology;
60
61 namespace Kernel {
62
63 namespace Algorithm {
64
65 /*!
66 *
67 * \class CIndexedIndividualAssertionConvertionVisitor
68 * \author Andreas Steigmiller
69 * \version 0.1
70 * \brief TODO
71 *
72 */
73 class CIndexedIndividualAssertionConvertionVisitor : public COntologyTriplesIndividualAssertionsVisitor {
74 // public methods
75 public:
76 //! Constructor
77 CIndexedIndividualAssertionConvertionVisitor(cint64 retrievingIndiId, CCalculationAlgorithmContext* calcAlgContext);
78 CIndexedIndividualAssertionConvertionVisitor(CIndividual* retrievingIndi, CCalculationAlgorithmContext* calcAlgContext);
79
80 virtual bool visitIndividualName(const QString& indiName, COntologyTriplesAssertionsAccessor* accessor);
81
82
83 virtual bool visitRoleAssertion(CRole* role, cint64 otherIndividualId, COntologyTriplesAssertionsAccessor* accessor);
84 virtual bool visitReverseRoleAssertion(CRole* role, cint64 otherIndividualId, COntologyTriplesAssertionsAccessor* accessor);
85 virtual bool visitDataAssertion(CRole* role, CDataLiteral* dataLiteral, COntologyTriplesAssertionsAccessor* accessor);
86 virtual bool visitConceptAssertion(CConcept* concept, COntologyTriplesAssertionsAccessor* accessor);
87
88
89 CConceptAssertionLinker* getConceptAssertionLinker();
90 CRoleAssertionLinker* getRoleAssertionLinker();
91 CReverseRoleAssertionLinker* getReverseRoleAssertionLinker();
92 CDataAssertionLinker* getDataAssertionLinker();
93
94
95 CIndividual* getRetrievalIndividual();
96
97 // protected methods
98 protected:
99 CDataLiteralValue* createDataLiteralValue(CDataLiteral* dataLiteral);
100 CIndividual* getExistingOrCreateNewTemporaryIndividual(cint64 indiId);
101 CIndividual* getNewTemporaryIndividual(CIndividual* existingIndi);
102
103
104 // protected variables
105 protected:
106 cint64 mRetrievingIndiId;
107 CIndividual* mRetrievingIndi;
108
109 CDataLiteralNormalizerPreProcess mDataLiteralNormalizer;
110 CPreProcessContextProviding mPreprocessContext;
111 CCalculationAlgorithmContext* mCalcAlgContext;
112 CMemoryAllocationManager* mMemoryAllocationManager;
113
114
115 CConceptAssertionLinker* mConceptAssertionLinker = nullptr;
116 CRoleAssertionLinker* mRoleAssertionLinker = nullptr;
117 CReverseRoleAssertionLinker* mReverseRoleAssertionLinker = nullptr;
118 CDataAssertionLinker* mDataAssertionLinker = nullptr;
119
120
121 // private methods
122 private:
123
124 // private variables
125 private:
126
127 };
128
129 }; // end namespace Algorithm
130
131 }; // end namespace Kernel
132
133 }; // end namespace Reasoner
134
135 }; // end namespace Konclude
136
137 #endif // KONCLUDE_REASONER_KERNEL_ALGORITHM_CINDEXEDINDIVIDUALASSERTIONCONVERTIONVISITOR_H