| 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_TAXONOMY_CTAXONOMY_H |
| 22 |
#define KONCLUDE_REASONER_TAXONOMY_CTAXONOMY_H |
| 23 |
|
| 24 |
// Libraries includes |
| 25 |
|
| 26 |
|
| 27 |
// Namespace includes |
| 28 |
#include "TaxonomySettings.h" |
| 29 |
#include "CHierarchyNode.h" |
| 30 |
#include "CHierarchy.h" |
| 31 |
|
| 32 |
// Other includes |
| 33 |
|
| 34 |
|
| 35 |
// Logger includes |
| 36 |
#include "Logger/CLogger.h" |
| 37 |
|
| 38 |
|
| 39 |
namespace Konclude { |
| 40 |
|
| 41 |
namespace Reasoner { |
| 42 |
|
| 43 |
namespace Taxonomy { |
| 44 |
|
| 45 |
|
| 46 |
/*! |
| 47 |
* |
| 48 |
* \class CTaxonomy |
| 49 |
* \author Andreas Steigmiller |
| 50 |
* \version 0.1 |
| 51 |
* \brief TODO |
| 52 |
* |
| 53 |
*/ |
| 54 |
class CTaxonomy : public CHierarchy { |
| 55 |
// public methods |
| 56 |
public: |
| 57 |
//! Constructor |
| 58 |
CTaxonomy(CHierarchyNode *topHierarchyNode, CHierarchyNode *bottomHierarchyNode); |
| 59 |
CTaxonomy(CConcept *topConcept, CConcept *bottomConcept); |
| 60 |
|
| 61 |
//! Destructor |
| 62 |
virtual ~CTaxonomy(); |
| 63 |
|
| 64 |
|
| 65 |
virtual CHierarchyNode *getTopHierarchyNode(); |
| 66 |
virtual CHierarchyNode *getBottomHierarchyNode(); |
| 67 |
|
| 68 |
virtual CHierarchyNode *getHierarchyNode(CConcept *concept, bool create = true); |
| 69 |
virtual bool hasHierarchyNode(CConcept *concept); |
| 70 |
|
| 71 |
virtual CTaxonomy *setConceptSatisfiable(CConcept *concept, bool satisfiable) = 0; |
| 72 |
virtual CTaxonomy *setConceptSubsumption(CConcept *subsumerConcept, CConcept *subsumedConcept) = 0; |
| 73 |
virtual CTaxonomy *setConceptNotSubsumption(CConcept *notSubsumerConcept, CConcept *notSubsumedConcept) = 0; |
| 74 |
|
| 75 |
virtual CTaxonomy *setConceptDisjoints(CConcept *disjointConcept1, CConcept *disjointConcept2) = 0; |
| 76 |
|
| 77 |
|
| 78 |
virtual bool isSubsumption(CConcept *subsumerConcept, CConcept *subsumedConcept); |
| 79 |
virtual bool isEquivalence(CConcept *concept1, CConcept *concept2); |
| 80 |
virtual bool isNotSubsumption(CConcept *notSubsumerConcept, CConcept *notSubsumedConcept); |
| 81 |
virtual bool isSatisfiable(CConcept *concept); |
| 82 |
virtual bool isNotSatisfiable(CConcept *concept); |
| 83 |
|
| 84 |
virtual bool isDisjoint(CConcept *disjointConcept1, CConcept *disjointConcept2); |
| 85 |
virtual bool isNotDisjoint(CConcept *disjointConcept1, CConcept *disjointConcept2); |
| 86 |
|
| 87 |
virtual bool isTopHierarchyNode(CConcept *concept); |
| 88 |
virtual bool isBottomHierarchyNode(CConcept *concept); |
| 89 |
|
| 90 |
virtual QString getConceptHierarchyString(); |
| 91 |
|
| 92 |
virtual bool isComplete(); |
| 93 |
|
| 94 |
virtual CTaxonomy *setTaxonomyComplete(bool completed = true); |
| 95 |
|
| 96 |
virtual bool isActiveNode(CHierarchyNode *node); |
| 97 |
virtual CTaxonomy *setActiveNode(CHierarchyNode *node, bool nodeActive = true); |
| 98 |
virtual CTaxonomy *setInactiveNode(CHierarchyNode *node, bool nodeInactive = true); |
| 99 |
|
| 100 |
virtual CHierarchyNode *getActiveNode(CHierarchyNode *node); |
| 101 |
|
| 102 |
virtual CTaxonomy *updateNodeEquivalences(CHierarchyNode *node); |
| 103 |
|
| 104 |
virtual QHash<CConcept*,CHierarchyNode*>* getConceptHierarchyNodeHash(); |
| 105 |
|
| 106 |
// protected methods |
| 107 |
protected: |
| 108 |
virtual CHierarchyNode *createHierarchyNode(CConcept *concept); |
| 109 |
|
| 110 |
// protected variables |
| 111 |
protected: |
| 112 |
QHash<CConcept *,CHierarchyNode *> conNodeHash; |
| 113 |
CHierarchyNode *topNode; |
| 114 |
CHierarchyNode *bottomNode; |
| 115 |
|
| 116 |
bool topIsUnsatisfiable; |
| 117 |
bool taxonomyComplete; |
| 118 |
|
| 119 |
QList<CHierarchyNode*> nodeContainer; |
| 120 |
|
| 121 |
QSet<CHierarchyNode*> activeNodeSet; |
| 122 |
|
| 123 |
// private methods |
| 124 |
private: |
| 125 |
|
| 126 |
// private variables |
| 127 |
private: |
| 128 |
|
| 129 |
}; |
| 130 |
|
| 131 |
}; // end namespace Taxonomy |
| 132 |
|
| 133 |
}; // end namespace Reasoner |
| 134 |
|
| 135 |
}; // end namespace Konclude |
| 136 |
|
| 137 |
#endif // KONCLUDE_REASONER_TAXONOMY_CTAXONOMY_H |