| 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_RENDERER_CONTOLOGYPARSEDBUILDEXPRESSIONRENDERVISITOR_H |
| 22 |
#define KONCLUDE_RENDERER_CONTOLOGYPARSEDBUILDEXPRESSIONRENDERVISITOR_H |
| 23 |
|
| 24 |
// Libraries includes |
| 25 |
|
| 26 |
|
| 27 |
// Namespace includes |
| 28 |
#include "RendererSettings.h" |
| 29 |
#include "CRenderedItemLinker.h" |
| 30 |
#include "COntologyRenderer.h" |
| 31 |
#include "COntologyRenderVisitor.h" |
| 32 |
|
| 33 |
|
| 34 |
// Other includes |
| 35 |
#include "Reasoner/Ontology/CConcreteOntology.h" |
| 36 |
|
| 37 |
#include "Parser/Expressions/CSubClassOfExpression.h" |
| 38 |
#include "Parser/Expressions/CClassTermExpression.h" |
| 39 |
#include "Parser/Expressions/CClassExpression.h" |
| 40 |
#include "Parser/Expressions/CObjectPropertyExpression.h" |
| 41 |
#include "Parser/Expressions/CObjectIntersectionOfExpression.h" |
| 42 |
#include "Parser/Expressions/CObjectUnionOfExpression.h" |
| 43 |
#include "Parser/Expressions/CObjectComplementOfExpression.h" |
| 44 |
#include "Parser/Expressions/CObjectSomeValuesFromExpression.h" |
| 45 |
#include "Parser/Expressions/CObjectAllValuesFromExpression.h" |
| 46 |
|
| 47 |
#include "Reasoner/Generator/CStringRefStringHasher.h" |
| 48 |
|
| 49 |
// Logger includes |
| 50 |
#include "Logger/CLogger.h" |
| 51 |
|
| 52 |
using namespace Konclude::Logger; |
| 53 |
|
| 54 |
namespace Konclude { |
| 55 |
|
| 56 |
using namespace Reasoner::Ontology; |
| 57 |
using namespace Reasoner::Generator; |
| 58 |
using namespace Parser::Expression; |
| 59 |
|
| 60 |
namespace Renderer { |
| 61 |
|
| 62 |
|
| 63 |
|
| 64 |
/*! |
| 65 |
* |
| 66 |
* \class COntologyParsedBuildExpressionRenderVisitor |
| 67 |
* \author Andreas Steigmiller |
| 68 |
* \version 0.1 |
| 69 |
* \brief TODO |
| 70 |
* |
| 71 |
*/ |
| 72 |
class COntologyParsedBuildExpressionRenderVisitor : public COntologyRenderVisitor { |
| 73 |
// public methods |
| 74 |
public: |
| 75 |
//! Constructor |
| 76 |
COntologyParsedBuildExpressionRenderVisitor(); |
| 77 |
|
| 78 |
|
| 79 |
bool visitAndRender(const CQtList<CConcept*>& conceptList, CConcreteOntology* ontology, COntologyRenderer* renderer); |
| 80 |
bool visitAndRender(const QStringList& entityStringList, CConcreteOntology* ontology, COntologyRenderer* renderer); |
| 81 |
|
| 82 |
|
| 83 |
// protected methods |
| 84 |
protected: |
| 85 |
bool visitAndRender(const CQtList<CExpressionEntity*>& entityList); |
| 86 |
|
| 87 |
bool addRemainingVisitingAndRenderEntity(CExpressionEntity* entity); |
| 88 |
|
| 89 |
CRenderedItemLinker* getRenderedEntityExpression(CExpressionEntity* entity); |
| 90 |
QString getNameFromEntityExpression(CExpressionEntity* entity); |
| 91 |
|
| 92 |
bool serachRemainingVisitingAndRenderAxiom(CClassTermExpression* expression); |
| 93 |
bool serachRemainingVisitingAndRenderAxiom(CObjectPropertyTermExpression* expression); |
| 94 |
|
| 95 |
CRenderedItemLinker* getRenderedAxiomExpression(CAxiomExpression* axiomExp); |
| 96 |
|
| 97 |
CRenderedItemLinker* getRenderedSubClassOfAxiom(CAxiomExpression* axiomExp); |
| 98 |
|
| 99 |
CRenderedItemLinker* getRenderedClassTermExpression(CClassTermExpression* classTermExp); |
| 100 |
CRenderedItemLinker* getRenderedClassExpression(CClassTermExpression* classTermExp); |
| 101 |
CRenderedItemLinker* getRenderedObjectIntersectionOfExpression(CClassTermExpression* classTermExp); |
| 102 |
CRenderedItemLinker* getRenderedObjectUnionOfExpression(CClassTermExpression* classTermExp); |
| 103 |
CRenderedItemLinker* getRenderedObjectComplementOfExpression(CClassTermExpression* classTermExp); |
| 104 |
CRenderedItemLinker* getRenderedObjectSomeValuesFromExpression(CClassTermExpression* classTermExp); |
| 105 |
CRenderedItemLinker* getRenderedObjectAllValuesFromExpression(CClassTermExpression* classTermExp); |
| 106 |
|
| 107 |
CRenderedItemLinker* getRenderedObjectPropertyTermExpression(CObjectPropertyTermExpression* objPropTermExp); |
| 108 |
CRenderedItemLinker* getRenderedObjectPropertyExpression(CObjectPropertyTermExpression* objPropTermExp); |
| 109 |
|
| 110 |
// protected variables |
| 111 |
protected: |
| 112 |
CBUILDHASH<CConcept*,CClassTermExpression*>* mConceptClassTermMapHash; |
| 113 |
CBUILDHASH<CClassTermExpression*,CClassAxiomExpression*>* mClassTermExpClassAxiomHash; |
| 114 |
COntologyRenderer* mRenderer; |
| 115 |
CConcreteOntology* mOntology; |
| 116 |
|
| 117 |
QSet<CExpressionEntity*> mVisitedEntitySet; |
| 118 |
QList<CExpressionEntity*> mRemainingEntityList; |
| 119 |
|
| 120 |
QSet<CBuildExpression*> mTestedAxiomSet; |
| 121 |
QSet<CAxiomExpression*> mVisitedAxiomSet; |
| 122 |
QList<CAxiomExpression*> mRemainingAxiomList; |
| 123 |
|
| 124 |
|
| 125 |
// private methods |
| 126 |
private: |
| 127 |
|
| 128 |
// private variables |
| 129 |
private: |
| 130 |
|
| 131 |
}; |
| 132 |
|
| 133 |
}; // end namespace Renderer |
| 134 |
|
| 135 |
}; // end namespace Konclude |
| 136 |
|
| 137 |
#endif // KONCLUDE_RENDERER_CONTOLOGYPARSEDBUILDEXPRESSIONRENDERVISITOR_H |