Debian Codegraph @

Source/Parser/COWL2QtXMLOntologyParser.cpp

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 #include "COWL2QtXMLOntologyParser.h"
22
23
24 namespace Konclude {
25
26 namespace Parser {
27
28
29
30 COWL2QtXMLOntologyParser::COWL2QtXMLOntologyParser(COntologyBuilder* ontoBuilder)
31 : CLogIdentifier("::Konclude::Parser::OWL2QtXMLOntologyParser",this),recordRouter(0,this) {
32
33 mOntoBuilder = ontoBuilder;
34 mAxiomNumber = 0;
35
36 mReportErrorCount = 100;
37
38 LOG(INFO,getLogDomain(),logTr("Created OWL 2.0 Qt XML Parser."),this);
39
40 #ifdef KONCLUDE_PARSER_USEPARSEJUMPFUNCTIONHASH
41 initializeParseFunctionJumpHash();
42 #endif
43 }
44
45
46 COWL2QtXMLOntologyParser::COWL2QtXMLOntologyParser(COntologyBuilder* ontoBuilder, CCommandRecordRouter *commandRecordRouter)
47 : CLogIdentifier("::Konclude::Parser::OWL2QtXMLOntologyParser",this),recordRouter(*commandRecordRouter,this) {
48
49 mOntoBuilder = ontoBuilder;
50 mAxiomNumber = 0;
51
52 mReportErrorCount = 100;
53
54 LOG(INFO,getLogDomain(),logTr("Created OWL 2.0 Qt XML Parser."),this);
55
56 #ifdef KONCLUDE_PARSER_USEPARSEJUMPFUNCTIONHASH
57 initializeParseFunctionJumpHash();
58 #endif
59 }
60
61
62 COWL2QtXMLOntologyParser::~COWL2QtXMLOntologyParser() {
63 }
64
65
66
67
68 bool COWL2QtXMLOntologyParser::parseOntologyFile(const QString& filename) {
69 LOG(INFO,getLogDomain(),logTr("Loading XML File: '%1'.").arg(filename),this);
70 bool successfullParsed = true;
71
72
73 // parse file
74 QFile file(filename);
75 if (file.open(QIODevice::ReadOnly)) {
76 QDomDocument document;
77 QString errorMessage;
78 int errorLine = 0, errorColumn = 0;
79 if (document.setContent(file.readAll(),true,&errorMessage,&errorLine,&errorColumn)) {
80
81 QDomElement documentElement(document.documentElement());
82
83 QString docElemName = documentElement.tagName();
84 if (docElemName == "Ontology" || docElemName == "owl:Ontology") {
85 LOG(INFO,getLogDomain(),logTr("Found OWL-Ontology Node."),this);
86 parseTellOntologyAxiomNode(&documentElement);
87 } else if (docElemName == "Tell" || docElemName == "owl:Tell") {
88 LOG(INFO,getLogDomain(),logTr("Found Ontology-Tell Node."),this);
89 parseTellOntologyAxiomNode(&documentElement);
90 } else {
91 successfullParsed = false;
92 LOG(ERROR,getLogDomain(),logTr("Not supported node '%1'.").arg(docElemName),this);
93 }
94 LOG(INFO,getLogDomain(),logTr("Parsing of '%1' completed.").arg(filename),this);
95
96 } else {
97 LOG(ERROR,getLogDomain(),logTr("XML error: %1, file: %2, line: %3, column %4.").arg(errorMessage).arg(filename).arg(errorLine).arg(errorColumn),this);
98 }
99 file.close();
100 } else {
101 successfullParsed = false;
102 LOG(ERROR,getLogDomain(),logTr("File '%1' not found or couldn't be opened.").arg(filename),this);
103 }
104
105 return successfullParsed;
106 }
107
108
109
110 bool COWL2QtXMLOntologyParser::parseTellOntologyAxiomNode(QDomElement *ontologyNode) {
111 QDomElement node = ontologyNode->firstChildElement();
112 while (!node.isNull()) {
113 // build for each node an expression
114 CBuildExpression* expression = parseBuildNode(&node);
115 if (expression) {
116 CAxiomExpression* axiomExpression = dynamic_cast<CAxiomExpression*>(expression);
117 if (axiomExpression) {
118 mOntoBuilder->tellOntologyAxiom(axiomExpression);
119 }
120 } else {
121
122 QList<CBuildExpression*> expressionList(parseRuleNode(&node));
123 foreach (CBuildExpression* expression, expressionList) {
124 CAxiomExpression* axiomExpression = dynamic_cast<CAxiomExpression*>(expression);
125 if (axiomExpression) {
126 mOntoBuilder->tellOntologyAxiom(axiomExpression);
127 }
128 }
129 }
130
131 node = node.nextSiblingElement();
132 }
133 return true;
134 }
135
136
137 bool COWL2QtXMLOntologyParser::parseOntologyNode(QDomElement* ontologyNode) {
138 mOntologyIdentifier = ontologyNode->attribute("ontologyIRI");
139 QString addDelSring = ontologyNode->localName();
140 if (addDelSring.isEmpty()) {
141 addDelSring = ontologyNode->tagName();
142 }
143 if (addDelSring == "Retract") {
144 parseRetractOntologyAxiomNode(ontologyNode);
145 } else {
146 parseTellOntologyAxiomNode(ontologyNode);
147 }
148 return true;
149 }
150
151
152
153 bool COWL2QtXMLOntologyParser::parseRetractOntologyAxiomNode(QDomElement *ontologyNode) {
154 QDomElement node = ontologyNode->firstChildElement();
155 while (!node.isNull()) {
156 // build for each node an expression
157 CBuildExpression* expression = parseBuildNode(&node);
158 if (expression) {
159 CAxiomExpression* axiomExpression = dynamic_cast<CAxiomExpression*>(expression);
160 if (axiomExpression) {
161 mOntoBuilder->retractOntologyAxiom(axiomExpression);
162 }
163 } else {
164
165 QList<CBuildExpression*> expressionList(parseRuleNode(&node));
166 foreach (CBuildExpression* expression, expressionList) {
167 CAxiomExpression* axiomExpression = dynamic_cast<CAxiomExpression*>(expression);
168 if (axiomExpression) {
169 mOntoBuilder->retractOntologyAxiom(axiomExpression);
170 }
171 }
172 }
173
174 node = node.nextSiblingElement();
175 }
176 return true;
177 }
178
179
180 CBuildExpression *COWL2QtXMLOntologyParser::getParsedBuildNode(QDomElement *node) {
181 return parseBuildNode(node);
182 }
183
184 bool COWL2QtXMLOntologyParser::parsePrefixNode(QDomElement* node) {
185 QString abbName = node->attribute(QString("name"));
186 QString totalIRIName = node->attribute(QString("IRI"));
187 if (!totalIRIName.isEmpty()) {
188 mOntoBuilder->addNameAbbreviation(totalIRIName,abbName);
189 return true;
190 }
191 return false;
192 }
193
194 QString COWL2QtXMLOntologyParser::getEntityName(QDomElement* node) {
195 QString entityName;
196
197 bool abbreviated = false;
198
199 QString attrName = node->attribute(QString("IRI"));
200 if (attrName.isEmpty()) {
201 attrName = node->attribute(QString("abbreviatedIRI"));
202 abbreviated = true;
203 }
204 if (attrName.isEmpty()) {
205 attrName = node->attribute(QString("owl:IRI"));
206 }
207 if (attrName.isEmpty()) {
208 attrName = node->attribute(QString("owl:abbreviatedIRI"));
209 abbreviated = true;
210 }
211 if (attrName.isEmpty()) {
212 attrName = node->attribute(QString("URI"));
213 }
214 if (attrName.isEmpty()) {
215 attrName = node->attribute(QString("owl:URI"));
216 }
217 if (abbreviated) {
218 entityName = mOntoBuilder->resolveAbbreviationName(attrName);
219 } else {
220 entityName = attrName;
221 }
222
223 return entityName;
224 }
225
226
227 bool COWL2QtXMLOntologyParser::initializeParseFunctionJumpHash() {
228
229 mParseFunctionJumpHash.insert("Prefix",&COWL2QtXMLOntologyParser::jumpFunctionParsePrefixNode);
230 mParseFunctionJumpHash.insert("owl:Prefix",&COWL2QtXMLOntologyParser::jumpFunctionParsePrefixNode);
231
232 mParseFunctionJumpHash.insert("Class",&COWL2QtXMLOntologyParser::jumpFunctionParseClassNode);
233 mParseFunctionJumpHash.insert("owl:Class",&COWL2QtXMLOntologyParser::jumpFunctionParseClassNode);
234 mParseFunctionJumpHash.insert("OWLClass",&COWL2QtXMLOntologyParser::jumpFunctionParseClassNode);
235 mParseFunctionJumpHash.insert("owl:OWLClass",&COWL2QtXMLOntologyParser::jumpFunctionParseClassNode);
236 mParseFunctionJumpHash.insert("ObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyNode);
237 mParseFunctionJumpHash.insert("owl:ObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyNode);
238 mParseFunctionJumpHash.insert("IndividualVariable",&COWL2QtXMLOntologyParser::jumpFunctionParseIndividualVariable);
239 mParseFunctionJumpHash.insert("owl:IndividualVariable",&COWL2QtXMLOntologyParser::jumpFunctionParseIndividualVariable);
240
241 mParseFunctionJumpHash.insert("Declaration",&COWL2QtXMLOntologyParser::jumpFunctionParseDeclarationNode);
242 mParseFunctionJumpHash.insert("owl:Declaration",&COWL2QtXMLOntologyParser::jumpFunctionParseDeclarationNode);
243
244 mParseFunctionJumpHash.insert("SubClassOf",&COWL2QtXMLOntologyParser::jumpFunctionParseSubClassOfNode);
245 mParseFunctionJumpHash.insert("owl:SubClassOf",&COWL2QtXMLOntologyParser::jumpFunctionParseSubClassOfNode);
246 mParseFunctionJumpHash.insert("EquivalentClasses",&COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentClassesNode);
247 mParseFunctionJumpHash.insert("owl:EquivalentClasses",&COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentClassesNode);
248 mParseFunctionJumpHash.insert("DisjointClasses",&COWL2QtXMLOntologyParser::jumpFunctionParseDisjontClassesNode);
249 mParseFunctionJumpHash.insert("owl:DisjointClasses",&COWL2QtXMLOntologyParser::jumpFunctionParseDisjontClassesNode);
250 mParseFunctionJumpHash.insert("DisjointUnion",&COWL2QtXMLOntologyParser::jumpFunctionParseDisjontUnionNode);
251 mParseFunctionJumpHash.insert("owl:DisjointUnion",&COWL2QtXMLOntologyParser::jumpFunctionParseDisjontUnionNode);
252
253 mParseFunctionJumpHash.insert("SubObjectPropertyOf",&COWL2QtXMLOntologyParser::jumpFunctionParseSubObjectPropertyOfNode);
254 mParseFunctionJumpHash.insert("owl:SubObjectPropertyOf",&COWL2QtXMLOntologyParser::jumpFunctionParseSubObjectPropertyOfNode);
255 mParseFunctionJumpHash.insert("ObjectPropertyChain",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyChainNode);
256 mParseFunctionJumpHash.insert("owl:ObjectPropertyChain",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyChainNode);
257 mParseFunctionJumpHash.insert("EquivalentObjectProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentObjectPropertiesNode);
258 mParseFunctionJumpHash.insert("owl:EquivalentObjectProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentObjectPropertiesNode);
259 mParseFunctionJumpHash.insert("DisjointObjectProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseDisjointObjectPropertiesNode);
260 mParseFunctionJumpHash.insert("owl:DisjointObjectProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseDisjointObjectPropertiesNode);
261
262 mParseFunctionJumpHash.insert("ObjectInverseOf",&COWL2QtXMLOntologyParser::jumpFunctionParseInverseObjectPropertyOfNode);
263 mParseFunctionJumpHash.insert("owl:ObjectInverseOf",&COWL2QtXMLOntologyParser::jumpFunctionParseInverseObjectPropertyOfNode);
264 mParseFunctionJumpHash.insert("InverseObjectProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseInverseObjectPropertiesNode);
265 mParseFunctionJumpHash.insert("owl:InverseObjectProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseInverseObjectPropertiesNode);
266 mParseFunctionJumpHash.insert("ObjectPropertyRange",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyRangeNode);
267 mParseFunctionJumpHash.insert("owl:ObjectPropertyRange",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyRangeNode);
268 mParseFunctionJumpHash.insert("ObjectPropertyDomain",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyDomainNode);
269 mParseFunctionJumpHash.insert("owl:ObjectPropertyDomain",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyDomainNode);
270 mParseFunctionJumpHash.insert("TransitiveObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseTransetiveObjectPropertyNode);
271 mParseFunctionJumpHash.insert("owl:TransitiveObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseTransetiveObjectPropertyNode);
272 mParseFunctionJumpHash.insert("FunctionalObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseFunctionalObjectPropertyNode);
273 mParseFunctionJumpHash.insert("owl:FunctionalObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseFunctionalObjectPropertyNode);
274 mParseFunctionJumpHash.insert("SymmetricObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseSymmetricObjectPropertyNode);
275 mParseFunctionJumpHash.insert("owl:SymmetricObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseSymmetricObjectPropertyNode);
276 mParseFunctionJumpHash.insert("AsymmetricObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseAsymmetricObjectPropertyNode);
277 mParseFunctionJumpHash.insert("owl:AsymmetricObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseAsymmetricObjectPropertyNode);
278 mParseFunctionJumpHash.insert("ReflexiveObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseReflexiveObjectPropertyNode);
279 mParseFunctionJumpHash.insert("owl:ReflexiveObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseReflexiveObjectPropertyNode);
280 mParseFunctionJumpHash.insert("IrreflexiveObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseIrreflexiveObjectPropertyNode);
281 mParseFunctionJumpHash.insert("owl:IrreflexiveObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseIrreflexiveObjectPropertyNode);
282 mParseFunctionJumpHash.insert("InverseFunctionalObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseInverseFunctionalObjectPropertyNode);
283 mParseFunctionJumpHash.insert("owl:InverseFunctionalObjectProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseInverseFunctionalObjectPropertyNode);
284
285 mParseFunctionJumpHash.insert("ObjectIntersectionOf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectIntersectionOfNode);
286 mParseFunctionJumpHash.insert("owl:ObjectIntersectionOf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectIntersectionOfNode);
287 mParseFunctionJumpHash.insert("ObjectUnionOf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectUnionOfNode);
288 mParseFunctionJumpHash.insert("owl:ObjectUnionOf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectUnionOfNode);
289 mParseFunctionJumpHash.insert("ObjectMaxCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectMaxCardinalityNode);
290 mParseFunctionJumpHash.insert("owl:ObjectMaxCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectMaxCardinalityNode);
291 mParseFunctionJumpHash.insert("ObjectMinCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectMinCardinalityNode);
292 mParseFunctionJumpHash.insert("owl:ObjectMinCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectMinCardinalityNode);
293 mParseFunctionJumpHash.insert("ObjectExactCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectExactlyCardinalityNode);
294 mParseFunctionJumpHash.insert("owl:ObjectExactCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectExactlyCardinalityNode);
295 mParseFunctionJumpHash.insert("ObjectSomeValuesFrom",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectSomeValuesFromNode);
296 mParseFunctionJumpHash.insert("owl:ObjectSomeValuesFrom",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectSomeValuesFromNode);
297 mParseFunctionJumpHash.insert("ObjectAllValuesFrom",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectAllValuesFromNode);
298 mParseFunctionJumpHash.insert("owl:ObjectAllValuesFrom",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectAllValuesFromNode);
299 mParseFunctionJumpHash.insert("ObjectComplementOf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectComplementOfNode);
300 mParseFunctionJumpHash.insert("owl:ObjectComplementOf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectComplementOfNode);
301 mParseFunctionJumpHash.insert("ObjectOneOf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectOneOfNode);
302 mParseFunctionJumpHash.insert("owl:ObjectOneOf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectOneOfNode);
303 mParseFunctionJumpHash.insert("ObjectHasValue",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectHasValueNode);
304 mParseFunctionJumpHash.insert("owl:ObjectHasValue",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectHasValueNode);
305 mParseFunctionJumpHash.insert("ObjectHasSelf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectHasSelfNode);
306 mParseFunctionJumpHash.insert("owl:ObjectHasSelf",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectHasSelfNode);
307
308 mParseFunctionJumpHash.insert("Datatype",&COWL2QtXMLOntologyParser::jumpFunctionParseDatatypeNode);
309 mParseFunctionJumpHash.insert("owl:Datatype",&COWL2QtXMLOntologyParser::jumpFunctionParseDatatypeNode);
310 mParseFunctionJumpHash.insert("DataProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyNode);
311 mParseFunctionJumpHash.insert("owl:DataProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyNode);
312 mParseFunctionJumpHash.insert("DataSomeValuesFrom",&COWL2QtXMLOntologyParser::jumpFunctionParseDataSomeValuesFromNode);
313 mParseFunctionJumpHash.insert("owl:DataSomeValuesFrom",&COWL2QtXMLOntologyParser::jumpFunctionParseDataSomeValuesFromNode);
314 mParseFunctionJumpHash.insert("Literal",&COWL2QtXMLOntologyParser::jumpFunctionParseDataLiteralNode);
315 mParseFunctionJumpHash.insert("owl:Literal",&COWL2QtXMLOntologyParser::jumpFunctionParseDataLiteralNode);
316
317
318
319 mParseFunctionJumpHash.insert("DataAllValuesFrom",&COWL2QtXMLOntologyParser::jumpFunctionParseDataAllValuesFromNode);
320 mParseFunctionJumpHash.insert("owl:DataAllValuesFrom",&COWL2QtXMLOntologyParser::jumpFunctionParseDataAllValuesFromNode);
321 mParseFunctionJumpHash.insert("DataHasValue",&COWL2QtXMLOntologyParser::jumpFunctionParseDataHasValueNode);
322 mParseFunctionJumpHash.insert("owl:DataHasValue",&COWL2QtXMLOntologyParser::jumpFunctionParseDataHasValueNode);
323 mParseFunctionJumpHash.insert("DataIntersectionOf",&COWL2QtXMLOntologyParser::jumpFunctionParseDataIntersectionOfNode);
324 mParseFunctionJumpHash.insert("owl:DataIntersectionOf",&COWL2QtXMLOntologyParser::jumpFunctionParseDataIntersectionOfNode);
325 mParseFunctionJumpHash.insert("DataOneOf",&COWL2QtXMLOntologyParser::jumpFunctionParseDataOneOfNode);
326 mParseFunctionJumpHash.insert("owl:DataOneOf",&COWL2QtXMLOntologyParser::jumpFunctionParseDataOneOfNode);
327 mParseFunctionJumpHash.insert("DataUnionOf",&COWL2QtXMLOntologyParser::jumpFunctionParseDataUnionOfNode);
328 mParseFunctionJumpHash.insert("owl:DataUnionOf",&COWL2QtXMLOntologyParser::jumpFunctionParseDataUnionOfNode);
329 mParseFunctionJumpHash.insert("DataComplementOf",&COWL2QtXMLOntologyParser::jumpFunctionParseDataComplementOfNode);
330 mParseFunctionJumpHash.insert("owl:DataComplementOf",&COWL2QtXMLOntologyParser::jumpFunctionParseDataComplementOfNode);
331 mParseFunctionJumpHash.insert("DatatypeRestriction",&COWL2QtXMLOntologyParser::jumpFunctionParseDatatypeRestrictionNode);
332 mParseFunctionJumpHash.insert("owl:DatatypeRestriction",&COWL2QtXMLOntologyParser::jumpFunctionParseDatatypeRestrictionNode);
333 mParseFunctionJumpHash.insert("DataMaxCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseDataMaxCardinalityNode);
334 mParseFunctionJumpHash.insert("owl:DataMaxCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseDataMaxCardinalityNode);
335 mParseFunctionJumpHash.insert("DataMinCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseDataMinCardinalityNode);
336 mParseFunctionJumpHash.insert("owl:DataMinCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseDataMinCardinalityNode);
337 mParseFunctionJumpHash.insert("DataExactCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseDataExactCardinalityNode);
338 mParseFunctionJumpHash.insert("owl:DataExactCardinality",&COWL2QtXMLOntologyParser::jumpFunctionParseDataExactCardinalityNode);
339 mParseFunctionJumpHash.insert("DataPropertyAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyAssertionNode);
340 mParseFunctionJumpHash.insert("owl:DataPropertyAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyAssertionNode);
341 mParseFunctionJumpHash.insert("NegativeDataPropertyAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseNegativeDataPropertyAssertionNode);
342 mParseFunctionJumpHash.insert("owl:NegativeDataPropertyAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseNegativeDataPropertyAssertionNode);
343 mParseFunctionJumpHash.insert("SubDataPropertyOf",&COWL2QtXMLOntologyParser::jumpFunctionParseSubDataPropertyOfNode);
344 mParseFunctionJumpHash.insert("owl:SubDataPropertyOf",&COWL2QtXMLOntologyParser::jumpFunctionParseSubDataPropertyOfNode);
345 mParseFunctionJumpHash.insert("EquivalentDataProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentDataPropertiesNode);
346 mParseFunctionJumpHash.insert("owl:EquivalentDataProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentDataPropertiesNode);
347 mParseFunctionJumpHash.insert("DisjointDataProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseDisjointDataPropertiesNode);
348 mParseFunctionJumpHash.insert("owl:DisjointDataProperties",&COWL2QtXMLOntologyParser::jumpFunctionParseDisjointDataPropertiesNode);
349 mParseFunctionJumpHash.insert("DataPropertyDomain",&COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyDomainNode);
350 mParseFunctionJumpHash.insert("owl:DataPropertyDomain",&COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyDomainNode);
351 mParseFunctionJumpHash.insert("DataPropertyRange",&COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyRangeNode);
352 mParseFunctionJumpHash.insert("owl:DataPropertyRange",&COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyRangeNode);
353 mParseFunctionJumpHash.insert("FunctionalDataProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseFunctionalDataPropertyNode);
354 mParseFunctionJumpHash.insert("owl:FunctionalDataProperty",&COWL2QtXMLOntologyParser::jumpFunctionParseFunctionalDataPropertyNode);
355 mParseFunctionJumpHash.insert("FacetRestriction",&COWL2QtXMLOntologyParser::jumpFunctionParseDataFacetRestrictionNode);
356 mParseFunctionJumpHash.insert("owl:FacetRestriction",&COWL2QtXMLOntologyParser::jumpFunctionParseDataFacetRestrictionNode);
357
358
359
360 mParseFunctionJumpHash.insert("NamedIndividual",&COWL2QtXMLOntologyParser::jumpFunctionParseNamedIndividualNode);
361 mParseFunctionJumpHash.insert("owl:NamedIndividual",&COWL2QtXMLOntologyParser::jumpFunctionParseNamedIndividualNode);
362 mParseFunctionJumpHash.insert("AnonymousIndividual",&COWL2QtXMLOntologyParser::jumpFunctionParseAnonymousIndividualNode);
363 mParseFunctionJumpHash.insert("owl:AnonymousIndividual",&COWL2QtXMLOntologyParser::jumpFunctionParseAnonymousIndividualNode);
364 mParseFunctionJumpHash.insert("ClassAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseClassAssertionNode);
365 mParseFunctionJumpHash.insert("owl:ClassAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseClassAssertionNode);
366 mParseFunctionJumpHash.insert("ObjectPropertyAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyAssertionNode);
367 mParseFunctionJumpHash.insert("owl:ObjectPropertyAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyAssertionNode);
368 mParseFunctionJumpHash.insert("NegativeObjectPropertyAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseNegativeObjectPropertyAssertionNode);
369 mParseFunctionJumpHash.insert("owl:NegativeObjectPropertyAssertion",&COWL2QtXMLOntologyParser::jumpFunctionParseNegativeObjectPropertyAssertionNode);
370 mParseFunctionJumpHash.insert("SameIndividual",&COWL2QtXMLOntologyParser::jumpFunctionParseSameIndividualNode);
371 mParseFunctionJumpHash.insert("owl:SameIndividual",&COWL2QtXMLOntologyParser::jumpFunctionParseSameIndividualNode);
372 mParseFunctionJumpHash.insert("DifferentIndividuals",&COWL2QtXMLOntologyParser::jumpFunctionParseDifferentIndividualsNode);
373 mParseFunctionJumpHash.insert("owl:DifferentIndividuals",&COWL2QtXMLOntologyParser::jumpFunctionParseDifferentIndividualsNode);
374
375 mParseFunctionJumpHash.insert("#text",&COWL2QtXMLOntologyParser::jumpFunctionParseIgnoredNode);
376 mParseFunctionJumpHash.insert("#comment",&COWL2QtXMLOntologyParser::jumpFunctionParseIgnoredNode);
377 mParseFunctionJumpHash.insert("ExpectedResult",&COWL2QtXMLOntologyParser::jumpFunctionParseIgnoredNode);
378
379 mParseFunctionJumpHash.insert("Ontology",&COWL2QtXMLOntologyParser::jumpFunctionTellOntologyAxiomNode);
380 mParseFunctionJumpHash.insert("Tell",&COWL2QtXMLOntologyParser::jumpFunctionTellOntologyAxiomNode);
381 mParseFunctionJumpHash.insert("Whereby",&COWL2QtXMLOntologyParser::jumpFunctionTellOntologyAxiomNode);
382 mParseFunctionJumpHash.insert("Where",&COWL2QtXMLOntologyParser::jumpFunctionTellOntologyAxiomNode);
383 mParseFunctionJumpHash.insert("Retract",&COWL2QtXMLOntologyParser::jumpFunctionRetractOntologyAxiomNode);
384 mParseFunctionJumpHash.insert("rec:Retract",&COWL2QtXMLOntologyParser::jumpFunctionRetractOntologyAxiomNode);
385
386 mParseFunctionJumpHash.insert("Import",&COWL2QtXMLOntologyParser::jumpFunctionParseImportNode);
387 mParseFunctionJumpHash.insert("owl:Import",&COWL2QtXMLOntologyParser::jumpFunctionParseImportNode);
388
389 mParseFunctionJumpHash.insert("DLSafeRule",&COWL2QtXMLOntologyParser::jumpFunctionParseIgnoredNode);
390 mParseFunctionJumpHash.insert("owl:DLSafeRule",&COWL2QtXMLOntologyParser::jumpFunctionParseIgnoredNode);
391
392 return true;
393 }
394
395
396 QList<CParseRuleAtom*> COWL2QtXMLOntologyParser::parseRuleAtomNodes(const QString& ruleNodePrefix, const QDomElement& node) {
397 QList<CParseRuleAtom*> atomList;
398 QDomElement ruleAtomNode = node.firstChildElement();
399 while (!ruleAtomNode.isNull()) {
400 QString nodeString(ruleAtomNode.tagName());
401
402 CParseRuleAtom* ruleAtom = nullptr;
403
404 if (nodeString == ruleNodePrefix+"ObjectPropertyAtom") {
405 ruleAtom = new CParseRuleAtom(CParseRuleAtom::PROPERTYATOM);
406 } else if (nodeString == ruleNodePrefix+"ClassAtom") {
407 ruleAtom = new CParseRuleAtom(CParseRuleAtom::CLASSATOM);
408 }
409
410 if (ruleAtom) {
411 QDomElement elemNode = ruleAtomNode.firstChildElement();
412 while (!elemNode.isNull()) {
413 QString elemNodeString(elemNode.tagName());
414
415 if (elemNodeString == ruleNodePrefix+"Variable" || elemNodeString == ruleNodePrefix+"IndividualVariable" || elemNodeString == ruleNodePrefix+"ObjectVariable") {
416 QString variableName = getEntityName(&elemNode);
417 ruleAtom->addVariableString(variableName);
418 } else {
419 CBuildExpression* exp = parseBuildNode(&elemNode);
420 ruleAtom->mAtomExpression = exp;
421 }
422
423 elemNode = elemNode.nextSiblingElement();
424 }
425 atomList.append(ruleAtom);
426 }
427
428 ruleAtomNode = ruleAtomNode.nextSiblingElement();
429 }
430
431 return atomList;
432 }
433
434
435 QHash<QString,CParseRuleAtom*> COWL2QtXMLOntologyParser::createVariableAtomHash(const QList<CParseRuleAtom*>& atomList) {
436 QHash<QString,CParseRuleAtom*> variableAtomHash;
437 foreach (CParseRuleAtom* atom, atomList) {
438 if (!atom->mVariableName1.isEmpty()) {
439 variableAtomHash.insertMulti(atom->mVariableName1,atom);
440 }
441 if (!atom->mVariableName2.isEmpty()) {
442 variableAtomHash.insertMulti(atom->mVariableName2,atom);
443 }
444 }
445 return variableAtomHash;
446 }
447
448
449
450 QMap<cint64,QString> COWL2QtXMLOntologyParser::createVariableCountMap(const QList<CParseRuleAtom*>& atomList) {
451 QHash<QString,cint64> variableCountHash;
452 foreach (CParseRuleAtom* atom, atomList) {
453 if (!atom->mVariableName1.isEmpty()) {
454 cint64 prevCount = variableCountHash.value(atom->mVariableName1,0);
455 variableCountHash.insert(atom->mVariableName1,prevCount+1);
456 }
457 if (!atom->mVariableName2.isEmpty()) {
458 cint64 prevCount = variableCountHash.value(atom->mVariableName2,0);
459 variableCountHash.insert(atom->mVariableName2,prevCount+1);
460 }
461 }
462 QMap<cint64,QString> countVariableMap;
463 for (QHash<QString,cint64>::const_iterator it = variableCountHash.constBegin(), itEnd = variableCountHash.constEnd(); it != itEnd; ++it) {
464 const QString& variableName = it.key();
465 cint64 variableAtomCount = it.value();
466 countVariableMap.insertMulti(variableAtomCount,variableName);
467 }
468 return countVariableMap;
469 }
470
471
472 QList<CBuildExpression*> COWL2QtXMLOntologyParser::parseRuleNode(QDomElement* node) {
473 QString nodeString(node->tagName());
474 QList<CBuildExpression*> expressionList;
475
476 QHash<QString,CParseRuleAtom*> bodyVariableAtomHash;
477 QHash<QString,CParseRuleAtom*> headVariableAtomHash;
478
479 QList<CParseRuleAtom*> bodyVariableAtomList;
480 QList<CParseRuleAtom*> headVariableAtomList;
481
482 if (nodeString == "DLSafeRule" || nodeString == "owl:DLSafeRule") {
483 QString ruleNodePrefix = "";
484 if (nodeString == "owl:DLSafeRule") {
485 ruleNodePrefix = "owl:";
486 }
487 QDomElement bodyElement = node->firstChildElement(ruleNodePrefix+"Body");
488 bodyVariableAtomList = parseRuleAtomNodes(ruleNodePrefix,bodyElement);
489 QDomElement headElement = node->firstChildElement(ruleNodePrefix+"Head");
490 headVariableAtomList = parseRuleAtomNodes(ruleNodePrefix,headElement);
491
492 bodyVariableAtomHash = createVariableAtomHash(bodyVariableAtomList);
493 headVariableAtomHash = createVariableAtomHash(headVariableAtomList);
494
495 QMap<cint64,QString> headCountVariableMap = createVariableCountMap(headVariableAtomList);
496
497
498 QSet<CParseRuleAtom*> headProcessedAtomSet;
499
500 QList<QString> reversHeadCountVariableList;
501 for (QMap<cint64,QString>::const_iterator it = headCountVariableMap.constBegin(), itEnd = headCountVariableMap.constEnd(); it != itEnd; ++it) {
502 const QString& varString = it.value();
503 reversHeadCountVariableList.prepend(varString);
504 }
505
506 for (QList<QString>::const_iterator it = reversHeadCountVariableList.constBegin(), itEnd = reversHeadCountVariableList.constEnd(); it != itEnd; ++it) {
507 const QString& varString = *it;
508
509 QSet<CParseRuleAtom*> processedBodyAtoms;
510 QList<CParseRuleAtom*> headAtomList = headVariableAtomHash.values(varString);
511 QList<CBuildExpression*> headExpressionList;
512 foreach (CParseRuleAtom* headAtom, headAtomList) {
513 if (!headProcessedAtomSet.contains(headAtom)) {
514 headProcessedAtomSet.insert(headAtom);
515
516 if (headAtom->mAtomType == CParseRuleAtom::PROPERTYATOM) {
517 bool inversed = false;
518 QString otherVarString = headAtom->getOtherVariable(varString,inversed);
519 CBuildExpression* otherVarExp = mOntoBuilder->getNominalIndividualVariable(otherVarString,mAxiomNumber);
520 CBuildExpression* someExp = mOntoBuilder->getObjectSomeValuesFrom(getNeighbourAtomObjectPropertyExpression(headAtom,inversed),otherVarExp);
521 headExpressionList.append(someExp);
522 } else if (headAtom->mAtomType == CParseRuleAtom::CLASSATOM) {
523 headExpressionList.append(headAtom->mAtomExpression);
524 }
525
526 }
527 }
528
529 if (!headExpressionList.isEmpty()) {
530 CBuildExpression* headExp = nullptr;
531 if (headExpressionList.count() >= 2) {
532 headExp = mOntoBuilder->getObjectIntersectionOf(headExpressionList);
533 } else {
534 headExp = headExpressionList.first();
535 }
536
537 CBuildExpression* bodyExp = createBodyExpresions(varString,bodyVariableAtomHash,headVariableAtomHash);
538 CBuildExpression* axiomExp = mOntoBuilder->getSubClassOf(bodyExp,headExp);
539 expressionList.append(axiomExp);
540 }
541
542 ++mAxiomNumber;
543 }
544
545 }
546
547 return expressionList;
548 }
549
550
551 CBuildExpression* COWL2QtXMLOntologyParser::createBodyExpresions(const QString& varString, QHash<QString,CParseRuleAtom*>& bodyVariableAtomHash, QHash<QString,CParseRuleAtom*>& headVariableAtomHash) {
552 QSet<QString> processedVarSet;
553 QSet<CParseRuleAtom*> processedAtomSet;
554 QList<CBuildExpression*> expList;
555 CBuildExpression* mainExp = createBodyExpresions(varString,true,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash);
556 expList.append(mainExp);
557
558 for (QHash<QString,CParseRuleAtom*>::const_iterator it = bodyVariableAtomHash.constBegin(), itEnd = bodyVariableAtomHash.constEnd(); it != itEnd; ++it) {
559 QString nextVarString = it.key();
560 if (!processedVarSet.contains(nextVarString)) {
561 CBuildExpression* topPropExp = mOntoBuilder->getTopObjectProberty();
562 CBuildExpression* succExp = createBodyExpresions(nextVarString,true,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash);
563 CBuildExpression* someExp = mOntoBuilder->getObjectSomeValuesFrom(topPropExp,succExp);
564 expList.append(someExp);
565 }
566 }
567
568 if (expList.count() >= 2) {
569 return mOntoBuilder->getObjectIntersectionOf(expList);
570 }
571 return expList.first();
572 }
573
574 CBuildExpression* COWL2QtXMLOntologyParser::getNeighbourAtomObjectPropertyExpression(CParseRuleAtom* ruleAtom, bool inversed) {
575 if (!inversed) {
576 return ruleAtom->mAtomExpression;
577 } else {
578 return mOntoBuilder->getInverseObjectPropertyOf(ruleAtom->mAtomExpression);
579 }
580 }
581
582
583
584 bool COWL2QtXMLOntologyParser::hasBackExpressionLinks(const QString& varString, CParseRuleAtom* notRuleAtom, QHash<QString,CParseRuleAtom*>& bodyVariableAtomHash, QSet<QString>& processedVarSet,
585 QSet<CParseRuleAtom*>& processedAtomSet, QHash<QString,CParseRuleAtom*>& headVariableAtomHash) {
586
587 QSet<QString> backTestProcessedVarSet;
588 QSet<CParseRuleAtom*> backTestProcessedAtomSet;
589
590 return hasBackExpressionLinks(varString,notRuleAtom,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash,backTestProcessedVarSet,backTestProcessedAtomSet);
591 }
592
593
594
595 bool COWL2QtXMLOntologyParser::hasBackExpressionLinks(const QString& varString, CParseRuleAtom* notRuleAtom, QHash<QString,CParseRuleAtom*>& bodyVariableAtomHash, QSet<QString>& processedVarSet,
596 QSet<CParseRuleAtom*>& processedAtomSet, QHash<QString,CParseRuleAtom*>& headVariableAtomHash, QSet<QString>& backTestProcessedVarSet, QSet<CParseRuleAtom*>& backTestProcessedAtomSet) {
597
598 if (processedVarSet.contains(varString)) {
599 return false;
600 }
601 if (!backTestProcessedVarSet.contains(varString)) {
602 backTestProcessedVarSet.insert(varString);
603
604 QList<CParseRuleAtom*> atomList = bodyVariableAtomHash.values(varString);
605 foreach (CParseRuleAtom* ruleAtom, atomList) {
606 if (ruleAtom->mAtomType == CParseRuleAtom::PROPERTYATOM) {
607 if (ruleAtom != notRuleAtom) {
608 if (processedAtomSet.contains(ruleAtom)) {
609 return true;
610 }
611 if (!backTestProcessedAtomSet.contains(ruleAtom)) {
612 backTestProcessedAtomSet.insert(ruleAtom);
613 bool inversed = false;
614 QString otherVarString = ruleAtom->getOtherVariable(varString,inversed);
615 if (hasBackExpressionLinks(otherVarString,ruleAtom,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash,backTestProcessedVarSet,backTestProcessedAtomSet)) {
616 return true;
617 }
618 }
619 }
620 }
621 }
622 }
623 return false;
624 }
625
626
627 CBuildExpression* COWL2QtXMLOntologyParser::createBodyExpresions(const QString& varString, bool direct, QHash<QString,CParseRuleAtom*>& bodyVariableAtomHash, QSet<QString>& processedVarSet, QSet<CParseRuleAtom*>& processedAtomSet, QHash<QString,CParseRuleAtom*>& headVariableAtomHash) {
628 QList<CBuildExpression*> expList;
629 expList.append(mOntoBuilder->getNominalIndividualVariable(varString,mAxiomNumber));
630
631 if (!processedVarSet.contains(varString)) {
632 processedVarSet.insert(varString);
633
634 QList<CParseRuleAtom*> atomList = bodyVariableAtomHash.values(varString);
635 QList<CParseRuleAtom*> processList;
636 foreach (CParseRuleAtom* ruleAtom, atomList) {
637 if (ruleAtom->mAtomType == CParseRuleAtom::PROPERTYATOM) {
638 if (!processedAtomSet.contains(ruleAtom)) {
639
640 bool inversed = false;
641 QString otherVarString = ruleAtom->getOtherVariable(varString,inversed);
642
643 if (direct || !headVariableAtomHash.contains(varString) || !hasBackExpressionLinks(otherVarString,ruleAtom,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash)) {
644
645 processedAtomSet.insert(ruleAtom);
646 processList.append(ruleAtom);
647 }
648 }
649 } else if (ruleAtom->mAtomType == CParseRuleAtom::CLASSATOM) {
650 processList.append(ruleAtom);
651 }
652 }
653 foreach (CParseRuleAtom* ruleAtom, processList) {
654
655 if (ruleAtom->mAtomType == CParseRuleAtom::PROPERTYATOM) {
656 bool inversed = false;
657 QString otherVarString = ruleAtom->getOtherVariable(varString,inversed);
658 CBuildExpression* succExp = createBodyExpresions(otherVarString,false,bodyVariableAtomHash,processedVarSet,processedAtomSet,headVariableAtomHash);
659 CBuildExpression* someExp = mOntoBuilder->getObjectSomeValuesFrom(getNeighbourAtomObjectPropertyExpression(ruleAtom,inversed),succExp);
660 expList.append(someExp);
661 } else if (ruleAtom->mAtomType == CParseRuleAtom::CLASSATOM) {
662 expList.append(ruleAtom->mAtomExpression);
663 }
664
665 }
666 }
667 if (expList.count() >= 2) {
668 return mOntoBuilder->getObjectIntersectionOf(expList);
669 }
670 return expList.first();
671 }
672
673
674
675 CBuildExpression *COWL2QtXMLOntologyParser::parseBuildNode(QDomElement *node) {
676 CBuildExpression *expression = 0;
677
678 QString nodeString(node->tagName());
679
680 #ifdef KONCLUDE_PARSER_USEPARSEJUMPFUNCTIONHASH
681 ParseFunction function = mParseFunctionJumpHash.value(nodeString);
682 if (function) {
683 expression = (this->*function)(node);
684 } else {
685 QString notSupportedNodeString(nodeString);
686 CNotSupportedNodeErrorRecord::makeRecord(notSupportedNodeString,&recordRouter);
687 }
688 #else
689
690
691 if (nodeString == "Class" || nodeString == "owl:Class" || nodeString == "OWLClass" || nodeString == "owl:OWLClass") {
692 expression = parseClassNode(node);
693 } else if (nodeString == "ObjectProperty" || nodeString == "owl:ObjectProperty") {
694 expression = parseObjectPropertyNode(node);
695 } else if (nodeString == "IndividualVariable" || nodeString == "owl:IndividualVariable") {
696 expression = parseIndividualVariableNode(node);
697 } else if (nodeString == "Declaration" || nodeString == "owl:Declaration") {
698 expression = parseDeclarationNode(node);
699
700 } else if (nodeString == "SubClassOf" || nodeString == "owl:SubClassOf") {
701 expression = parseSubClassOfNode(node);
702 } else if (nodeString == "EquivalentClasses" || nodeString == "owl:EquivalentClasses") {
703 expression = parseEquivalentClassesNode(node);
704 } else if (nodeString == "DisjointClasses" || nodeString == "owl:DisjointClasses") {
705 expression = parseDisjontClassesNode(node);
706 } else if (nodeString == "DisjointUnion" || nodeString == "owl:DisjointUnion") {
707 expression = parseDisjontUnionNode(node);
708
709 } else if (nodeString == "SubObjectPropertyOf" || nodeString == "owl:SubObjectPropertyOf") {
710 expression = parseSubObjectPropertyOfNode(node);
711 } else if (nodeString == "ObjectPropertyChain" || nodeString == "owl:ObjectPropertyChain") {
712 expression = parseObjectPropertyChainNode(node);
713 } else if (nodeString == "EquivalentObjectProperties" || nodeString == "owl:EquivalentObjectProperties") {
714 expression = parseEquivalentObjectPropertiesNode(node);
715 } else if (nodeString == "DisjointObjectProperties" || nodeString == "owl:DisjointObjectProperties") {
716 expression = parseDisjointObjectPropertiesNode(node);
717
718 } else if (nodeString == "ObjectInverseOf" || nodeString == "owl:ObjectInverseOf") {
719 expression = parseInverseObjectPropertyOfNode(node);
720 } else if (nodeString == "InverseObjectProperties" || nodeString == "owl:InverseObjectProperties") {
721 expression = parseInverseObjectPropertiesNode(node);
722 } else if (nodeString == "ObjectPropertyRange" || nodeString == "owl:ObjectPropertyRange") {
723 expression = parseObjectPropertyRangeNode(node);
724 } else if (nodeString == "ObjectPropertyDomain" || nodeString == "owl:ObjectPropertyDomain") {
725 expression = parseObjectPropertyDomainNode(node);
726 } else if (nodeString == "TransitiveObjectProperty" || nodeString == "owl:TransitiveObjectProperty") {
727 expression = parseTransetiveObjectPropertyNode(node);
728 } else if (nodeString == "FunctionalObjectProperty" || nodeString == "owl:FunctionalObjectProperty") {
729 expression = parseFunctionalObjectPropertyNode(node);
730 } else if (nodeString == "SymmetricObjectProperty" || nodeString == "owl:SymmetricObjectProperty") {
731 expression = parseSymmetricObjectPropertyNode(node);
732 } else if (nodeString == "AsymmetricObjectProperty" || nodeString == "owl:AsymmetricObjectProperty") {
733 expression = parseAsymmetricObjectPropertyNode(node);
734 } else if (nodeString == "ReflexiveObjectProperty" || nodeString == "owl:ReflexiveObjectProperty") {
735 expression = parseReflexiveObjectPropertyNode(node);
736 } else if (nodeString == "IrreflexiveObjectProperty" || nodeString == "owl:IrreflexiveObjectProperty") {
737 expression = parseIrreflexiveObjectPropertyNode(node);
738 } else if (nodeString == "InverseFunctionalObjectProperty" || nodeString == "owl:InverseFunctionalObjectProperty") {
739 expression = parseInverseFunctionalObjectPropertyNode(node);
740
741 } else if (nodeString == "ObjectIntersectionOf" || nodeString == "owl:ObjectIntersectionOf") {
742 expression = parseObjectIntersectionOfNode(node);
743 } else if (nodeString == "ObjectComplementOf" || nodeString == "owl:ObjectComplementOf") {
744 expression = parseObjectComplementOfNode(node);
745 } else if (nodeString == "ObjectUnionOf" || nodeString == "owl:ObjectUnionOf") {
746 expression = parseObjectUnionOfNode(node);
747 } else if (nodeString == "ObjectMaxCardinality" || nodeString == "owl:ObjectMaxCardinality") {
748 expression = parseObjectMaxCardinalityNode(node);
749 } else if (nodeString == "ObjectMinCardinality" || nodeString == "owl:ObjectMinCardinality") {
750 expression = parseObjectMinCardinalityNode(node);
751 } else if (nodeString == "ObjectExactCardinality" || nodeString == "owl:ObjectExactCardinality") {
752 expression = parseObjectExactlyCardinalityNode(node);
753 } else if (nodeString == "ObjectSomeValuesFrom" || nodeString == "owl:ObjectSomeValuesFrom") {
754 expression = parseObjectSomeValuesFromNode(node);
755 } else if (nodeString == "ObjectAllValuesFrom" || nodeString == "owl:ObjectAllValuesFrom") {
756 expression = parseObjectAllValuesFromNode(node);
757 } else if (nodeString == "ObjectOneOf" || nodeString == "owl:ObjectOneOf") {
758 expression = parseObjectOneOfNode(node);
759 } else if (nodeString == "ObjectHasValue" || nodeString == "owl:ObjectHasValue") {
760 expression = parseObjectHasValueNode(node);
761 } else if (nodeString == "ObjectHasSelf" || nodeString == "owl:ObjectHasSelf") {
762 expression = parseObjectHasSelfNode(node);
763
764 } else if (nodeString == "ClassAssertion" || nodeString == "owl:ClassAssertion") {
765 expression = parseClassAssertionNode(node);
766 } else if (nodeString == "NamedIndividual" || nodeString == "owl:NamedIndividual") {
767 expression = parseNamedIndividualNode(node);
768 } else if (nodeString == "ObjectPropertyAssertion" || nodeString == "owl:ObjectPropertyAssertion") {
769 expression = parseObjectPropertyAssertionNode(node);
770 } else if (nodeString == "NegativeObjectPropertyAssertion" || nodeString == "owl:NegativeObjectPropertyAssertion") {
771 expression = parseNegativeObjectPropertyAssertionNode(node);
772 } else if (nodeString == "SameIndividual" || nodeString == "owl:SameIndividual") {
773 expression = parseSameIndividualNode(node);
774 } else if (nodeString == "DifferentIndividuals" || nodeString == "owl:DifferentIndividuals") {
775 expression = parseDifferentIndividualsNode(node);
776
777
778
779 } else if (nodeString == "Datatype" || nodeString == "owl:Datatype") {
780 expression = jumpFunctionParseDatatypeNode(node);
781 } else if (nodeString == "DataProperty" || nodeString == "owl:DataProperty") {
782 expression = jumpFunctionParseDataPropertyNode(node);
783 } else if (nodeString == "DataSomeValuesFrom" || nodeString == "owl:DataSomeValuesFrom") {
784 expression = jumpFunctionParseDataSomeValuesFromNode(node);
785 } else if (nodeString == "Literal" || nodeString == "owl:Literal") {
786 expression = jumpFunctionParseDataLiteralNode(node);
787
788 } else if (nodeString == "DataAllValuesFrom" || nodeString == "owl:DataAllValuesFrom") {
789 expression = jumpFunctionParseDataAllValuesFromNode(node);
790 } else if (nodeString == "DataHasValue" || nodeString == "owl:DataHasValue") {
791 expression = jumpFunctionParseDataHasValueNode(node);
792 } else if (nodeString == "DataIntersectionOf" || nodeString == "owl:DataIntersectionOf") {
793 expression = jumpFunctionParseDataIntersectionOfNode(node);
794 } else if (nodeString == "DataOneOf" || nodeString == "owl:DataOneOf") {
795 expression = jumpFunctionParseDataOneOfNode(node);
796 } else if (nodeString == "DataUnionOf" || nodeString == "owl:DataUnionOf") {
797 expression = jumpFunctionParseDataUnionOfNode(node);
798 } else if (nodeString == "DataComplementOf" || nodeString == "owl:DataComplementOf") {
799 expression = jumpFunctionParseDataComplementOfNode(node);
800 } else if (nodeString == "DatatypeRestriction" || nodeString == "owl:DatatypeRestriction") {
801 expression = jumpFunctionParseDatatypeRestrictionNode(node);
802 } else if (nodeString == "DataMaxCardinality" || nodeString == "owl:DataMaxCardinality") {
803 expression = jumpFunctionParseDataMaxCardinalityNode(node);
804 } else if (nodeString == "DataMinCardinality" || nodeString == "owl:DataMinCardinality") {
805 expression = jumpFunctionParseDataMinCardinalityNode(node);
806 } else if (nodeString == "DataExactCardinality" || nodeString == "owl:DataExactCardinality") {
807 expression = jumpFunctionParseDataExactCardinalityNode(node);
808
809 } else if (nodeString == "DataPropertyAssertion" || nodeString == "owl:DataPropertyAssertion") {
810 expression = jumpFunctionParseDataPropertyAssertionNode(node);
811 } else if (nodeString == "NegativeDataPropertyAssertion" || nodeString == "owl:NegativeDataPropertyAssertion") {
812 expression = jumpFunctionParseNegativeDataPropertyAssertionNode(node);
813
814 } else if (nodeString == "SubDataPropertyOf" || nodeString == "owl:SubDataPropertyOf") {
815 expression = jumpFunctionParseSubDataPropertyOfNode(node);
816 } else if (nodeString == "EquivalentDataProperties" || nodeString == "owl:EquivalentDataProperties") {
817 expression = jumpFunctionParseEquivalentDataPropertiesNode(node);
818 } else if (nodeString == "DisjointDataProperties" || nodeString == "owl:DisjointDataProperties") {
819 expression = jumpFunctionParseDisjointDataPropertiesNode(node);
820 } else if (nodeString == "DataPropertyDomain" || nodeString == "owl:DataPropertyDomain") {
821 expression = jumpFunctionParseDataPropertyDomainNode(node);
822 } else if (nodeString == "DataPropertyRange" || nodeString == "owl:DataPropertyRange") {
823 expression = jumpFunctionParseDataPropertyRangeNode(node);
824 } else if (nodeString == "FunctionalDataProperty" || nodeString == "owl:FunctionalDataProperty") {
825 expression = jumpFunctionParseFunctionalDataPropertyNode(node);
826
827
828
829 } else if (nodeString == "#text") {
830 // ignoring text nodes
831 } else if (nodeString == "#comment") {
832 // ignoring comment nodes
833 } else if (nodeString == "ExpectedResult") {
834 // ignoring expected results nodes
835 } else if (nodeString == "Retract") {
836 parseRetractOntologyAxiomNode(node);
837 } else if (nodeString == "Tell" || nodeString == "Whereby" || nodeString == "Ontology") {
838 parseTellOntologyAxiomNode(node);
839
840 } else if (nodeString == "Import" || nodeString == "owl:Import") {
841 expression = jumpFunctionParseImportNode(node);
842
843 } else {
844 if (mReportErrorCount > 0) {
845 --mReportErrorCount;
846 QString notSupportedNodeString(nodeString);
847 CNotSupportedNodeErrorRecord::makeRecord(notSupportedNodeString,&recordRouter);
848 } else if (mReportErrorCount == 0) {
849 --mReportErrorCount;
850 CUnspecifiedMessageErrorRecord::makeRecord(QString("Remaining not supported expressions are ignored"),&recordRouter);
851 }
852 //LOG(WARNING,getLogDomain(),logTr("Not supported XML node: '%1'. Continue with next/child node.").arg(notSupportedNodeString),this);
853 }
854 #endif
855 return expression;
856 }
857
858
859 CDeclarationAxiomExpression* COWL2QtXMLOntologyParser::parseDeclarationNode(QDomElement* node) {
860 QList<CBuildExpression *> builds = parseChildNodes(node);
861 CDeclarationAxiomExpression* declarationExpression = nullptr;
862 declarationExpression = mOntoBuilder->getDeclaration(builds);
863 ++mAxiomNumber;
864 return declarationExpression;
865 }
866
867
868 CObjectPropertyExpression *COWL2QtXMLOntologyParser::parseObjectPropertyNode(QDomElement *node) {
869 // parse <Class URI="xxxx"/>
870 QString probName = getEntityName(node);
871 CObjectPropertyExpression *objectExpression = 0;
872 if (!probName.isEmpty()) {
873 objectExpression = mOntoBuilder->getObjectProberty(probName);
874 }
875 return objectExpression;
876 }
877
878
879 CClassExpression *COWL2QtXMLOntologyParser::parseClassNode(QDomElement *node) {
880 // parse <ObjectProperty URI="xxxx"/>
881 QString className = getEntityName(node);
882 CClassExpression *classExpression = 0;
883 if (!className.isEmpty()) {
884 classExpression = mOntoBuilder->getClass(className);
885 }
886 return classExpression;
887 }
888
889
890 CObjectIndividualVariableExpression* COWL2QtXMLOntologyParser::parseIndividualVariableNode(QDomElement* node) {
891 // parse <ObjectIndividualVariable URI="xxxx"/>
892 QString indiVarName = getEntityName(node);
893 CObjectIndividualVariableExpression *indiVarExpression = 0;
894 if (!indiVarName.isEmpty()) {
895 indiVarExpression = mOntoBuilder->getNominalIndividualVariable(indiVarName,mAxiomNumber);
896 }
897 return indiVarExpression;
898 }
899
900
901
902 QList<CBuildExpression *> COWL2QtXMLOntologyParser::parseChildNodes(QDomElement *node) {
903 QList<CBuildExpression *> builds;
904 QDomElement childNode = node->firstChildElement();
905 while (!childNode.isNull()) {
906 CBuildExpression *expression = parseBuildNode(&childNode);
907 if (expression) {
908 builds.append(expression);
909 }
910 childNode = childNode.nextSiblingElement();
911 }
912 return builds;
913 }
914
915
916 CEquivalentClassesExpression *COWL2QtXMLOntologyParser::parseEquivalentClassesNode(QDomElement *node) {
917 // parse <EquivalentClasses> <...> <...> </EquivalentClasses>
918 QList<CBuildExpression *> builds = parseChildNodes(node);
919 CEquivalentClassesExpression *ecExp = 0;
920
921 ecExp = mOntoBuilder->getEquivalentClasses(builds);
922 ++mAxiomNumber;
923 return ecExp;
924 }
925
926
927 CSubClassOfExpression *COWL2QtXMLOntologyParser::parseSubClassOfNode(QDomElement *node) {
928 // parse <SubClassOf> <...> <...> </SubClassOf>
929 QList<CBuildExpression *> builds = parseChildNodes(node);
930 CSubClassOfExpression *scoExp = 0;
931
932 scoExp = mOntoBuilder->getSubClassOf(builds);
933 ++mAxiomNumber;
934 return scoExp;
935 }
936
937
938 CObjectPropertyDomainExpression *COWL2QtXMLOntologyParser::parseObjectPropertyDomainNode(QDomElement *node) {
939 // parse <ObjectPropertyDomain> <...> <...> </ObjectPropertyDomain>
940 QList<CBuildExpression *> builds = parseChildNodes(node);
941 CObjectPropertyDomainExpression *obPrDoExp = 0;
942
943 obPrDoExp = mOntoBuilder->getObjectPropertyDomainExpression(builds);
944 ++mAxiomNumber;
945 return obPrDoExp;
946 }
947
948 CObjectPropertyRangeExpression *COWL2QtXMLOntologyParser::parseObjectPropertyRangeNode(QDomElement *node) {
949 // parse <ObjectPropertyRange> <...> <...> </ObjectPropertyRange>
950 QList<CBuildExpression *> builds = parseChildNodes(node);
951 CObjectPropertyRangeExpression *obPrRaExp = 0;
952
953 obPrRaExp = mOntoBuilder->getObjectPropertyRangeExpression(builds);
954 ++mAxiomNumber;
955 return obPrRaExp;
956 }
957
958
959 CSubObjectPropertyOfExpression *COWL2QtXMLOntologyParser::parseSubObjectPropertyOfNode(QDomElement *node) {
960 // parse <SubObjectPropertyOf> <...> <...> </SubObjectPropertyOf>
961 QList<CBuildExpression *> builds = parseChildNodes(node);
962 CSubObjectPropertyOfExpression *sopoExp = 0;
963
964 sopoExp = mOntoBuilder->getSubObjectPropertyOf(builds);
965 ++mAxiomNumber;
966 return sopoExp;
967 }
968
969 CObjectPropertyChainExpression *COWL2QtXMLOntologyParser::parseObjectPropertyChainNode(QDomElement *node) {
970 // parse <ObjectPropertyChain> <...> <...> </ObjectPropertyChain>
971 QList<CBuildExpression *> builds = parseChildNodes(node);
972 CObjectPropertyChainExpression *sopoExp = 0;
973
974 sopoExp = mOntoBuilder->getObjectPropertyChain(builds);
975 return sopoExp;
976 }
977
978 CEquivalentObjectPropertiesExpression *COWL2QtXMLOntologyParser::parseEquivalentObjectPropertiesNode(QDomElement *node) {
979 // parse <EquivalentObjectProperties> <...> <...> </EquivalentObjectProperties>
980 QList<CBuildExpression *> builds = parseChildNodes(node);
981 CEquivalentObjectPropertiesExpression *sopoExp = 0;
982
983 sopoExp = mOntoBuilder->getEquivalentObjectProperties(builds);
984 ++mAxiomNumber;
985 return sopoExp;
986 }
987
988 CDisjointObjectPropertiesExpression *COWL2QtXMLOntologyParser::parseDisjointObjectPropertiesNode(QDomElement *node) {
989 // parse <DisjointObjectProperties> <...> <...> </DisjointObjectProperties>
990 QList<CBuildExpression *> builds = parseChildNodes(node);
991 CDisjointObjectPropertiesExpression *sopoExp = 0;
992
993 sopoExp = mOntoBuilder->getDisjointObjectProperties(builds);
994 ++mAxiomNumber;
995 return sopoExp;
996 }
997
998 CInverseObjectPropertyOfExpression *COWL2QtXMLOntologyParser::parseInverseObjectPropertyOfNode(QDomElement *node) {
999 // parse <ObjectInverseOf> <...> <...> </ObjectInverseOf>
1000 QList<CBuildExpression *> builds = parseChildNodes(node);
1001 CInverseObjectPropertyOfExpression *iopoExp = 0;
1002
1003 iopoExp = mOntoBuilder->getInverseObjectPropertyOf(builds);
1004 return iopoExp;
1005 }
1006
1007 CInverseObjectPropertiesExpression *COWL2QtXMLOntologyParser::parseInverseObjectPropertiesNode(QDomElement *node) {
1008 // parse <InverseObjectProperties> <...> <...> </InverseObjectProperties>
1009 QList<CBuildExpression *> builds = parseChildNodes(node);
1010 CInverseObjectPropertiesExpression *iopoExp = 0;
1011
1012 iopoExp = mOntoBuilder->getInverseObjectProperties(builds);
1013 ++mAxiomNumber;
1014 return iopoExp;
1015 }
1016
1017
1018 CDisjointClassesExpression *COWL2QtXMLOntologyParser::parseDisjontClassesNode(QDomElement *node) {
1019 // parse <CDisjointClasses> <...> <...> </CDisjointClasses>
1020 QList<CBuildExpression *> builds = parseChildNodes(node);
1021 CDisjointClassesExpression *disClassExp = 0;
1022
1023 disClassExp = mOntoBuilder->getDisjointClasses(builds);
1024 ++mAxiomNumber;
1025 return disClassExp;
1026 }
1027
1028 CDisjointUnionExpression *COWL2QtXMLOntologyParser::parseDisjontUnionNode(QDomElement *node) {
1029 // parse <DisjointUnion> <...> <...> </DisjointUnion>
1030 QList<CBuildExpression *> builds = parseChildNodes(node);
1031 CDisjointUnionExpression *disClassExp = 0;
1032
1033 disClassExp = mOntoBuilder->getDisjointUnion(builds);
1034 return disClassExp;
1035 }
1036
1037
1038
1039 CObjectIntersectionOfExpression *COWL2QtXMLOntologyParser::parseObjectIntersectionOfNode(QDomElement *node) {
1040 // parse <ObjectIntersectionOf> <...> <...> <...> ... </ObjectIntersectionOf>
1041 QList<CBuildExpression *> builds = parseChildNodes(node);
1042 CObjectIntersectionOfExpression* exp = nullptr;
1043
1044 exp = mOntoBuilder->getObjectIntersectionOf(builds);
1045 return exp;
1046 }
1047
1048 CObjectUnionOfExpression *COWL2QtXMLOntologyParser::parseObjectUnionOfNode(QDomElement *node) {
1049 // parse <ObjectUnionOf> <...> <...> <...> ... </ObjectUnionOf>
1050 QList<CBuildExpression *> builds = parseChildNodes(node);
1051 CObjectUnionOfExpression* exp = nullptr;
1052
1053 exp = mOntoBuilder->getObjectUnionOf(builds);
1054 return exp;
1055 }
1056
1057
1058 cint64 COWL2QtXMLOntologyParser::parseCardinality(QDomElement* node) {
1059 cint64 cardinality = 0;
1060 QString cardinalityString = node->attribute(QString("cardinality"));
1061 if (cardinalityString.isEmpty()) {
1062 cardinalityString = node->attribute(QString("owl:cardinality"));
1063 }
1064 if (!cardinalityString.isEmpty()) {
1065 cardinality = cardinalityString.toLongLong();
1066 }
1067 return cardinality;
1068 }
1069
1070
1071 CObjectMaxCardinalityExpression *COWL2QtXMLOntologyParser::parseObjectMaxCardinalityNode(QDomElement *node) {
1072 // parse <ObjectMaxCardinality cardinality="xxx"> <...> <...> <...> ... </ObjectMaxCardinality>
1073
1074 CObjectMaxCardinalityExpression* exp = nullptr;
1075 cint64 cardinality = parseCardinality(node);
1076 if (mOntoBuilder) {
1077 QList<CBuildExpression *> builds = parseChildNodes(node);
1078 exp = mOntoBuilder->getObjectMaxCardinality(builds,cardinality);
1079 }
1080 return exp;
1081 }
1082
1083 CObjectMinCardinalityExpression *COWL2QtXMLOntologyParser::parseObjectMinCardinalityNode(QDomElement *node) {
1084 // parse <ObjectMinCardinality cardinality="xxx"> <...> <...> <...> ... </ObjectMinCardinality>
1085
1086 CObjectMinCardinalityExpression* exp = nullptr;
1087 cint64 cardinality = parseCardinality(node);
1088 if (mOntoBuilder) {
1089 QList<CBuildExpression *> builds = parseChildNodes(node);
1090 exp = mOntoBuilder->getObjectMinCardinality(builds,cardinality);
1091 }
1092 return exp;
1093 }
1094
1095 CObjectExactlyCardinalityExpression *COWL2QtXMLOntologyParser::parseObjectExactlyCardinalityNode(QDomElement *node) {
1096 // parse <ObjectExactlyCardinality cardinality="xxx"> <...> <...> <...> ... </ObjectExactlyCardinality>
1097
1098 CObjectExactlyCardinalityExpression* exp = nullptr;
1099 cint64 cardinality = parseCardinality(node);
1100 if (mOntoBuilder) {
1101 QList<CBuildExpression *> builds = parseChildNodes(node);
1102 exp = mOntoBuilder->getObjectExactlyCardinality(builds,cardinality);
1103 }
1104 return exp;
1105 }
1106
1107 CObjectSomeValuesFromExpression *COWL2QtXMLOntologyParser::parseObjectSomeValuesFromNode(QDomElement *node) {
1108 // parse <ObjectSomeValueFrom> <...> <...> <...> ... </ObjectSomeValueFrom>
1109 QList<CBuildExpression *> builds = parseChildNodes(node);
1110 CObjectSomeValuesFromExpression* exp = nullptr;
1111 exp = mOntoBuilder->getObjectSomeValuesFrom(builds);
1112 return exp;
1113 }
1114
1115 CObjectHasValueExpression* COWL2QtXMLOntologyParser::parseObjectHasValueNode(QDomElement* node) {
1116 // parse <ObjectHasValue> <...> <...> <...> ... </ObjectHasValue>
1117 QList<CBuildExpression *> builds = parseChildNodes(node);
1118 CObjectHasValueExpression* exp = nullptr;
1119
1120 exp = mOntoBuilder->getObjectHasValue(builds);
1121 return exp;
1122 }
1123
1124 CObjectHasSelfExpression* COWL2QtXMLOntologyParser::parseObjectHasSelfNode(QDomElement* node) {
1125 // parse <ObjectHasSelf> <...> <...> <...> ... </ObjectHasSelf>
1126 QList<CBuildExpression *> builds = parseChildNodes(node);
1127 CObjectHasSelfExpression* exp = nullptr;
1128
1129 exp = mOntoBuilder->getObjectHasSelf(builds);
1130 return exp;
1131 }
1132
1133
1134 CObjectAllValuesFromExpression *COWL2QtXMLOntologyParser::parseObjectAllValuesFromNode(QDomElement *node) {
1135 // parse <ObjectAllValueFrom> <...> <...> <...> ... </ObjectAllValueFrom>
1136 QList<CBuildExpression *> builds = parseChildNodes(node);
1137 CObjectAllValuesFromExpression* exp = nullptr;
1138
1139 exp = mOntoBuilder->getObjectAllValuesFrom(builds);
1140 return exp;
1141 }
1142
1143
1144 CObjectComplementOfExpression *COWL2QtXMLOntologyParser::parseObjectComplementOfNode(QDomElement *node) {
1145 // parse <ObjectComplementOf> <...> </ObjectComplementOf>
1146 QList<CBuildExpression *> builds = parseChildNodes(node);
1147 CObjectComplementOfExpression* exp = nullptr;
1148
1149 exp = mOntoBuilder->getObjectComplementOf(builds);
1150 return exp;
1151 }
1152
1153 CObjectOneOfExpression *COWL2QtXMLOntologyParser::parseObjectOneOfNode(QDomElement *node) {
1154 // parse <ObjectOneOf> <...> </ObjectOneOf>
1155 QList<CBuildExpression *> builds = parseChildNodes(node);
1156 CObjectOneOfExpression* exp = nullptr;
1157
1158 exp = mOntoBuilder->getObjectOneOf(builds);
1159 return exp;
1160 }
1161
1162
1163 CTransetiveObjectPropertyExpression *COWL2QtXMLOntologyParser::parseTransetiveObjectPropertyNode(QDomElement *node) {
1164 QList<CBuildExpression *> builds = parseChildNodes(node);
1165 CTransetiveObjectPropertyExpression* exp = nullptr;
1166
1167 exp = mOntoBuilder->getTransetiveObjectProperty(builds);
1168 ++mAxiomNumber;
1169 return exp;
1170 }
1171
1172
1173 CFunctionalObjectPropertyExpression *COWL2QtXMLOntologyParser::parseFunctionalObjectPropertyNode(QDomElement *node) {
1174 QList<CBuildExpression *> builds = parseChildNodes(node);
1175 CFunctionalObjectPropertyExpression* exp = nullptr;
1176
1177 exp = mOntoBuilder->getFunctionalObjectProperty(builds);
1178 ++mAxiomNumber;
1179 return exp;
1180 }
1181
1182
1183 CSymmetricObjectPropertyExpression* COWL2QtXMLOntologyParser::parseSymmetricObjectPropertyNode(QDomElement* node) {
1184 QList<CBuildExpression *> builds = parseChildNodes(node);
1185 CSymmetricObjectPropertyExpression* exp = nullptr;
1186
1187 exp = mOntoBuilder->getSymmetricObjectProperty(builds);
1188 ++mAxiomNumber;
1189 return exp;
1190 }
1191
1192 CAsymmetricObjectPropertyExpression* COWL2QtXMLOntologyParser::parseAsymmetricObjectPropertyNode(QDomElement* node) {
1193 QList<CBuildExpression *> builds = parseChildNodes(node);
1194 CAsymmetricObjectPropertyExpression* exp = nullptr;
1195
1196 exp = mOntoBuilder->getAsymmetricObjectProperty(builds);
1197 ++mAxiomNumber;
1198 return exp;
1199 }
1200
1201 CReflexiveObjectPropertyExpression* COWL2QtXMLOntologyParser::parseReflexiveObjectPropertyNode(QDomElement* node) {
1202 QList<CBuildExpression *> builds = parseChildNodes(node);
1203 CReflexiveObjectPropertyExpression* exp = nullptr;
1204
1205 exp = mOntoBuilder->getReflexiveObjectProperty(builds);
1206 ++mAxiomNumber;
1207 return exp;
1208 }
1209
1210 CIrreflexiveObjectPropertyExpression* COWL2QtXMLOntologyParser::parseIrreflexiveObjectPropertyNode(QDomElement* node) {
1211 QList<CBuildExpression *> builds = parseChildNodes(node);
1212 CIrreflexiveObjectPropertyExpression* exp = nullptr;
1213
1214 exp = mOntoBuilder->getIrreflexiveObjectProperty(builds);
1215 ++mAxiomNumber;
1216 return exp;
1217 }
1218
1219 CInverseFunctionalObjectPropertyExpression* COWL2QtXMLOntologyParser::parseInverseFunctionalObjectPropertyNode(QDomElement* node) {
1220 QList<CBuildExpression *> builds = parseChildNodes(node);
1221 CInverseFunctionalObjectPropertyExpression* exp = nullptr;
1222
1223 exp = mOntoBuilder->getInverseFunctionalObjectProperty(builds);
1224 ++mAxiomNumber;
1225 return exp;
1226 }
1227
1228
1229
1230
1231
1232 CClassAssertionExpression *COWL2QtXMLOntologyParser::parseClassAssertionNode(QDomElement *node) {
1233 // parse <ClassAssertion> <...> </ClassAssertion>
1234 QList<CBuildExpression *> builds = parseChildNodes(node);
1235 CClassAssertionExpression* exp = nullptr;
1236
1237 if (mOntoBuilder) {
1238 exp = mOntoBuilder->getClassAssertion(builds);
1239 }
1240 ++mAxiomNumber;
1241 return exp;
1242 }
1243
1244
1245 CSameIndividualExpression *COWL2QtXMLOntologyParser::parseSameIndividualNode(QDomElement *node) {
1246 // parse <SameIndividual> <...> </SameIndividual>
1247 QList<CBuildExpression *> builds = parseChildNodes(node);
1248 CSameIndividualExpression* exp = nullptr;
1249 if (mOntoBuilder) {
1250 exp = mOntoBuilder->getSameIndividual(builds);
1251 }
1252 ++mAxiomNumber;
1253 return exp;
1254 }
1255
1256 CDifferentIndividualsExpression *COWL2QtXMLOntologyParser::parseDifferentIndividualsNode(QDomElement *node) {
1257 // parse <DifferentIndividuals> <...> </DifferentIndividuals>
1258 QList<CBuildExpression *> builds = parseChildNodes(node);
1259 CDifferentIndividualsExpression* exp = nullptr;
1260 if (mOntoBuilder) {
1261 exp = mOntoBuilder->getDifferentIndividuals(builds);
1262 }
1263 ++mAxiomNumber;
1264 return exp;
1265 }
1266
1267
1268 CNamedIndividualExpression *COWL2QtXMLOntologyParser::parseNamedIndividualNode(QDomElement *node) {
1269 // parse <NamedIndividual> <...> </NamedIndividual>
1270 QString indiNameName = getEntityName(node);
1271 CNamedIndividualExpression* exp = nullptr;
1272 if (!indiNameName.isEmpty()) {
1273 if (mOntoBuilder) {
1274 exp = mOntoBuilder->getNamedIndividual(indiNameName);
1275 }
1276 }
1277 return exp;
1278 }
1279
1280
1281 CAnonymousIndividualExpression *COWL2QtXMLOntologyParser::parseAnonymousIndividualNode(QDomElement *node) {
1282 // parse <NamedIndividual> <...> </NamedIndividual>
1283 if (mOntologyIdentifier.isEmpty()) {
1284 mOntologyIdentifier = mOntoBuilder->getOntologyAnonymousIdentifier(mOntoBuilder->getOntologyName());
1285 }
1286 QString indiNameName = node->attribute(QString("nodeID"));
1287 CAnonymousIndividualExpression* exp = nullptr;
1288 if (!indiNameName.isEmpty()) {
1289 if (mOntoBuilder) {
1290 exp = mOntoBuilder->getAnonymousIndividual(mOntologyIdentifier,indiNameName);
1291 }
1292 }
1293 return exp;
1294 }
1295
1296 CObjectPropertyAssertionExpression *COWL2QtXMLOntologyParser::parseObjectPropertyAssertionNode(QDomElement *node) {
1297 // parse <ObjectPropertyAssertion> <...> </ObjectPropertyAssertion>
1298 QList<CBuildExpression *> builds = parseChildNodes(node);
1299 CObjectPropertyAssertionExpression* exp = nullptr;
1300
1301 if (mOntoBuilder) {
1302 exp = mOntoBuilder->getObjectPropertyAssertion(builds);
1303 }
1304 ++mAxiomNumber;
1305 return exp;
1306 }
1307
1308 CNegativeObjectPropertyAssertionExpression *COWL2QtXMLOntologyParser::parseNegativeObjectPropertyAssertionNode(QDomElement *node) {
1309 // parse <NegativeObjectPropertyAssertion> <...> </NegativeObjectPropertyAssertion>
1310 QList<CBuildExpression *> builds = parseChildNodes(node);
1311 CNegativeObjectPropertyAssertionExpression* exp = nullptr;
1312
1313 if (mOntoBuilder) {
1314 exp = mOntoBuilder->getNegativeObjectPropertyAssertion(builds);
1315 }
1316 ++mAxiomNumber;
1317 return exp;
1318 }
1319
1320
1321
1322
1323
1324
1325 CDatatypeExpression *COWL2QtXMLOntologyParser::parseDatatypeNode(QDomElement *node) {
1326 QString datatypeName = getEntityName(node);
1327 CDatatypeExpression* datatypeExpression = nullptr;
1328 if (!datatypeName.isEmpty()) {
1329 datatypeExpression = mOntoBuilder->getDatatype(datatypeName);
1330 }
1331 return datatypeExpression;
1332 }
1333
1334
1335 CDataPropertyExpression* COWL2QtXMLOntologyParser::parseDataPropertyNode(QDomElement* node) {
1336 QString dataPropertyName = getEntityName(node);
1337 CDataPropertyExpression* dataPropertyExpression = nullptr;
1338 if (!dataPropertyName.isEmpty()) {
1339 dataPropertyExpression = mOntoBuilder->getDataProberty(dataPropertyName);
1340 }
1341 return dataPropertyExpression;
1342 }
1343
1344
1345 CDataSomeValuesFromExpression* COWL2QtXMLOntologyParser::parseDataSomeValuesFromNode(QDomElement* node) {
1346 CDataSomeValuesFromExpression* exp = nullptr;
1347 QList<CBuildExpression*> builds = parseChildNodes(node);
1348 if (mOntoBuilder) {
1349 exp = mOntoBuilder->getDataSomeValuesFrom(builds);
1350 }
1351 return exp;
1352 }
1353
1354 CDataLiteralExpression* COWL2QtXMLOntologyParser::parseDataLiteralNode(QDomElement* node) {
1355 CDataLiteralExpression* exp = nullptr;
1356 if (mOntoBuilder) {
1357 QDomNode chNode = node->firstChild();
1358 QString lexicalValueString = chNode.nodeValue();
1359 QString appendixString = node->attribute("lang");
1360 if (appendixString.isEmpty()) {
1361 appendixString = node->attribute("xml:lang");
1362 }
1363 if (!appendixString.isEmpty()) {
1364 lexicalValueString = lexicalValueString+"@"+appendixString;
1365 }
1366 CDataLexicalValueExpression* dataLexValueExp = mOntoBuilder->getDataLexicalValue(lexicalValueString);
1367 QString datatypeIRIString = node->attribute("datatypeIRI");
1368 if (datatypeIRIString.isEmpty()) {
1369 datatypeIRIString = node->attribute("owl:datatypeIRI");
1370 }
1371 CDatatypeExpression* datatypeExp = mOntoBuilder->getDatatype(datatypeIRIString);
1372 exp = mOntoBuilder->getDataLiteral(dataLexValueExp,datatypeExp);
1373 }
1374 return exp;
1375 }
1376
1377
1378 CDataFacetRestrictionExpression* COWL2QtXMLOntologyParser::parseDataFacetRestrictionNode(QDomElement* node) {
1379 CDataFacetRestrictionExpression* exp = nullptr;
1380 QList<CBuildExpression*> builds = parseChildNodes(node);
1381 if (mOntoBuilder) {
1382 QString facetIRIString = node->attribute("facet");
1383 if (facetIRIString.isEmpty()) {
1384 facetIRIString = node->attribute("owl:facet");
1385 }
1386 if (facetIRIString.isEmpty()) {
1387 facetIRIString = node->attribute("facetIRI");
1388 }
1389 if (facetIRIString.isEmpty()) {
1390 facetIRIString = node->attribute("owl:facetIRI");
1391 }
1392 CDataFacetExpression* facetExp = mOntoBuilder->getDataFacet(facetIRIString);
1393 builds.append(facetExp);
1394 exp = mOntoBuilder->getDataFacetRestriction(builds);
1395 }
1396 return exp;
1397 }
1398
1399
1400
1401 CDataAllValuesFromExpression* COWL2QtXMLOntologyParser::parseDataAllValuesFromNode(QDomElement* node) {
1402 CDataAllValuesFromExpression* exp = nullptr;
1403 QList<CBuildExpression*> builds = parseChildNodes(node);
1404 if (mOntoBuilder) {
1405 exp = mOntoBuilder->getDataAllValuesFrom(builds);
1406 }
1407 return exp;
1408 }
1409
1410 CDataHasValueExpression* COWL2QtXMLOntologyParser::parseDataHasValueNode(QDomElement* node) {
1411 CDataHasValueExpression* exp = nullptr;
1412 QList<CBuildExpression*> builds = parseChildNodes(node);
1413 if (mOntoBuilder) {
1414 exp = mOntoBuilder->getDataHasValue(builds);
1415 }
1416 return exp;
1417 }
1418
1419 CDataIntersectionOfExpression* COWL2QtXMLOntologyParser::parseDataIntersectionOfNode(QDomElement* node) {
1420 CDataIntersectionOfExpression* exp = nullptr;
1421 QList<CBuildExpression*> builds = parseChildNodes(node);
1422 if (mOntoBuilder) {
1423 exp = mOntoBuilder->getDataIntersectionOf(builds);
1424 }
1425 return exp;
1426 }
1427
1428 CDataOneOfExpression* COWL2QtXMLOntologyParser::parseDataOneOfNode(QDomElement* node) {
1429 CDataOneOfExpression* exp = nullptr;
1430 QList<CBuildExpression*> builds = parseChildNodes(node);
1431 if (mOntoBuilder) {
1432 exp = mOntoBuilder->getDataOneOf(builds);
1433 }
1434 return exp;
1435 }
1436
1437 CDataUnionOfExpression* COWL2QtXMLOntologyParser::parseDataUnionOfNode(QDomElement* node) {
1438 CDataUnionOfExpression* exp = nullptr;
1439 QList<CBuildExpression*> builds = parseChildNodes(node);
1440 if (mOntoBuilder) {
1441 exp = mOntoBuilder->getDataUnionOf(builds);
1442 }
1443 return exp;
1444 }
1445
1446 CDataComplementOfExpression* COWL2QtXMLOntologyParser::parseDataComplementOfNode(QDomElement* node) {
1447 CDataComplementOfExpression* exp = nullptr;
1448 QList<CBuildExpression*> builds = parseChildNodes(node);
1449 if (mOntoBuilder) {
1450 exp = mOntoBuilder->getDataComplementOf(builds);
1451 }
1452 return exp;
1453 }
1454
1455 CDatatypeRestrictionExpression* COWL2QtXMLOntologyParser::parseDatatypeRestrictionNode(QDomElement* node) {
1456 CDatatypeRestrictionExpression* exp = nullptr;
1457 QList<CBuildExpression*> builds = parseChildNodes(node);
1458 if (mOntoBuilder) {
1459 exp = mOntoBuilder->getDatatypeRestriction(builds);
1460 }
1461 return exp;
1462 }
1463
1464 CDataMaxCardinalityExpression* COWL2QtXMLOntologyParser::parseDataMaxCardinalityNode(QDomElement* node) {
1465 CDataMaxCardinalityExpression* exp = nullptr;
1466 cint64 cardinality = parseCardinality(node);
1467 QList<CBuildExpression*> builds = parseChildNodes(node);
1468 if (mOntoBuilder) {
1469 exp = mOntoBuilder->getDataMaxCardinality(builds,cardinality);
1470 }
1471 return exp;
1472 }
1473
1474 CDataMinCardinalityExpression* COWL2QtXMLOntologyParser::parseDataMinCardinalityNode(QDomElement* node) {
1475 CDataMinCardinalityExpression* exp = nullptr;
1476 cint64 cardinality = parseCardinality(node);
1477 QList<CBuildExpression*> builds = parseChildNodes(node);
1478 if (mOntoBuilder) {
1479 exp = mOntoBuilder->getDataMinCardinality(builds,cardinality);
1480 }
1481 return exp;
1482 }
1483
1484 CDataExactCardinalityExpression* COWL2QtXMLOntologyParser::parseDataExactCardinalityNode(QDomElement* node) {
1485 CDataExactCardinalityExpression* exp = nullptr;
1486 cint64 cardinality = parseCardinality(node);
1487 QList<CBuildExpression*> builds = parseChildNodes(node);
1488 if (mOntoBuilder) {
1489 exp = mOntoBuilder->getDataExactCardinality(builds,cardinality);
1490 }
1491 return exp;
1492 }
1493
1494 CDataPropertyAssertionExpression* COWL2QtXMLOntologyParser::parseDataPropertyAssertionNode(QDomElement* node) {
1495 CDataPropertyAssertionExpression* exp = nullptr;
1496 QList<CBuildExpression*> builds = parseChildNodes(node);
1497 if (mOntoBuilder) {
1498 exp = mOntoBuilder->getDataPropertyAssertion(builds);
1499 }
1500 return exp;
1501 }
1502
1503 CNegativeDataPropertyAssertionExpression* COWL2QtXMLOntologyParser::parseNegativeDataPropertyAssertionNode(QDomElement* node) {
1504 CNegativeDataPropertyAssertionExpression* exp = nullptr;
1505 QList<CBuildExpression*> builds = parseChildNodes(node);
1506 if (mOntoBuilder) {
1507 exp = mOntoBuilder->getNegativeDataPropertyAssertion(builds);
1508 }
1509 return exp;
1510 }
1511
1512 CSubDataPropertyOfExpression* COWL2QtXMLOntologyParser::parseSubDataPropertyOfNode(QDomElement* node) {
1513 CSubDataPropertyOfExpression* exp = nullptr;
1514 QList<CBuildExpression*> builds = parseChildNodes(node);
1515 if (mOntoBuilder) {
1516 exp = mOntoBuilder->getSubDataPropertyOf(builds);
1517 }
1518 return exp;
1519 }
1520
1521 CEquivalentDataPropertiesExpression* COWL2QtXMLOntologyParser::parseEquivalentDataPropertiesNode(QDomElement* node) {
1522 CEquivalentDataPropertiesExpression* exp = nullptr;
1523 QList<CBuildExpression*> builds = parseChildNodes(node);
1524 if (mOntoBuilder) {
1525 exp = mOntoBuilder->getEquivalentDataProperties(builds);
1526 }
1527 return exp;
1528 }
1529
1530 CDisjointDataPropertiesExpression* COWL2QtXMLOntologyParser::parseDisjointDataPropertiesNode(QDomElement* node) {
1531 CDisjointDataPropertiesExpression* exp = nullptr;
1532 QList<CBuildExpression*> builds = parseChildNodes(node);
1533 if (mOntoBuilder) {
1534 exp = mOntoBuilder->getDisjointDataProperties(builds);
1535 }
1536 return exp;
1537 }
1538
1539 CDataPropertyDomainExpression* COWL2QtXMLOntologyParser::parseDataPropertyDomainNode(QDomElement* node) {
1540 CDataPropertyDomainExpression* exp = nullptr;
1541 QList<CBuildExpression*> builds = parseChildNodes(node);
1542 if (mOntoBuilder) {
1543 exp = mOntoBuilder->getDataPropertyDomainExpression(builds);
1544 }
1545 return exp;
1546 }
1547
1548 CDataPropertyRangeExpression* COWL2QtXMLOntologyParser::parseDataPropertyRangeNode(QDomElement* node) {
1549 CDataPropertyRangeExpression* exp = nullptr;
1550 QList<CBuildExpression*> builds = parseChildNodes(node);
1551 if (mOntoBuilder) {
1552 exp = mOntoBuilder->getDataPropertyRangeExpression(builds);
1553 }
1554 return exp;
1555 }
1556
1557 CFunctionalDataPropertyExpression* COWL2QtXMLOntologyParser::parseFunctionalDataPropertyNode(QDomElement* node) {
1558 CFunctionalDataPropertyExpression* exp = nullptr;
1559 QList<CBuildExpression*> builds = parseChildNodes(node);
1560 if (mOntoBuilder) {
1561 exp = mOntoBuilder->getFunctionalDataProperty(builds);
1562 }
1563 return exp;
1564 }
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDatatypeNode(QDomElement* node) {
1585 return parseDatatypeNode(node);
1586 }
1587
1588 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyNode(QDomElement* node) {
1589 return parseDataPropertyNode(node);
1590 }
1591
1592 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataSomeValuesFromNode(QDomElement* node) {
1593 return parseDataSomeValuesFromNode(node);
1594 }
1595
1596 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataLiteralNode(QDomElement* node) {
1597 return parseDataLiteralNode(node);
1598 }
1599
1600
1601
1602
1603
1604
1605 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataAllValuesFromNode(QDomElement* node) {
1606 return parseDataAllValuesFromNode(node);
1607 }
1608
1609 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataHasValueNode(QDomElement* node) {
1610 return parseDataHasValueNode(node);
1611 }
1612
1613 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataIntersectionOfNode(QDomElement* node) {
1614 return parseDataIntersectionOfNode(node);
1615 }
1616
1617 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataOneOfNode(QDomElement* node) {
1618 return parseDataOneOfNode(node);
1619 }
1620
1621 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataUnionOfNode(QDomElement* node) {
1622 return parseDataUnionOfNode(node);
1623 }
1624
1625 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataComplementOfNode(QDomElement* node) {
1626 return parseDataComplementOfNode(node);
1627 }
1628
1629 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDatatypeRestrictionNode(QDomElement* node) {
1630 return parseDatatypeRestrictionNode(node);
1631 }
1632
1633 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataMaxCardinalityNode(QDomElement* node) {
1634 return parseDataMaxCardinalityNode(node);
1635 }
1636
1637 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataMinCardinalityNode(QDomElement* node) {
1638 return parseDataMinCardinalityNode(node);
1639 }
1640
1641 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataExactCardinalityNode(QDomElement* node) {
1642 return parseDataExactCardinalityNode(node);
1643 }
1644
1645 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyAssertionNode(QDomElement* node) {
1646 return parseDataPropertyAssertionNode(node);
1647 }
1648
1649 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseNegativeDataPropertyAssertionNode(QDomElement* node) {
1650 return parseNegativeDataPropertyAssertionNode(node);
1651 }
1652
1653 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseSubDataPropertyOfNode(QDomElement* node) {
1654 return parseSubDataPropertyOfNode(node);
1655 }
1656
1657 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentDataPropertiesNode(QDomElement* node) {
1658 return parseEquivalentDataPropertiesNode(node);
1659 }
1660
1661 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDisjointDataPropertiesNode(QDomElement* node) {
1662 return parseDisjointDataPropertiesNode(node);
1663 }
1664
1665 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyDomainNode(QDomElement* node) {
1666 return parseDataPropertyDomainNode(node);
1667 }
1668
1669 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataPropertyRangeNode(QDomElement* node) {
1670 return parseDataPropertyRangeNode(node);
1671 }
1672
1673 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseFunctionalDataPropertyNode(QDomElement* node) {
1674 return parseFunctionalDataPropertyNode(node);
1675 }
1676
1677 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDataFacetRestrictionNode(QDomElement* node) {
1678 return parseDataFacetRestrictionNode(node);
1679 }
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionOntologyNode(QDomElement* node) {
1690 parseOntologyNode(node);
1691 return nullptr;
1692 }
1693
1694
1695 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionTellOntologyAxiomNode(QDomElement* node) {
1696 parseTellOntologyAxiomNode(node);
1697 return nullptr;
1698 }
1699
1700 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionRetractOntologyAxiomNode(QDomElement* node) {
1701 parseRetractOntologyAxiomNode(node);
1702 return nullptr;
1703 }
1704
1705 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParsePrefixNode(QDomElement* node) {
1706 parsePrefixNode(node);
1707 return nullptr;
1708 }
1709
1710
1711 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseClassNode(QDomElement* node) {
1712 return parseClassNode(node);
1713 }
1714
1715 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyNode(QDomElement* node) {
1716 return parseObjectPropertyNode(node);
1717 }
1718
1719
1720 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseIndividualVariable(QDomElement* node) {
1721 return parseIndividualVariableNode(node);
1722 }
1723
1724
1725 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDeclarationNode(QDomElement* node) {
1726 return parseDeclarationNode(node);
1727 }
1728
1729
1730 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentClassesNode(QDomElement* node) {
1731 return parseEquivalentClassesNode(node);
1732 }
1733
1734 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseSubClassOfNode(QDomElement* node) {
1735 return parseSubClassOfNode(node);
1736 }
1737
1738 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDisjontClassesNode(QDomElement* node) {
1739 return parseDisjontClassesNode(node);
1740 }
1741
1742 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDisjontUnionNode(QDomElement* node) {
1743 return parseDisjontUnionNode(node);
1744 }
1745
1746
1747 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseSubObjectPropertyOfNode(QDomElement* node) {
1748 return parseSubObjectPropertyOfNode(node);
1749 }
1750
1751 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyChainNode(QDomElement* node) {
1752 return parseObjectPropertyChainNode(node);
1753 }
1754
1755 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseEquivalentObjectPropertiesNode(QDomElement* node) {
1756 return parseEquivalentObjectPropertiesNode(node);
1757 }
1758
1759 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDisjointObjectPropertiesNode(QDomElement* node) {
1760 return parseDisjointObjectPropertiesNode(node);
1761 }
1762
1763
1764 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectIntersectionOfNode(QDomElement* node) {
1765 return parseObjectIntersectionOfNode(node);
1766 }
1767
1768 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectUnionOfNode(QDomElement* node) {
1769 return parseObjectUnionOfNode(node);
1770 }
1771
1772 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectMaxCardinalityNode(QDomElement* node) {
1773 return parseObjectMaxCardinalityNode(node);
1774 }
1775
1776 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectMinCardinalityNode(QDomElement* node) {
1777 return parseObjectMinCardinalityNode(node);
1778 }
1779
1780 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectExactlyCardinalityNode(QDomElement* node) {
1781 return parseObjectExactlyCardinalityNode(node);
1782 }
1783
1784 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectSomeValuesFromNode(QDomElement* node) {
1785 return parseObjectSomeValuesFromNode(node);
1786 }
1787
1788 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectAllValuesFromNode(QDomElement* node) {
1789 return parseObjectAllValuesFromNode(node);
1790 }
1791
1792 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectComplementOfNode(QDomElement* node) {
1793 return parseObjectComplementOfNode(node);
1794 }
1795
1796 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectOneOfNode(QDomElement* node) {
1797 return parseObjectOneOfNode(node);
1798 }
1799
1800 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectHasValueNode(QDomElement* node) {
1801 return parseObjectHasValueNode(node);
1802 }
1803
1804 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectHasSelfNode(QDomElement* node) {
1805 return parseObjectHasSelfNode(node);
1806 }
1807
1808
1809 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseClassAssertionNode(QDomElement* node) {
1810 return parseClassAssertionNode(node);
1811 }
1812
1813 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseNamedIndividualNode(QDomElement* node) {
1814 return parseNamedIndividualNode(node);
1815 }
1816
1817 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseAnonymousIndividualNode(QDomElement* node) {
1818 return parseAnonymousIndividualNode(node);
1819 }
1820
1821 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyAssertionNode(QDomElement* node) {
1822 return parseObjectPropertyAssertionNode(node);
1823 }
1824
1825 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseNegativeObjectPropertyAssertionNode(QDomElement* node) {
1826 return parseNegativeObjectPropertyAssertionNode(node);
1827 }
1828
1829 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseSameIndividualNode(QDomElement* node) {
1830 return parseSameIndividualNode(node);
1831 }
1832
1833 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseDifferentIndividualsNode(QDomElement* node) {
1834 return parseDifferentIndividualsNode(node);
1835 }
1836
1837
1838 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyDomainNode(QDomElement* node) {
1839 return parseObjectPropertyDomainNode(node);
1840 }
1841
1842 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseObjectPropertyRangeNode(QDomElement* node) {
1843 return parseObjectPropertyRangeNode(node);
1844 }
1845
1846 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseInverseObjectPropertyOfNode(QDomElement* node) {
1847 return parseInverseObjectPropertyOfNode(node);
1848 }
1849
1850 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseInverseObjectPropertiesNode(QDomElement* node) {
1851 return parseInverseObjectPropertiesNode(node);
1852 }
1853
1854 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseTransetiveObjectPropertyNode(QDomElement* node) {
1855 return parseTransetiveObjectPropertyNode(node);
1856 }
1857
1858 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseFunctionalObjectPropertyNode(QDomElement* node) {
1859 return parseFunctionalObjectPropertyNode(node);
1860 }
1861
1862 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseSymmetricObjectPropertyNode(QDomElement* node) {
1863 return parseSymmetricObjectPropertyNode(node);
1864 }
1865
1866 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseAsymmetricObjectPropertyNode(QDomElement* node) {
1867 return parseAsymmetricObjectPropertyNode(node);
1868 }
1869
1870 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseReflexiveObjectPropertyNode(QDomElement* node) {
1871 return parseReflexiveObjectPropertyNode(node);
1872 }
1873
1874 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseIrreflexiveObjectPropertyNode(QDomElement* node) {
1875 return parseIrreflexiveObjectPropertyNode(node);
1876 }
1877
1878 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseInverseFunctionalObjectPropertyNode(QDomElement* node) {
1879 return parseInverseFunctionalObjectPropertyNode(node);
1880 }
1881
1882 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseIgnoredNode(QDomElement* node) {
1883 return nullptr;
1884 }
1885
1886
1887 CBuildExpression* COWL2QtXMLOntologyParser::jumpFunctionParseImportNode(QDomElement* node) {
1888 QString importIRIString = node->text();
1889 if (!importIRIString.isEmpty()) {
1890 mOntoBuilder->addOntologyImport(importIRIString);
1891 }
1892 return nullptr;
1893 }
1894
1895
1896 }; // end namespace Parser
1897
1898 }; // end namespace Konclude