Debian Codegraph @

Source/Reasoner/Revision/Persistence/COntologyRevisionRedlandExternalTriplesDSNOnlyWritingPersistencer.h

raw
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_REVISION_PERSISTENCE_CONTOLOGYREVISIONREDLANDEXTERNALTRIPLESDSNPERSISTENCERBASE_H
23 #define KONCLUDE_REASONER_REVISION_PERSISTENCE_CONTOLOGYREVISIONREDLANDEXTERNALTRIPLESDSNPERSISTENCERBASE_H
24
25 // Libraries includes
26 #include <QUrl>
27
28 // Namespace includes
29 #include "PersistenceSettings.h"
30 #include "COntologyRevisionPersistencer.h"
31 #include "COntologyRevisionRedlandExternalStoredTriplesConnectionData.h"
32
33
34 // Other includes
35 #include "Config/CConfigDataReader.h"
36
37 #include "Reasoner/Revision/COntologyRevision.h"
38
39 #include "Renderer/COntologyAxiomExpressionsRenderVisitor.h"
40 #include "Renderer/COntologyRedlandRDFRenderer.h"
41
42 #include "Control/Command/CCommandRecordRouter.h"
43
44 #include "Reasoner/Generator/CConcreteOntologyRedlandTriplesDataExpressionMapper.h"
45 #include "Reasoner/Generator/CConcreteOntologyUpdateCollectorBuilder.h"
46
47 // Logger includes
48 #include "Logger/CLogger.h"
49 #include "Logger/CLogIdentifier.h"
50
51
52 namespace Konclude {
53
54 using namespace Logger;
55 using namespace Renderer;
56 using namespace Config;
57 using namespace Control::Command;
58
59 namespace Reasoner {
60
61 using namespace Generator;
62
63 namespace Revision {
64
65 namespace Persistence {
66
67 /*!
68 *
69 * \class COntologyRevisionRedlandExternalTriplesDSNOnlyWritingPersistencer
70 * \author Andreas Steigmiller
71 * \version 0.1
72 * \brief TODO
73 *
74 */
75 class COntologyRevisionRedlandExternalTriplesDSNOnlyWritingPersistencer : public COntologyRevisionPersistencer, public CLogIdentifier {
76 // public methods
77 public:
78 //! Constructor
79 COntologyRevisionRedlandExternalTriplesDSNOnlyWritingPersistencer(CConfiguration* config);
80
81 //! Destructor
82 virtual ~COntologyRevisionRedlandExternalTriplesDSNOnlyWritingPersistencer();
83
84 virtual bool persistOntologyRevision(COntologyRevision* ontoRev, COntologyRevision* prevOntoRev);
85
86 virtual bool loadLatestOntologyRevision(const QString& ontologyName, COntologyRevision* ontoRev);
87
88 virtual bool hasNewOntologyRevision(const QString& ontologyName, COntologyRevision* ontoRev);
89
90 virtual bool hasOntologyPersisted(const QString& ontologyName);
91 virtual bool deletePersistedOntology(const QString& ontologyName);
92
93 // protected methods
94 protected:
95
96 COntologyRevisionRedlandExternalStoredTriplesConnectionData* getOntologyPersistingTriplesData(const QString& ontName);
97 COntologyRevisionRedlandExternalTriplesDSNOnlyWritingPersistencer* initTriplesData(CRedlandStoredTriplesData* triplesData, const QString& ontName);
98
99 CRedlandStoredTriplesData* getUpdatingTripleData();
100 librdf_node* getLocalizedNode(librdf_node* node, CRedlandStoredTriplesData* newTriplesData);
101
102
103 // protected variables
104 protected:
105 CConfiguration* mConfig;
106
107 QHash<COntologyRevision*,QString> mOntologyNameFileHash;
108
109 QString mTriplesDBName;
110 QString mDsnConfig;
111
112 bool mConfInitialLoading;
113 bool mConfDirectFullLoading;
114
115 QHash<QString, COntologyRevisionRedlandExternalStoredTriplesConnectionData*> mOntologyTriplesDataHash;
116
117 // private methods
118 private:
119
120 // private variables
121 private:
122
123 };
124
125 }; // end namespace Persistence
126
127 }; // end namespace Revision
128
129 }; // end namespace Reasoner
130
131 }; // end namespace Konclude
132
133 #endif // KONCLUDE_REASONER_REVISION_PERSISTENCE_CONTOLOGYREVISIONREDLANDEXTERNALTRIPLESDSNPERSISTENCERBASE_H
134
135 #endif // !KONCLUDE_REDLAND_INTEGRATION