| 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_GENERATOR_CCONCRETEONTOLOGYBASEMENTBUILDER_H |
| 22 |
#define KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYBASEMENTBUILDER_H |
| 23 |
|
| 24 |
|
| 25 |
// Libraries includes |
| 26 |
#include <QListIterator> |
| 27 |
#include <QHash> |
| 28 |
#include <QString> |
| 29 |
#include <QObject> |
| 30 |
|
| 31 |
// Namespace includes |
| 32 |
#include "CExpressionSplitter.h" |
| 33 |
#include "CExpressionHasher.h" |
| 34 |
|
| 35 |
|
| 36 |
// Other includes |
| 37 |
#include "Reasoner/Ontology/CConcreteOntology.h" |
| 38 |
#include "Reasoner/Ontology/CConcept.h" |
| 39 |
#include "Reasoner/Ontology/CTBox.h" |
| 40 |
#include "Reasoner/Ontology/CABox.h" |
| 41 |
#include "Reasoner/Ontology/CRBox.h" |
| 42 |
#include "Reasoner/Ontology/CAbbreviatedIRIName.h" |
| 43 |
#include "Reasoner/Ontology/CIRIName.h" |
| 44 |
|
| 45 |
|
| 46 |
// Logger includes |
| 47 |
#include "Logger/CLogger.h" |
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
|
| 53 |
namespace Konclude { |
| 54 |
|
| 55 |
using namespace Utilities; |
| 56 |
using namespace Utilities::Memory; |
| 57 |
using namespace Parser; |
| 58 |
|
| 59 |
namespace Reasoner { |
| 60 |
|
| 61 |
using namespace Ontology; |
| 62 |
|
| 63 |
namespace Generator { |
| 64 |
|
| 65 |
/*! |
| 66 |
* |
| 67 |
* \class CConcreteOntologyBasementBuilder |
| 68 |
* \author Andreas Steigmiller |
| 69 |
* \version 0.1 |
| 70 |
* \brief TODO |
| 71 |
* |
| 72 |
*/ |
| 73 |
class CConcreteOntologyBasementBuilder { |
| 74 |
public: |
| 75 |
CConcreteOntologyBasementBuilder(CConcreteOntology* basementBuildConcreteOntology); |
| 76 |
virtual ~CConcreteOntologyBasementBuilder(); |
| 77 |
|
| 78 |
virtual bool initializeBuilding(); |
| 79 |
virtual bool completeBuilding(); |
| 80 |
|
| 81 |
virtual bool buildOntologyBasement(); |
| 82 |
|
| 83 |
bool addNameAbbreviation(const QString &name, const QString &abbreviatedName); |
| 84 |
|
| 85 |
// protected functions |
| 86 |
protected: |
| 87 |
bool updateName(CNamedItem* item, const QString& name); |
| 88 |
|
| 89 |
bool createDatatype(const QString& datatypeIRI); |
| 90 |
|
| 91 |
// protected variables |
| 92 |
protected: |
| 93 |
CConcreteOntology* mOnto; |
| 94 |
COntologyStringMapping* mOntoStrings; |
| 95 |
COntologyDataBoxes* mOntoData; |
| 96 |
COntologyBuildData* mOntoBuild; |
| 97 |
|
| 98 |
CTBox* tBox; |
| 99 |
CABox* aBox; |
| 100 |
CRBox* rBox; |
| 101 |
|
| 102 |
CMemoryAllocationManager* mMemManager; |
| 103 |
|
| 104 |
|
| 105 |
CActiveEntityCountVector* mActiveEntityCountVector; |
| 106 |
|
| 107 |
// contains also previous ontology data |
| 108 |
CONTOLOGYAXIOMSET<CAxiomExpression*>* mTellAxiomSet; |
| 109 |
CONTOLOGYAXIOMSET<CAxiomExpression*>* mRetractAxiomSet; |
| 110 |
|
| 111 |
// contains only updated data |
| 112 |
CONTOLOGYAXIOMSET<CAxiomExpression*>* mTellUpdatedAxiomSet; |
| 113 |
CONTOLOGYAXIOMSET<CAxiomExpression*>* mRetractUpdatedAxiomSet; |
| 114 |
|
| 115 |
CBUILDHASH<CClassAxiomExpression*,bool>* mUpdateClassAxiomHash; |
| 116 |
CBUILDHASH<CObjectPropertyAxiomExpression*,bool>* mUpdateObjectPropertyAxiomHash; |
| 117 |
|
| 118 |
// contains also previous ontology data |
| 119 |
CBUILDSET< QPair<CClassTermExpression*,CClassAxiomExpression*> >* mClassTermClassAxiomSet; |
| 120 |
CBUILDHASH<CClassTermExpression*,CClassAxiomExpression*>* mClassTermClassAxiomHash; |
| 121 |
|
| 122 |
CBUILDSET< QPair<CObjectPropertyTermExpression*,CObjectPropertyAxiomExpression*> >* mObjPropTermObjPropAxiomSet; |
| 123 |
CBUILDHASH<CObjectPropertyTermExpression*,CObjectPropertyAxiomExpression*>* mObjPropTermObjPropAxiomHash; |
| 124 |
|
| 125 |
CBUILDSET<CClassTermExpression*>* mTopRebuildClassTermExpressionsSet; |
| 126 |
CBUILDSET<CObjectPropertyTermExpression*>* mTopRebuildObjectPropertyTermExpressionsSet; |
| 127 |
|
| 128 |
|
| 129 |
CBUILDHASH<CStringRefStringHasher,CDatatypeExpression*>* mDatatypeBuildHash; |
| 130 |
|
| 131 |
CClassTermExpression* mTopClassExpression; |
| 132 |
CClassTermExpression* mBottomClassExpression; |
| 133 |
|
| 134 |
CObjectPropertyTermExpression* mTopObjPropExpression; |
| 135 |
CObjectPropertyTermExpression* mBottomObjPropExpression; |
| 136 |
|
| 137 |
CDataPropertyTermExpression* mTopDataPropExpression; |
| 138 |
CDataPropertyTermExpression* mBottomDataPropExpression; |
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
CBUILDLIST<CBuildExpression*>* mExpressionBuildContainerList; |
| 143 |
|
| 144 |
|
| 145 |
CBUILDHASH<CClassTermExpression*,CConcept*>* mClassTermConceptHash; |
| 146 |
CBUILDHASH<CConcept*,CClassTermExpression*>* mConceptClassTermHash; |
| 147 |
|
| 148 |
CBUILDHASH<CDataRangeTermExpression*, CConcept*>* mDataRangeTermConceptHash; |
| 149 |
CBUILDHASH<CConcept*, CDataRangeTermExpression*>* mConceptDataRangeTermHash; |
| 150 |
|
| 151 |
CBUILDHASH<CObjectPropertyTermExpression*,CRole*>* mObjPropTermRoleHash; |
| 152 |
CBUILDHASH<CRole*,CObjectPropertyTermExpression*>* mRoleObjPropTermHash; |
| 153 |
|
| 154 |
CBUILDHASH<CDataPropertyTermExpression*,CRole*>* mDataPropTermRoleHash; |
| 155 |
CBUILDHASH<CRole*,CDataPropertyTermExpression*>* mRoleDataPropTermHash; |
| 156 |
|
| 157 |
CBUILDHASH<CDatatypeExpression*,CDatatype*>* mDatatypeExpDatatypeHash; |
| 158 |
CBUILDHASH<CDatatype*,CDatatypeExpression*>* mDatatypeDatatypeExpHash; |
| 159 |
|
| 160 |
|
| 161 |
CBUILDHASH<CObjectPropertyAxiomExpression*,CRoleChain*>* mObjPropTermRoleChainHash; |
| 162 |
CBUILDHASH<CRoleChain*,CObjectPropertyAxiomExpression*>* mRoleChainObjPropTermHash; |
| 163 |
|
| 164 |
CBUILDHASH<CIndividualTermExpression*,CIndividual*>* mIndividulTermIndiHash; |
| 165 |
CBUILDHASH<CIndividual*,CIndividualTermExpression*>* mIndiIndividulTermHash; |
| 166 |
|
| 167 |
CBUILDHASH<CObjectPropertyTermExpression*,CObjectPropertyTermExpression*>* mInverseObjectPropertyHash; |
| 168 |
|
| 169 |
|
| 170 |
// contains also previous ontology data, |
| 171 |
// exact build expression identification |
| 172 |
CBUILDHASH<CExpressionHasher,CBuildExpression*>* mExpressionBuildHash; |
| 173 |
|
| 174 |
CBUILDHASH<CStringRefStringHasher,CClassExpression*>* mClassBuildHash; |
| 175 |
CBUILDHASH<CStringRefStringHasher,CObjectPropertyExpression*>* mObjectPropertyBuildHash; |
| 176 |
CBUILDHASH<CStringRefStringHasher,CNamedIndividualExpression*>* mIndividualBuildHash; |
| 177 |
CBUILDHASH<CStringRefStringHasher,CDataPropertyExpression*>* mDataPropertyBuildHash; |
| 178 |
|
| 179 |
|
| 180 |
// contains also previous ontology data, |
| 181 |
// name prefixes |
| 182 |
CMAPPINGHASH<QString,CNamePrefix*>* mAbbreviatedNamePrefixMapHash; |
| 183 |
CMAPPINGHASH<QString,CNamePrefix*>* mNamePrefixMapHash; |
| 184 |
|
| 185 |
|
| 186 |
}; |
| 187 |
|
| 188 |
}; // end namespace Generator |
| 189 |
|
| 190 |
}; // end namespace Reasoner |
| 191 |
|
| 192 |
}; // end namespace Konclude |
| 193 |
|
| 194 |
#endif // end KONCLUDE_REASONER_GENERATOR_CCONCRETEONTOLOGYBASEMENTBUILDER_H |