| 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 |
#ifdef KONCLUDE_REDLAND_INTEGRATION |
| 21 |
|
| 22 |
#ifndef KONCLUDE_REASONER_GENERATOR_CREDLANDSTOREDTRIPLESINDIVIDUALASSERTIONINDEXER_H |
| 23 |
#define KONCLUDE_REASONER_GENERATOR_CREDLANDSTOREDTRIPLESINDIVIDUALASSERTIONINDEXER_H |
| 24 |
|
| 25 |
|
| 26 |
// Libraries includes |
| 27 |
#include <QHash> |
| 28 |
#include <QCache> |
| 29 |
|
| 30 |
|
| 31 |
// Namespace includes |
| 32 |
#include "TriplesSettings.h" |
| 33 |
#include "CRedlandNodeHasher.h" |
| 34 |
#include "CRedlandStoredTriplesData.h" |
| 35 |
#include "CRedlandStoredTriplesIndividualAssertionIndexCache.h" |
| 36 |
#include "CRedlandStoredTriplesSimpleABoxAssertionsAccessor.h" |
| 37 |
|
| 38 |
|
| 39 |
// Other includes |
| 40 |
#include "Reasoner/Ontology/CConcreteOntology.h" |
| 41 |
|
| 42 |
#include "Utilities/Container/CLinker.h" |
| 43 |
|
| 44 |
|
| 45 |
// Logger includes |
| 46 |
#include "Logger/CLogger.h" |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
|
| 51 |
|
| 52 |
namespace Konclude { |
| 53 |
|
| 54 |
using namespace Utilities; |
| 55 |
using namespace Utilities::Memory; |
| 56 |
using namespace Utilities::Container; |
| 57 |
|
| 58 |
namespace Reasoner { |
| 59 |
|
| 60 |
using namespace Ontology; |
| 61 |
|
| 62 |
namespace Triples { |
| 63 |
|
| 64 |
|
| 65 |
/*! |
| 66 |
* |
| 67 |
* \class CRedlandStoredTriplesIndividualAssertionIndexer |
| 68 |
* \author Andreas Steigmiller |
| 69 |
* \version 0.1 |
| 70 |
* \brief TODO |
| 71 |
* |
| 72 |
*/ |
| 73 |
class CRedlandStoredTriplesIndividualAssertionIndexer { |
| 74 |
// public methods |
| 75 |
public: |
| 76 |
CRedlandStoredTriplesIndividualAssertionIndexer(); |
| 77 |
virtual ~CRedlandStoredTriplesIndividualAssertionIndexer(); |
| 78 |
|
| 79 |
|
| 80 |
bool indexABoxIndividuals(CConcreteOntology* updateConcreteOntology, COntologyTriplesData* ontologyTripleData); |
| 81 |
|
| 82 |
CRedlandStoredTriplesIndividualAssertionIndexCacheData* handleStatement(librdf_statement* statement, librdf_node* rdfTypePredicate, librdf_node* namedIndividualObject, CRedlandStoredTriplesIndividualAssertionIndexCacheData* lastIndiCacheData, librdf_node* lastSubjectNode); |
| 83 |
|
| 84 |
|
| 85 |
|
| 86 |
// protected functions |
| 87 |
protected: |
| 88 |
|
| 89 |
CRedlandStoredTriplesIndividualAssertionIndexCacheData* getIndividualAssertionIndexcacheData(librdf_node* subjectNode, CRedlandStoredTriplesIndividualAssertionIndexCacheData*& lastIndiCacheData, librdf_node*& lastSubjectNode); |
| 90 |
|
| 91 |
|
| 92 |
|
| 93 |
// protected variables |
| 94 |
protected: |
| 95 |
|
| 96 |
CRedlandStoredTriplesIndividualAssertionIndexCache* mIndividualAssertionIndexCache; |
| 97 |
|
| 98 |
|
| 99 |
class CRoleNodeData { |
| 100 |
public: |
| 101 |
CRoleNodeData(librdf_node* roleNode, CRole* role, bool dataRole) { |
| 102 |
mRole = role; |
| 103 |
mDataRole = dataRole; |
| 104 |
mRoleNode = roleNode; |
| 105 |
} |
| 106 |
|
| 107 |
librdf_node* mRoleNode; |
| 108 |
CRole* mRole; |
| 109 |
bool mDataRole; |
| 110 |
}; |
| 111 |
|
| 112 |
|
| 113 |
class CConceptNodeData { |
| 114 |
public: |
| 115 |
CConceptNodeData(librdf_node* conceptNode, CConcept* concept) { |
| 116 |
mConcept = concept; |
| 117 |
mConceptNode = conceptNode; |
| 118 |
} |
| 119 |
|
| 120 |
librdf_node* mConceptNode; |
| 121 |
CConcept* mConcept; |
| 122 |
}; |
| 123 |
|
| 124 |
QHash<CRedlandNodeHasher, CRoleNodeData*> mRoleNodeDataHash; |
| 125 |
QHash<CRedlandNodeHasher, CConceptNodeData*> mConceptNodeDataHash; |
| 126 |
|
| 127 |
|
| 128 |
}; |
| 129 |
|
| 130 |
|
| 131 |
|
| 132 |
}; // end namespace Triples |
| 133 |
|
| 134 |
}; // end namespace Reasoner |
| 135 |
|
| 136 |
}; // end namespace Konclude |
| 137 |
|
| 138 |
#endif // end KONCLUDE_REASONER_GENERATOR_CREDLANDSTOREDTRIPLESINDIVIDUALASSERTIONINDEXER_H |
| 139 |
|
| 140 |
#endif // !KONCLUDE_REDLAND_INTEGRATION |