Debian Codegraph @

Source/Parser/CSPARQLExtendedMappingBuildingParser.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_PARSER_CSPARQLEXTENDEDMAPPINGBUILDINGPARSER_H
23 #define KONCLUDE_PARSER_CSPARQLEXTENDEDMAPPINGBUILDINGPARSER_H
24
25 // Libraries includes
26
27
28 // Namespace includes
29 #include "CSPARQLSimpleBuildingParser.h"
30 #include "COntologyBuilder.h"
31 #include "CSPARQLBuildingParserTripleData.h"
32 #include "CSPARQLBuildingParserTermData.h"
33
34
35 // Other includes
36 #include "Reasoner/Ontology/CConcreteOntology.h"
37
38 #include "Reasoner/Generator/CConcreteOntologyRedlandTriplesDataQueryingExpressionMapper.h"
39
40 // Logger includes
41 #include "Logger/CLogger.h"
42
43 using namespace Konclude::Logger;
44
45
46 namespace Konclude {
47
48 using namespace Reasoner::Ontology;
49 using namespace Reasoner::Generator;
50
51 namespace Parser {
52
53 /*!
54 *
55 * \class CSPARQLExtendedMappingBuildingParser
56 * \author Andreas Steigmiller
57 * \version 0.1
58 * \brief TODO
59 *
60 */
61 class CSPARQLExtendedMappingBuildingParser : public CSPARQLSimpleBuildingParser {
62 // public methods
63 public:
64 //! Constructor
65 CSPARQLExtendedMappingBuildingParser(COntologyBuilder* ontoBuilder, CConcreteOntology* ontology);
66
67 //! Destructor
68 virtual ~CSPARQLExtendedMappingBuildingParser();
69
70
71 // protected methods
72 protected:
73
74 virtual QList<CAxiomExpression*> getTripleOWLAxioms(QHash<QString, CRDFHahsedSubjectData>* subjectTripleHash, bool anonymousIndividualsAsVariables = false);
75
76 virtual QList<CAxiomExpression*> getTripleOWLAxioms(QList<CRDFStringTriple>* tripleStringList, bool anonymousIndividualsAsVariables = false, QSet<CExpressionVariable*>* varExpSet = nullptr);
77
78 QList<CAxiomExpression *> handlingMappingRequiredTermTripleData(QList<CSPARQLBuildingParserTripleData *>* tripleDataList, bool anonymousIndividualsAsVariables, QSet<CExpressionVariable *>* varExpSet);
79
80
81
82 QList<CSPARQLBuildingParserTripleData*>* createTermTripleData(QList<CRDFStringTriple>* tripleStringList);
83 QList<CSPARQLBuildingParserTripleData*>* createTermTripleData(QHash<QString, CRDFHahsedSubjectData>* subjectTripleHash);
84
85
86
87 CSPARQLBuildingParserTermData* getTermData(const QString& termString, QHash<QString, CSPARQLBuildingParserTermData*>* termStringDataHash);
88
89 bool analyseTermTripleDataRequiresExtendedMapping(QList<CSPARQLBuildingParserTripleData*>* tripleList, bool anonymousIndividualsAsVariables);
90 bool makeIndividualTerm(CSPARQLBuildingParserTermData* termData, bool anonymousIndividualsAsVariables);
91 bool makeClassTerm(CSPARQLBuildingParserTermData* termData);
92 bool makePropertyTerm(CSPARQLBuildingParserTermData* termData);
93 bool makeObjectPropertyTerm(CSPARQLBuildingParserTermData* termData);
94 bool makeDataPropertyTerm(CSPARQLBuildingParserTermData* termData);
95 bool makeDataLiteralTerm(CSPARQLBuildingParserTermData* termData);
96
97 bool makeTermTypedBasedOnTerm(CSPARQLBuildingParserTermData* termData, CSPARQLBuildingParserTermData* baseData, bool anonymousIndividualsAsVariables);
98
99
100 CRedlandStoredTriplesData* getUpdatingTripleData();
101 librdf_node* getRedlandRDFNode(CSPARQLBuildingParserTermData* termData, CRedlandStoredTriplesData* triplesData, QHash<CSPARQLBuildingParserTermData*, librdf_node*>* reuseExpHash, QHash<CBuildExpression*, QString>* termVariableExpressionNewEntityHash, cint64& newEntityNumber, QSet<CExpressionVariable *>* varExpSet);
102
103 // protected variables
104 protected:
105
106
107 // private methods
108 private:
109
110
111 // private variables
112 private:
113
114
115
116 };
117
118 }; // end namespace Parser
119
120 }; // end namespace Konclude
121
122 #endif // KONCLUDE_PARSER_CSPARQLEXTENDEDMAPPINGBUILDINGPARSER_H
123
124 #endif // KONCLUDE_REDLAND_INTEGRATION