Debian Codegraph @

Source/Parser/CSPARQLSimpleQueryParser.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
21 #ifndef KONCLUDE_PARSER_CSPARQLSIMPLEQUERYPARSER_H
22 #define KONCLUDE_PARSER_CSPARQLSIMPLEQUERYPARSER_H
23
24 // Libraries includes
25
26
27 // Namespace includes
28 #include "CQueryParser.h"
29 #include "COntologyParser.h"
30 #include "CSPARQLQueryBuilder.h"
31 #include "COntologyBuilder.h"
32 #include "CSPARQLSimpleBuildingParser.h"
33 #include "CSPARQLQueryParser.h"
34
35
36 // Other includes
37 #include "Parser/Expressions/CQuerySPARQLBasicGraphPatternExpression.h"
38 #include "Parser/Expressions/COrderingVariableExpression.h"
39
40 #include "Parser/Expressions/CFilteringTermExpression.h"
41
42 // Logger includes
43 #include "Logger/CLogger.h"
44
45 using namespace Konclude::Logger;
46
47
48 namespace Konclude {
49
50 namespace Parser {
51
52 using namespace Expression;
53
54
55 /*!
56 *
57 * \class CSPARQLSimpleQueryParser
58 * \author Andreas Steigmiller
59 * \version 0.1
60 * \brief TODO
61 *
62 */
63 class CSPARQLSimpleQueryParser : public CSPARQLSimpleBuildingParser, public CSPARQLQueryParser {
64 // public methods
65 public:
66 //! Constructor
67 CSPARQLSimpleQueryParser(CSPARQLQueryBuilder *queryBuilder, COntologyBuilder* ontoBuilder, CConcreteOntology* ontology);
68
69 //! Destructor
70 virtual ~CSPARQLSimpleQueryParser();
71
72 virtual bool parseQueryFile(const QString& filename);
73 virtual bool parseQueryText(const QString& filetext);
74 virtual bool parseQueryTextList(const QStringList& queryTextList);
75
76 // protected methods
77 protected:
78 bool processParts(QStringList& parsedParts);
79
80 QList<CFilteringTermExpression*> getFilters(QList<QStringList>& filterList);
81 CBuildExpression* getFilterORExpression(QStringList& filterParts);
82 CBuildExpression* getExpression(QStringList& filterParts);
83
84 CFilteringComparisonDataLiteralExpression* getDataLiteralComparisonFilter(CDataLiteralVariableExpression* dataLitVar, CDataLiteralExpression* dataLiteral, const QString& compareOperatorString, bool reverse);
85
86 // protected variables
87 protected:
88 CSPARQLQueryBuilder* mQueryBuilder;
89
90 QList<CQuerySPARQLBasicGraphPatternExpression*> mSPARQLBGPQueryList;
91
92
93 // private methods
94 private:
95
96
97 // private variables
98 private:
99
100
101
102 };
103
104 }; // end namespace Parser
105
106 }; // end namespace Konclude
107
108 #endif // KONCLUDE_PARSER_CSPARQLSIMPLEQUERYPARSER_H