| 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_CCONCEPT_H |
| 22 |
#define KONCLUDE_REASONER_ONTOLOGY_CCONCEPT_H |
| 23 |
|
| 24 |
// Libraries includes |
| 25 |
#include <QPair> |
| 26 |
|
| 27 |
// Namespace includes |
| 28 |
#include "OntologySettings.h" |
| 29 |
#include "CRole.h" |
| 30 |
#include "CTerminology.h" |
| 31 |
#include "CName.h" |
| 32 |
#include "CTagItem.h" |
| 33 |
#include "CNamedItem.h" |
| 34 |
#include "CConceptData.h" |
| 35 |
#include "CVariable.h" |
| 36 |
#include "CConceptOperator.h" |
| 37 |
#include "CDataLiteral.h" |
| 38 |
|
| 39 |
// Other includes |
| 40 |
#include "Utilities/CSortedNegLinker.hpp" |
| 41 |
#include "Utilities/CAllocationObject.h" |
| 42 |
#include "Utilities/CMemoryManager.hpp" |
| 43 |
#include "Utilities/CLinker.hpp" |
| 44 |
#include "Utilities/CSortedLinker.hpp" |
| 45 |
|
| 46 |
// Logger includes |
| 47 |
#include "Logger/CLogger.h" |
| 48 |
|
| 49 |
|
| 50 |
namespace Konclude { |
| 51 |
|
| 52 |
using namespace Utilities; |
| 53 |
|
| 54 |
namespace Reasoner { |
| 55 |
|
| 56 |
namespace Ontology { |
| 57 |
|
| 58 |
/*! |
| 59 |
* |
| 60 |
* \class CConcept |
| 61 |
* \author Andreas Steigmiller |
| 62 |
* \version 0.1 |
| 63 |
* \brief TODO |
| 64 |
* |
| 65 |
*/ |
| 66 |
class CConcept : public CTagItem, public CNamedItem, public CAllocationObject { |
| 67 |
// public methods |
| 68 |
public: |
| 69 |
//! Constructor |
| 70 |
CConcept(); |
| 71 |
|
| 72 |
CConcept* initConcept(); |
| 73 |
CConcept *initConceptCopy(CConcept *concept, CMemoryAllocationManager* memMan = nullptr); |
| 74 |
|
| 75 |
CConcept *setConceptTag(qint64 conTag); |
| 76 |
qint64 getConceptTag() const; |
| 77 |
|
| 78 |
CConcept *setOperatorCode(qint64 opCode); |
| 79 |
qint64 getOperatorCode(); |
| 80 |
|
| 81 |
CConceptOperator* getConceptOperator(); |
| 82 |
|
| 83 |
CConcept *setTerminology(CTerminology *terminology); |
| 84 |
CTerminology *getTerminology(); |
| 85 |
|
| 86 |
qint64 getTerminologyTag() const; |
| 87 |
QPair<qint64,qint64> getTerminologyConceptTagPair(); |
| 88 |
|
| 89 |
CConcept *setParameter(qint64 parameter); |
| 90 |
qint64 getParameter(); |
| 91 |
|
| 92 |
CConcept *setOperandCount(qint64 count); |
| 93 |
qint64 getOperandCount(); |
| 94 |
CConcept* incOperandCount(cint64 incCount = 1); |
| 95 |
|
| 96 |
CConcept *setOperandList(CSortedNegLinker<CConcept *> *operandList); |
| 97 |
CConcept *addOperandLinker(CSortedNegLinker<CConcept *> *operandLinker); |
| 98 |
CSortedNegLinker<CConcept *> *getOperandList(); |
| 99 |
|
| 100 |
CConcept *setRole(CRole *role); |
| 101 |
CRole *getRole(); |
| 102 |
|
| 103 |
CVariable* getVariable(); |
| 104 |
CSortedLinker<CVariable*>* getVariableLinker(); |
| 105 |
CConcept* setVariableLinker(CSortedLinker<CVariable*>* variableLinker); |
| 106 |
CConcept* addVariableLinker(CSortedLinker<CVariable*>* variableLinker); |
| 107 |
|
| 108 |
bool hasClassName(); |
| 109 |
CConcept *setClassNameLinker(CLinker<CName *> *conceptNameLinker); |
| 110 |
CConcept *addClassNameLinker(CLinker<CName *> *conceptNameLinker); |
| 111 |
CLinker<CName *> *getClassNameLinker(); |
| 112 |
|
| 113 |
bool hasOperandConceptTag(CConcept *concept); |
| 114 |
bool hasOperandConceptTag(qint64 conceptTag); |
| 115 |
|
| 116 |
bool hasOperandConceptTag(CConcept *concept, bool negation); |
| 117 |
bool hasOperandConceptTag(qint64 conceptTag, bool negation); |
| 118 |
|
| 119 |
bool hasOperandConcept(CConcept *concept, bool negation); |
| 120 |
bool hasOperandConcept(CConcept *concept); |
| 121 |
|
| 122 |
|
| 123 |
CIndividual* getNominalIndividual(); |
| 124 |
CConcept* setNominalIndividual(CIndividual* nominalIndividual); |
| 125 |
bool hasNominalIndividual(); |
| 126 |
|
| 127 |
|
| 128 |
bool hasConceptData(); |
| 129 |
CConceptData* getConceptData(); |
| 130 |
CConcept* setConceptData(CConceptData* conceptData); |
| 131 |
|
| 132 |
|
| 133 |
|
| 134 |
|
| 135 |
bool hasMappingNegation(); |
| 136 |
CConcept* setMappingNegation(bool negation); |
| 137 |
|
| 138 |
|
| 139 |
CDataLiteral* getDataLiteral(); |
| 140 |
CConcept* setDataLiteral(CDataLiteral* dataLiteral); |
| 141 |
|
| 142 |
CDatatype* getDatatype(); |
| 143 |
CConcept* setDatatype(CDatatype* datatype); |
| 144 |
|
| 145 |
// deprecated |
| 146 |
|
| 147 |
CConcept *init(qint64 conTag); |
| 148 |
CConcept *init(CConcept *concept); |
| 149 |
|
| 150 |
CConcept *setOperatorTag(qint64 opTag); |
| 151 |
qint64 getDefinitionOperatorTag(); |
| 152 |
qint64 getProcessingOperatorTag(); |
| 153 |
|
| 154 |
bool operator<=(const CConcept &concept); |
| 155 |
bool operator==(const CConcept &concept); |
| 156 |
|
| 157 |
bool isGeneratingOperator(bool negated = false); |
| 158 |
bool isNegatedGeneratingOperator(); |
| 159 |
bool isNonGeneratingOperator(); |
| 160 |
|
| 161 |
bool isEqualsToBOTTOM(bool negated = false); |
| 162 |
bool isEqualsToTOP(bool negated = false); |
| 163 |
|
| 164 |
|
| 165 |
// protected methods |
| 166 |
protected: |
| 167 |
|
| 168 |
// protected variables |
| 169 |
protected: |
| 170 |
CTerminology *tax; |
| 171 |
CConceptOperator* mOperatorCode; |
| 172 |
qint64 opParameter; |
| 173 |
qint64 operandCount; |
| 174 |
CRole *operatorRole; |
| 175 |
CSortedNegLinker<CConcept*> *operands; |
| 176 |
CIndividual* mNominalIndiviual; |
| 177 |
CSortedLinker<CVariable*>* mVariableLinker; |
| 178 |
CDataLiteral* mDataLiteral; |
| 179 |
CDatatype* mDatatype; |
| 180 |
|
| 181 |
CConceptData* mConceptData; |
| 182 |
bool mMappingNegated; |
| 183 |
|
| 184 |
// private methods |
| 185 |
private: |
| 186 |
|
| 187 |
// private variables |
| 188 |
private: |
| 189 |
|
| 190 |
}; |
| 191 |
|
| 192 |
}; // end namespace Ontology |
| 193 |
|
| 194 |
}; // end namespace Reasoner |
| 195 |
|
| 196 |
}; // end namespace Konclude |
| 197 |
|
| 198 |
#endif // KONCLUDE_REASONER_ONTOLOGY_CCONCEPT_H |