| 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_ONTOLOGY_CEXPRESSIONDATABOXMAPPING_H |
| 22 |
#define KONCLUDE_REASONER_ONTOLOGY_CEXPRESSIONDATABOXMAPPING_H |
| 23 |
|
| 24 |
// Libraries includes |
| 25 |
|
| 26 |
|
| 27 |
// Namespace includes |
| 28 |
#include "OntologySettings.h" |
| 29 |
#include "COntologyContext.h" |
| 30 |
#include "CConcept.h" |
| 31 |
#include "CIndividual.h" |
| 32 |
#include "CRole.h" |
| 33 |
#include "CDatatype.h" |
| 34 |
#include "COntologyBuildConstructFlags.h" |
| 35 |
#include "CActiveEntityCountVector.h" |
| 36 |
|
| 37 |
|
| 38 |
// Other includes |
| 39 |
#include "Utilities/CSortedNegLinker.hpp" |
| 40 |
#include "Utilities/CMemoryManager.hpp" |
| 41 |
#include "Utilities/CLinker.hpp" |
| 42 |
|
| 43 |
|
| 44 |
#include "Parser/Expressions/CClassTermExpression.h" |
| 45 |
#include "Parser/Expressions/CIndividualTermExpression.h" |
| 46 |
#include "Parser/Expressions/CObjectPropertyTermExpression.h" |
| 47 |
#include "Parser/Expressions/CClassAxiomExpression.h" |
| 48 |
#include "Parser/Expressions/CObjectPropertyAxiomExpression.h" |
| 49 |
#include "Parser/Expressions/CAssertionAxiomExpression.h" |
| 50 |
#include "Parser/Expressions/CDataPropertyTermExpression.h" |
| 51 |
#include "Parser/Expressions/CDataRangeTermExpression.h" |
| 52 |
#include "Parser/Expressions/CDatatypeExpression.h" |
| 53 |
#include "Parser/Expressions/CDataPropertyAxiomExpression.h" |
| 54 |
#include "Parser/Expressions/CDataLexicalValueExpression.h" |
| 55 |
|
| 56 |
#include "Reasoner/Generator/CExpressionHasher.h" |
| 57 |
|
| 58 |
#include "Utilities/Container/CLinker.h" |
| 59 |
|
| 60 |
// Logger includes |
| 61 |
#include "Logger/CLogger.h" |
| 62 |
|
| 63 |
|
| 64 |
namespace Konclude { |
| 65 |
|
| 66 |
using namespace Utilities; |
| 67 |
using namespace Utilities::Container; |
| 68 |
|
| 69 |
using namespace Parser::Expression; |
| 70 |
|
| 71 |
namespace Reasoner { |
| 72 |
|
| 73 |
using namespace Generator; |
| 74 |
|
| 75 |
namespace Ontology { |
| 76 |
|
| 77 |
/*! |
| 78 |
* |
| 79 |
* \class CExpressionDataBoxMapping |
| 80 |
* \author Andreas Steigmiller |
| 81 |
* \version 0.1 |
| 82 |
* \brief TODO |
| 83 |
* |
| 84 |
*/ |
| 85 |
class CExpressionDataBoxMapping { |
| 86 |
// public methods |
| 87 |
public: |
| 88 |
//! Constructor |
| 89 |
CExpressionDataBoxMapping(COntologyContext* ontoContext); |
| 90 |
virtual ~CExpressionDataBoxMapping(); |
| 91 |
|
| 92 |
CExpressionDataBoxMapping* referenceDataBoxMapping(CExpressionDataBoxMapping* dataBoxMapping); |
| 93 |
|
| 94 |
COntologyBuildConstructFlags* getBuildConstructFlags(); |
| 95 |
|
| 96 |
CActiveEntityCountVector* getActiveEntityVector(); |
| 97 |
|
| 98 |
CBUILDHASH<CClassTermExpression*,CConcept*>* getClassTermConceptMappingHash(); |
| 99 |
CBUILDHASH<CConcept*,CClassTermExpression*>* getConceptClassTermMappingHash(); |
| 100 |
|
| 101 |
CBUILDHASH<CDataRangeTermExpression*,CConcept*>* getDataRangeTermConceptMappingHash(); |
| 102 |
CBUILDHASH<CConcept*,CDataRangeTermExpression*>* getConceptDataRangeTermMappingHash(); |
| 103 |
|
| 104 |
CBUILDHASH<CObjectPropertyTermExpression*,CRole*>* getObjectPropertyTermRoleMappingHash(); |
| 105 |
CBUILDHASH<CRole*,CObjectPropertyTermExpression*>* getRoleObjectPropertyTermMappingHash(); |
| 106 |
|
| 107 |
CBUILDHASH<CDataPropertyTermExpression*,CRole*>* getDataPropertyTermRoleMappingHash(); |
| 108 |
CBUILDHASH<CRole*,CDataPropertyTermExpression*>* getRoleDataPropertyTermMappingHash(); |
| 109 |
|
| 110 |
CBUILDHASH<CIndividualTermExpression*,CIndividual*>* getIndividulTermIndiMappingHash(); |
| 111 |
CBUILDHASH<CIndividual*,CIndividualTermExpression*>* getIndiIndividulTermMappingHash(); |
| 112 |
|
| 113 |
|
| 114 |
CBUILDHASH<CDatatypeExpression*,CDatatype*>* getDatatypeExpressionDatatypeHash(); |
| 115 |
CBUILDHASH<CDatatype*,CDatatypeExpression*>* getDatatypeDatatypeExpessionHash(); |
| 116 |
|
| 117 |
CBUILDHASH<QPair<CDataLexicalValueExpression*, CDatatype*>, CDataLiteral*>* getDataLexicalValueExpressionDatatypePairDataLiteralHash(); |
| 118 |
|
| 119 |
CBUILDHASH<CClassAxiomExpression*,bool>* getUpdatedClassAxiomTellOrRetractHash(); |
| 120 |
CBUILDHASH<CObjectPropertyAxiomExpression*,bool>* getUpdateObjectPropertyAxiomHash(); |
| 121 |
CBUILDHASH<CDataPropertyAxiomExpression*,bool>* getUpdateDataPropertyAxiomHash(); |
| 122 |
CBUILDHASH<CAssertionAxiomExpression*,bool>* getUpdateAssertionAxiomHash(); |
| 123 |
|
| 124 |
CBUILDSET< QPair<CClassTermExpression*,CClassAxiomExpression*> >* getClassTermExpressionClassAxiomExpressionSet(); |
| 125 |
CBUILDHASH<CClassTermExpression*,CClassAxiomExpression*>* getClassTermExpressionClassAxiomExpressionHash(); |
| 126 |
|
| 127 |
CBUILDSET< QPair<CObjectPropertyTermExpression*,CObjectPropertyAxiomExpression*> >* getObjectPropertyTermObjectPropertyAxiomSet(); |
| 128 |
CBUILDHASH<CObjectPropertyTermExpression*,CObjectPropertyAxiomExpression*>* getObjectPropertyTermObjectPropertyAxiomHash(); |
| 129 |
|
| 130 |
CBUILDSET< QPair<CDataPropertyTermExpression*,CDataPropertyAxiomExpression*> >* getDataPropertyTermDataPropertyAxiomSet(); |
| 131 |
CBUILDHASH<CDataPropertyTermExpression*,CDataPropertyAxiomExpression*>* getDataPropertyTermDataPropertyAxiomHash(); |
| 132 |
|
| 133 |
|
| 134 |
CBUILDSET< QPair<CIndividualTermExpression*,CAssertionAxiomExpression*> >* getIndividualTermAssertionAxiomSet(); |
| 135 |
CBUILDHASH<CIndividualTermExpression*,CAssertionAxiomExpression*>* getIndividualTermAssertionAxiomHash(); |
| 136 |
|
| 137 |
|
| 138 |
CBUILDSET<CClassTermExpression*>* getTopRebuildClassTermExpressionsSet(); |
| 139 |
CBUILDSET<CObjectPropertyTermExpression*>* getTopRebuildObjectPropertyTermExpressionsSet(); |
| 140 |
|
| 141 |
CBUILDHASH<CObjectPropertyAxiomExpression*,CRoleChain*>* getObjectPropertyTermRoleChainHash(); |
| 142 |
CBUILDHASH<CRoleChain*,CObjectPropertyAxiomExpression*>* getRoleChainObjectPropertyTermHash(); |
| 143 |
|
| 144 |
CBUILDSET<CClassTermExpression*>* getBuildedConceptSet(); |
| 145 |
CBUILDSET<CObjectPropertyTermExpression*>* getBuildedObjectRoleSet(); |
| 146 |
CBUILDSET<CDataPropertyTermExpression*>* getBuildedDataRoleSet(); |
| 147 |
CBUILDSET<CDataRangeTermExpression*>* getBuildedDataRangeSet(); |
| 148 |
CBUILDSET<CDatatypeExpression*>* getBuildedDatatypeSet(); |
| 149 |
CBUILDSET<CIndividualTermExpression*>* getBuildedIndividualSet(); |
| 150 |
|
| 151 |
CBUILDLIST<CClassTermExpression*>* getBuildedConceptList(); |
| 152 |
CBUILDLIST<CObjectPropertyTermExpression*>* getBuildedObjectRoleList(); |
| 153 |
CBUILDLIST<CDataPropertyTermExpression*>* getBuildedDataRoleList(); |
| 154 |
CBUILDLIST<CDataRangeTermExpression*>* getBuildedDataRangeList(); |
| 155 |
CBUILDLIST<CDatatypeExpression*>* getBuildedDatatypeList(); |
| 156 |
CBUILDLIST<CIndividualTermExpression*>* getBuildedIndividualList(); |
| 157 |
|
| 158 |
|
| 159 |
cint64 getLastActiveCountedEntityAxiom(); |
| 160 |
CExpressionDataBoxMapping* setLastActiveCountedEntityAxiom(cint64 lastCounted); |
| 161 |
|
| 162 |
|
| 163 |
cint64 getLastProcessedChangedAxiom(); |
| 164 |
cint64 getLastProcessedBuildIndividual(); |
| 165 |
cint64 getLastProcessedBuildConcept(); |
| 166 |
cint64 getLastProcessedBuildObjectRole(); |
| 167 |
cint64 getLastProcessedBuildDataRole(); |
| 168 |
cint64 getLastProcessedBuildDataRange(); |
| 169 |
cint64 getLastProcessedBuildDatatype(); |
| 170 |
|
| 171 |
cint64 getLastProcessedInverseProperty(); |
| 172 |
cint64 getLastProcessedExpression(); |
| 173 |
|
| 174 |
cint64 getLastBuildedIndividual(); |
| 175 |
cint64 getLastBuildedConcept(); |
| 176 |
cint64 getLastBuildedObjectRole(); |
| 177 |
cint64 getLastBuildedDataRole(); |
| 178 |
cint64 getLastBuildedDataRange(); |
| 179 |
cint64 getLastBuildedDatatype(); |
| 180 |
|
| 181 |
CExpressionDataBoxMapping* setLastProcessedChangedAxiom(cint64 lastBuilded); |
| 182 |
CExpressionDataBoxMapping* setLastProcessedBuildIndividual(cint64 lastBuilded); |
| 183 |
CExpressionDataBoxMapping* setLastProcessedBuildConcept(cint64 lastBuilded); |
| 184 |
CExpressionDataBoxMapping* setLastProcessedBuildObjectRole(cint64 lastBuilded); |
| 185 |
CExpressionDataBoxMapping* setLastProcessedBuildDataRole(cint64 lastBuilded); |
| 186 |
CExpressionDataBoxMapping* setLastProcessedBuildDataRange(cint64 lastBuilded); |
| 187 |
CExpressionDataBoxMapping* setLastProcessedBuildDatatype(cint64 lastBuilded); |
| 188 |
|
| 189 |
CExpressionDataBoxMapping* setLastProcessedInverseProperty(cint64 lastBuilded); |
| 190 |
CExpressionDataBoxMapping* setLastProcessedExpression(cint64 lastBuilded); |
| 191 |
|
| 192 |
CExpressionDataBoxMapping* setLastBuildedIndividual(cint64 lastBuilded); |
| 193 |
CExpressionDataBoxMapping* setLastBuildedConcept(cint64 lastBuilded); |
| 194 |
CExpressionDataBoxMapping* setLastBuildedObjectRole(cint64 lastBuilded); |
| 195 |
CExpressionDataBoxMapping* setLastBuildedDataRole(cint64 lastBuilded); |
| 196 |
CExpressionDataBoxMapping* setLastBuildedDataRange(cint64 lastBuilded); |
| 197 |
CExpressionDataBoxMapping* setLastBuildedDatatype(cint64 lastBuilded); |
| 198 |
|
| 199 |
|
| 200 |
CBUILDHASH<CObjectPropertyTermExpression*,CObjectPropertyTermExpression*>* getInverseObjectPropertyHash(); |
| 201 |
CBUILDHASH<CExpressionHasher,CBuildExpression*>* getStructuralExpressionBuildHash(); |
| 202 |
CBUILDLIST<CBuildExpression*>* getExpressionBuildListContainer(); |
| 203 |
|
| 204 |
// protected methods |
| 205 |
protected: |
| 206 |
|
| 207 |
// protected variables |
| 208 |
protected: |
| 209 |
COntologyContext* mOntoContext; |
| 210 |
|
| 211 |
CActiveEntityCountVector* mActiveEntityCountVector; |
| 212 |
|
| 213 |
COntologyBuildConstructFlags mConstructFlags; |
| 214 |
|
| 215 |
CBUILDHASH<CClassTermExpression*,CConcept*>* mClassTermConceptHash; |
| 216 |
CBUILDHASH<CConcept*,CClassTermExpression*>* mConceptClassTermHash; |
| 217 |
CBUILDHASH<CDataRangeTermExpression*,CConcept*>* mDataRangeTermConceptHash; |
| 218 |
CBUILDHASH<CConcept*,CDataRangeTermExpression*>* mConceptDataRangeTermHash; |
| 219 |
CBUILDHASH<CObjectPropertyTermExpression*,CRole*>* mObjPropTermRoleHash; |
| 220 |
CBUILDHASH<CRole*,CObjectPropertyTermExpression*>* mRoleObjPropTermHash; |
| 221 |
|
| 222 |
CBUILDHASH<CDataPropertyTermExpression*,CRole*>* mDataPropTermRoleHash; |
| 223 |
CBUILDHASH<CRole*,CDataPropertyTermExpression*>* mRoleDataPropTermHash; |
| 224 |
|
| 225 |
|
| 226 |
CBUILDHASH<CIndividualTermExpression*,CIndividual*>* mIndividulTermIndiHash; |
| 227 |
CBUILDHASH<CIndividual*,CIndividualTermExpression*>* mIndiIndividulTermHash; |
| 228 |
|
| 229 |
CBUILDHASH<CDatatypeExpression*,CDatatype*>* mDatatypeExpDatatypeHash; |
| 230 |
CBUILDHASH<CDatatype*,CDatatypeExpression*>* mDatatypeDatatypeExpHash; |
| 231 |
|
| 232 |
CBUILDHASH<QPair<CDataLexicalValueExpression*, CDatatype*>, CDataLiteral*>* mLexicalDataExpDatatypePairDataLiteralHash; |
| 233 |
|
| 234 |
CBUILDHASH<CClassAxiomExpression*,bool>* mUpdateClassAxiomHash; |
| 235 |
CBUILDHASH<CObjectPropertyAxiomExpression*,bool>* mUpdateObjectPropertyAxiomHash; |
| 236 |
CBUILDHASH<CDataPropertyAxiomExpression*,bool>* mUpdateDataPropertyAxiomHash; |
| 237 |
CBUILDHASH<CAssertionAxiomExpression*,bool>* mUpdateAssertionAxiomHash; |
| 238 |
|
| 239 |
|
| 240 |
// contains also previous ontology data |
| 241 |
CBUILDSET< QPair<CClassTermExpression*,CClassAxiomExpression*> >* mClassTermClassAxiomSet; |
| 242 |
CBUILDHASH<CClassTermExpression*,CClassAxiomExpression*>* mClassTermClassAxiomHash; |
| 243 |
|
| 244 |
CBUILDSET< QPair<CObjectPropertyTermExpression*,CObjectPropertyAxiomExpression*> >* mObjPropTermObjPropAxiomSet; |
| 245 |
CBUILDHASH<CObjectPropertyTermExpression*,CObjectPropertyAxiomExpression*>* mObjPropTermObjPropAxiomHash; |
| 246 |
|
| 247 |
CBUILDSET< QPair<CDataPropertyTermExpression*,CDataPropertyAxiomExpression*> >* mDataPropTermDataPropAxiomSet; |
| 248 |
CBUILDHASH<CDataPropertyTermExpression*,CDataPropertyAxiomExpression*>* mDataPropTermDataPropAxiomHash; |
| 249 |
|
| 250 |
|
| 251 |
CBUILDSET< QPair<CIndividualTermExpression*,CAssertionAxiomExpression*> >* mIndiTermAssertionAxiomSet; |
| 252 |
CBUILDHASH<CIndividualTermExpression*,CAssertionAxiomExpression*>* mIndiTermAssertionAxiomHash; |
| 253 |
|
| 254 |
|
| 255 |
CBUILDSET<CClassTermExpression*>* mTopRebuildClassTermExpressionsSet; |
| 256 |
CBUILDSET<CObjectPropertyTermExpression*>* mTopRebuildObjectPropertyTermExpressionsSet; |
| 257 |
|
| 258 |
|
| 259 |
CBUILDHASH<CObjectPropertyAxiomExpression*,CRoleChain*>* mObjPropTermRoleChainHash; |
| 260 |
CBUILDHASH<CRoleChain*,CObjectPropertyAxiomExpression*>* mRoleChainObjPropTermHash; |
| 261 |
|
| 262 |
cint64 mLastActiveCountedEntityAxiom; |
| 263 |
|
| 264 |
cint64 mLastProcessedChangedAxiom; |
| 265 |
cint64 mLastProcessedBuildIndividual; |
| 266 |
cint64 mLastProcessedBuildConcept; |
| 267 |
cint64 mLastProcessedBuildObjectRole; |
| 268 |
cint64 mLastProcessedBuildDataRole; |
| 269 |
cint64 mLastProcessedBuildDataRange; |
| 270 |
cint64 mLastProcessedBuildDatatype; |
| 271 |
|
| 272 |
cint64 mLastProcessedInverseProperty; |
| 273 |
cint64 mLastProcessedExpression; |
| 274 |
|
| 275 |
cint64 mLastBuildedIndividual; |
| 276 |
cint64 mLastBuildedConcept; |
| 277 |
cint64 mLastBuildedObjectRole; |
| 278 |
cint64 mLastBuildedDataRole; |
| 279 |
cint64 mLastBuildedDataRange; |
| 280 |
cint64 mLastBuildedDatatype; |
| 281 |
|
| 282 |
CBUILDSET<CIndividualTermExpression*>* mBuildedIndividualSet; |
| 283 |
CBUILDSET<CObjectPropertyTermExpression*>* mBuildedObjectRoleSet; |
| 284 |
CBUILDSET<CDataPropertyTermExpression*>* mBuildedDataRoleSet; |
| 285 |
CBUILDSET<CDataRangeTermExpression*>* mBuildedDataRangeSet; |
| 286 |
CBUILDSET<CDatatypeExpression*>* mBuildedDatatypeSet; |
| 287 |
CBUILDSET<CClassTermExpression*>* mBuildedConceptSet; |
| 288 |
|
| 289 |
CBUILDLIST<CIndividualTermExpression*>* mBuildedIndividualList; |
| 290 |
CBUILDLIST<CObjectPropertyTermExpression*>* mBuildedObjectRoleList; |
| 291 |
CBUILDLIST<CDataPropertyTermExpression*>* mBuildedDataRoleList; |
| 292 |
CBUILDLIST<CDataRangeTermExpression*>* mBuildedDataRangeList; |
| 293 |
CBUILDLIST<CDatatypeExpression*>* mBuildedDatatypeList; |
| 294 |
CBUILDLIST<CClassTermExpression*>* mBuildedConceptList; |
| 295 |
|
| 296 |
CBUILDHASH<CObjectPropertyTermExpression*,CObjectPropertyTermExpression*>* mInverseObjectPropertyHash; |
| 297 |
CBUILDHASH<CExpressionHasher,CBuildExpression*>* mExpressionBuildHash; |
| 298 |
CBUILDLIST<CBuildExpression*>* mExpressionBuildListContainer; |
| 299 |
|
| 300 |
|
| 301 |
// private methods |
| 302 |
private: |
| 303 |
|
| 304 |
// private variables |
| 305 |
private: |
| 306 |
|
| 307 |
|
| 308 |
}; |
| 309 |
|
| 310 |
}; // end namespace Ontology |
| 311 |
|
| 312 |
}; // end namespace Reasoner |
| 313 |
|
| 314 |
}; // end namespace Konclude |
| 315 |
|
| 316 |
#endif // KONCLUDE_REASONER_ONTOLOGY_CEXPRESSIONDATABOXMAPPING_H |