Debian Codegraph @

Source/Parser/CRDFRedlandRaptorParser.h

raw ◀ ▶
1 Debian patch touch this file
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_PARSER_CRDFREDLANDRAPTORPARSER_H
23 #define KONCLUDE_PARSER_CRDFREDLANDRAPTORPARSER_H
24
25 // Libraries includes
•26 #include <librdf.h>
27 #include <rasqal.h>
28 #include <stdio.h>
29 #include <ios>
30 #include <QIODevice>
31
32 // Namespace includes
33 #include "CParsingUtilities.h"
34 #include "COntologyBuilder.h"
35
36
37 // Other includes
38 #include "Utilities/UtilitiesSettings.h"
39
40 #include "Reasoner/Triples/CRedlandStoredTriplesData.h"
41
42 #include "Reasoner/Ontology/CConcreteOntology.h"
43
44 #include "Config/CConfiguration.h"
45 #include "Config/CConfigDataReader.h"
46
47
48 // Logger includes
49 #include "Logger/CLogger.h"
50 #include "Logger/CLogIdentifier.h"
51
52 using namespace Konclude::Logger;
53
54
55 namespace Konclude {
56
57 using namespace Reasoner::Triples;
58 using namespace Reasoner::Ontology;
59 using namespace std;
60
61 namespace Parser {
62
63
64 int raptor_iostream_read_bytes_from_qiodevice(void *context, void *ptr, size_t size, size_t nmemb);
65 int raptor_iostream_read_eof_func_from_qiodevice(void *context);
66 void raptor_log_handler_error_notifier(void *user_data, raptor_log_message *message);
67
68
69 /*!
70 *
71 * \class CRDFRaptorParser
72 * \author Andreas Steigmiller
73 * \version 0.1
74 * \brief TODO
75 *
76 */
77 class CRDFRedlandRaptorParser : public CLogIdentifier {
78 // public methods
79 public:
80 //! Constructor
81 CRDFRedlandRaptorParser(COntologyBuilder* ontologyBuilder, CTRIPLES_DATA_UPDATE_TYPE updateType, QString redlandParsingFormat = "rdfxml", CConfiguration* configuration = nullptr);
82
83 //! Destructor
84 virtual ~CRDFRedlandRaptorParser();
85
86
87 virtual bool parseTriplesFile(const QString& filename);
88 virtual bool parseTriples(QIODevice* ioDevice, const QString& baseUri);
89
90
91 QString getErrorString();
92 bool hasError();
93
94
95
96 // protected methods
97 protected:
98 CRedlandStoredTriplesData* getUpdatingTripleData(bool forceNew = true);
99
100
101 // protected variables
102 protected:
103 CTRIPLES_DATA_UPDATE_TYPE mUpdateType;
104
105 COntologyBuilder* mOntologyBuilder;
106 bool mParsingError = false;
107 QString mErrorString;
108
109
110 QString mRedlandParsingFormat;
111
112 bool mConfLoadTriplesIntoStore;
113
114
115 CConfiguration* mConfiguration;
116
117
118 // private methods
119 private:
120
121
122 // private variables
123 private:
124
125
126
127 };
128
129 }; // end namespace Parser
130
131 }; // end namespace Konclude
132
133 #endif // KONCLUDE_PARSER_CRDFREDLANDRAPTORPARSER_H
134
135 #endif // !KONCLUDE_REDLAND_INTEGRATION