| 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 "CConcreteOntologyBuildDataUpdater.h" |
| 22 |
|
| 23 |
|
| 24 |
namespace Konclude { |
| 25 |
|
| 26 |
namespace Reasoner { |
| 27 |
|
| 28 |
namespace Generator { |
| 29 |
|
| 30 |
CConcreteOntologyBuildDataUpdater::CConcreteOntologyBuildDataUpdater(CConcreteOntology* updateConcreteOntology) { |
| 31 |
mOnto = updateConcreteOntology; |
| 32 |
} |
| 33 |
|
| 34 |
|
| 35 |
|
| 36 |
CDeclarationAxiomExpression* CConcreteOntologyBuildDataUpdater::getDeclaration(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 37 |
FOREACHIT (CBuildExpression* buildExpression, expressions) { |
| 38 |
CClassExpression* classExpr = dynamic_cast<CClassExpression*>(buildExpression); |
| 39 |
if (classExpr) { |
| 40 |
return getDeclaration((CExpressionEntity*)classExpr); |
| 41 |
} |
| 42 |
CObjectPropertyExpression* propertyExp = dynamic_cast<CObjectPropertyExpression*>(buildExpression); |
| 43 |
if (propertyExp) { |
| 44 |
return getDeclaration((CExpressionEntity*)propertyExp); |
| 45 |
} |
| 46 |
CNamedIndividualExpression* indiExp = dynamic_cast<CNamedIndividualExpression*>(buildExpression); |
| 47 |
if (indiExp) { |
| 48 |
return getDeclaration((CExpressionEntity*)indiExp); |
| 49 |
} |
| 50 |
CDataPropertyExpression* dataPropExp = dynamic_cast<CDataPropertyExpression*>(buildExpression); |
| 51 |
if (dataPropExp) { |
| 52 |
return getDeclaration((CExpressionEntity*)dataPropExp); |
| 53 |
} |
| 54 |
CDatatypeExpression* datatypeExp = dynamic_cast<CDatatypeExpression*>(buildExpression); |
| 55 |
if (datatypeExp) { |
| 56 |
return getDeclaration((CExpressionEntity*)datatypeExp); |
| 57 |
} |
| 58 |
} |
| 59 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'Declaration'-Expression."),this); |
| 60 |
return nullptr; |
| 61 |
} |
| 62 |
|
| 63 |
|
| 64 |
CDeclarationAxiomExpression* CConcreteOntologyBuildDataUpdater::getDeclaration(CBuildExpression* buildExpression) { |
| 65 |
if (buildExpression) { |
| 66 |
CClassExpression* classExpr = dynamic_cast<CClassExpression*>(buildExpression); |
| 67 |
if (classExpr) { |
| 68 |
return getDeclaration((CExpressionEntity*)classExpr); |
| 69 |
} |
| 70 |
CObjectPropertyExpression* propertyExp = dynamic_cast<CObjectPropertyExpression*>(buildExpression); |
| 71 |
if (propertyExp) { |
| 72 |
return getDeclaration((CExpressionEntity*)propertyExp); |
| 73 |
} |
| 74 |
CNamedIndividualExpression* indiExp = dynamic_cast<CNamedIndividualExpression*>(buildExpression); |
| 75 |
if (indiExp) { |
| 76 |
return getDeclaration((CExpressionEntity*)indiExp); |
| 77 |
} |
| 78 |
CDataPropertyExpression* dataPropExp = dynamic_cast<CDataPropertyExpression*>(buildExpression); |
| 79 |
if (dataPropExp) { |
| 80 |
return getDeclaration((CExpressionEntity*)dataPropExp); |
| 81 |
} |
| 82 |
CDatatypeExpression* datatypeExp = dynamic_cast<CDatatypeExpression*>(buildExpression); |
| 83 |
if (datatypeExp) { |
| 84 |
return getDeclaration((CExpressionEntity*)datatypeExp); |
| 85 |
} |
| 86 |
} |
| 87 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'Declaration'-Expression."),this); |
| 88 |
return nullptr; |
| 89 |
} |
| 90 |
|
| 91 |
|
| 92 |
CEquivalentClassesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentClasses(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 93 |
CEquivalentClassesExpression* expression = nullptr; |
| 94 |
CExpressionSplitter expSplitter(expressions); |
| 95 |
if (expSplitter.testForExpressionComposition(2)) { |
| 96 |
expression = getEquivalentClasses(*expSplitter.getClassTermExpressionList()); |
| 97 |
} else { |
| 98 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'EquivalentClasses'-Expression."),this); |
| 99 |
} |
| 100 |
return expression; |
| 101 |
} |
| 102 |
|
| 103 |
CEquivalentClassesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentClasses(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 104 |
CEquivalentClassesExpression* expression = nullptr; |
| 105 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 106 |
if (expSplitter.testForExpressionComposition(2)) { |
| 107 |
expression = getEquivalentClasses(*expSplitter.getClassTermExpressionList()); |
| 108 |
} else { |
| 109 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'EquivalentClasses'-Expression."),this); |
| 110 |
} |
| 111 |
return expression; |
| 112 |
} |
| 113 |
|
| 114 |
CSubClassOfExpression* CConcreteOntologyBuildDataUpdater::getSubClassOf(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 115 |
CSubClassOfExpression* expression = nullptr; |
| 116 |
CExpressionSplitter expSplitter(expressions); |
| 117 |
if (expSplitter.testForExpressionComposition(2)) { |
| 118 |
expression = getSubClassOf(expSplitter.getFirstClassTermExpression(),expSplitter.getSecondClassTermExpression()); |
| 119 |
} else { |
| 120 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SubClassOf'-Expression."),this); |
| 121 |
} |
| 122 |
return expression; |
| 123 |
} |
| 124 |
|
| 125 |
CSubClassOfExpression* CConcreteOntologyBuildDataUpdater::getSubClassOf(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 126 |
CSubClassOfExpression* expression = nullptr; |
| 127 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 128 |
if (expSplitter.testForExpressionComposition(2)) { |
| 129 |
expression = getSubClassOf(expSplitter.getFirstClassTermExpression(),expSplitter.getSecondClassTermExpression()); |
| 130 |
} else { |
| 131 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SubClassOf'-Expression."),this); |
| 132 |
} |
| 133 |
return expression; |
| 134 |
} |
| 135 |
|
| 136 |
|
| 137 |
CDisjointClassesExpression* CConcreteOntologyBuildDataUpdater::getDisjointClasses(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 138 |
CDisjointClassesExpression* expression = nullptr; |
| 139 |
CExpressionSplitter expSplitter(expressions); |
| 140 |
if (expSplitter.testForExpressionComposition(2)) { |
| 141 |
expression = getDisjointClasses(*expSplitter.getClassTermExpressionList()); |
| 142 |
} else { |
| 143 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DisjointClasses'-Expression."),this); |
| 144 |
} |
| 145 |
return expression; |
| 146 |
} |
| 147 |
|
| 148 |
CDisjointUnionExpression* CConcreteOntologyBuildDataUpdater::getDisjointUnion(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 149 |
CDisjointUnionExpression* expression = nullptr; |
| 150 |
CExpressionSplitter expSplitter(expressions); |
| 151 |
if (expSplitter.testForExpressionComposition(2)) { |
| 152 |
CEXPRESSIONLIST<CClassTermExpression*>* classTermExpressionList = expSplitter.getClassTermExpressionList(); |
| 153 |
CClassExpression* classExpression = nullptr; |
| 154 |
cint64 pos = -1; |
| 155 |
FOREACHIT (CClassTermExpression* classTermExp, *classTermExpressionList) { |
| 156 |
++pos; |
| 157 |
if (dynamic_cast<CClassExpression*>(classTermExp)) { |
| 158 |
classExpression = (CClassExpression*)classTermExp; |
| 159 |
break; |
| 160 |
} |
| 161 |
} |
| 162 |
if (classExpression) { |
| 163 |
classTermExpressionList->removeAt(pos); |
| 164 |
} else { |
| 165 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't resolve ClassExpression for 'DisjointUnion'-Expression."),this); |
| 166 |
} |
| 167 |
expression = getDisjointUnion(classExpression,*classTermExpressionList); |
| 168 |
} else { |
| 169 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DisjointUnion'-Expression."),this); |
| 170 |
} |
| 171 |
return expression; |
| 172 |
} |
| 173 |
|
| 174 |
CObjectComplementOfExpression* CConcreteOntologyBuildDataUpdater::getObjectComplementOf(CBuildExpression* compExpression) { |
| 175 |
CObjectComplementOfExpression* expression = nullptr; |
| 176 |
CExpressionSplitter expSplitter(compExpression); |
| 177 |
if (expSplitter.testForExpressionComposition(1)) { |
| 178 |
expression = getObjectComplementOf(expSplitter.getFirstClassTermExpression()); |
| 179 |
} else { |
| 180 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectComplementOf'-Expression."),this); |
| 181 |
} |
| 182 |
return expression; |
| 183 |
} |
| 184 |
|
| 185 |
CObjectComplementOfExpression* CConcreteOntologyBuildDataUpdater::getObjectComplementOf(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 186 |
CObjectComplementOfExpression* expression = nullptr; |
| 187 |
CExpressionSplitter expSplitter(expressions); |
| 188 |
if (expSplitter.testForExpressionComposition(1)) { |
| 189 |
expression = getObjectComplementOf(expSplitter.getFirstClassTermExpression()); |
| 190 |
} else { |
| 191 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectComplementOf'-Expression."),this); |
| 192 |
} |
| 193 |
return expression; |
| 194 |
} |
| 195 |
|
| 196 |
CObjectIntersectionOfExpression* CConcreteOntologyBuildDataUpdater::getObjectIntersectionOf(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 197 |
CObjectIntersectionOfExpression* expression = nullptr; |
| 198 |
CExpressionSplitter expSplitter(expressions); |
| 199 |
if (expSplitter.testForExpressionComposition(0)) { |
| 200 |
expression = getObjectIntersectionOf(*expSplitter.getClassTermExpressionList()); |
| 201 |
} else { |
| 202 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectIntersectionOf'-Expression."),this); |
| 203 |
} |
| 204 |
return expression; |
| 205 |
} |
| 206 |
|
| 207 |
CObjectUnionOfExpression* CConcreteOntologyBuildDataUpdater::getObjectUnionOf(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 208 |
CObjectUnionOfExpression* expression = nullptr; |
| 209 |
CExpressionSplitter expSplitter(expressions); |
| 210 |
if (expSplitter.testForExpressionComposition(0)) { |
| 211 |
expression = getObjectUnionOf(*expSplitter.getClassTermExpressionList()); |
| 212 |
} else { |
| 213 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectUnionOf'-Expression."),this); |
| 214 |
} |
| 215 |
return expression; |
| 216 |
} |
| 217 |
|
| 218 |
CObjectMaxCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectMaxCardinality(const CEXPRESSIONLIST<CBuildExpression*>& expressions, int cardinality) { |
| 219 |
CObjectMaxCardinalityExpression* expression = nullptr; |
| 220 |
CExpressionSplitter expSplitter(expressions); |
| 221 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 222 |
expression = getObjectMaxCardinality(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression(),cardinality); |
| 223 |
} else { |
| 224 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectMaxCardinality'-Expression."),this); |
| 225 |
} |
| 226 |
return expression; |
| 227 |
} |
| 228 |
|
| 229 |
CObjectMaxCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectMaxCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { |
| 230 |
CObjectMaxCardinalityExpression* expression = nullptr; |
| 231 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 232 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 233 |
expression = getObjectMaxCardinality(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression(),cardinality); |
| 234 |
} else { |
| 235 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectMaxCardinality'-Expression."),this); |
| 236 |
} |
| 237 |
return expression; |
| 238 |
} |
| 239 |
|
| 240 |
CObjectMinCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectMinCardinality(const CEXPRESSIONLIST<CBuildExpression*>& expressions, int cardinality) { |
| 241 |
CObjectMinCardinalityExpression* expression = nullptr; |
| 242 |
CExpressionSplitter expSplitter(expressions); |
| 243 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 244 |
expression = getObjectMinCardinality(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression(),cardinality); |
| 245 |
} else { |
| 246 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectMinCardinality'-Expression."),this); |
| 247 |
} |
| 248 |
return expression; |
| 249 |
} |
| 250 |
|
| 251 |
CObjectMinCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectMinCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { |
| 252 |
CObjectMinCardinalityExpression* expression = nullptr; |
| 253 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 254 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 255 |
expression = getObjectMinCardinality(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression(),cardinality); |
| 256 |
} else { |
| 257 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectMinCardinality'-Expression."),this); |
| 258 |
} |
| 259 |
return expression; |
| 260 |
} |
| 261 |
|
| 262 |
CObjectExactlyCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectExactlyCardinality(const CEXPRESSIONLIST<CBuildExpression*>& expressions, int cardinality) { |
| 263 |
CObjectExactlyCardinalityExpression* expression = nullptr; |
| 264 |
CExpressionSplitter expSplitter(expressions); |
| 265 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 266 |
expression = getObjectExactlyCardinality(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression(),cardinality); |
| 267 |
} else { |
| 268 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectExactCardinality'-Expression."),this); |
| 269 |
} |
| 270 |
return expression; |
| 271 |
} |
| 272 |
|
| 273 |
CObjectExactlyCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectExactlyCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { |
| 274 |
CObjectExactlyCardinalityExpression* expression = nullptr; |
| 275 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 276 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 277 |
expression = getObjectExactlyCardinality(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression(),cardinality); |
| 278 |
} else { |
| 279 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectExactCardinality'-Expression."),this); |
| 280 |
} |
| 281 |
return expression; |
| 282 |
} |
| 283 |
|
| 284 |
CObjectAllValuesFromExpression* CConcreteOntologyBuildDataUpdater::getObjectAllValuesFrom(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 285 |
CObjectAllValuesFromExpression* expression = nullptr; |
| 286 |
CExpressionSplitter expSplitter(expressions); |
| 287 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 288 |
expression = getObjectAllValuesFrom(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression()); |
| 289 |
} else { |
| 290 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectAllValuesFrom'-Expression."),this); |
| 291 |
} |
| 292 |
return expression; |
| 293 |
} |
| 294 |
|
| 295 |
CObjectAllValuesFromExpression* CConcreteOntologyBuildDataUpdater::getObjectAllValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 296 |
CObjectAllValuesFromExpression* expression = nullptr; |
| 297 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 298 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 299 |
expression = getObjectAllValuesFrom(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression()); |
| 300 |
} else { |
| 301 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectAllValuesFrom'-Expression."),this); |
| 302 |
} |
| 303 |
return expression; |
| 304 |
} |
| 305 |
|
| 306 |
CObjectSomeValuesFromExpression* CConcreteOntologyBuildDataUpdater::getObjectSomeValuesFrom(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 307 |
CObjectSomeValuesFromExpression* expression = nullptr; |
| 308 |
CExpressionSplitter expSplitter(expressions); |
| 309 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 310 |
expression = getObjectSomeValuesFrom(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression()); |
| 311 |
} else { |
| 312 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectSomeValuesFrom'-Expression."),this); |
| 313 |
} |
| 314 |
return expression; |
| 315 |
} |
| 316 |
|
| 317 |
CObjectSomeValuesFromExpression* CConcreteOntologyBuildDataUpdater::getObjectSomeValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 318 |
CObjectSomeValuesFromExpression* expression = nullptr; |
| 319 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 320 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 321 |
expression = getObjectSomeValuesFrom(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstOptionalClassTermExpression()); |
| 322 |
} else { |
| 323 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectSomeValuesFrom'-Expression."),this); |
| 324 |
} |
| 325 |
return expression; |
| 326 |
} |
| 327 |
|
| 328 |
|
| 329 |
CDataFacetRestrictionExpression* CConcreteOntologyBuildDataUpdater::getDataFacetRestriction(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 330 |
CDataFacetRestrictionExpression* expression = nullptr; |
| 331 |
CExpressionSplitter expSplitter(expressions); |
| 332 |
if (expSplitter.testForExpressionComposition(0,0,0,0,0,1,0,0,1)) { |
| 333 |
CDataLiteralExpression* dataLitExp = dynamic_cast<CDataLiteralExpression*>(expSplitter.getFirstDataLiteralTermExpression()); |
| 334 |
if (dataLitExp) { |
| 335 |
expression = getDataFacetRestriction(dataLitExp, expSplitter.getFirstDataFacetExpression()); |
| 336 |
} |
| 337 |
} else { |
| 338 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'FacetRestriction'-Expression."),this); |
| 339 |
} |
| 340 |
return expression; |
| 341 |
} |
| 342 |
|
| 343 |
CDataFacetRestrictionExpression* CConcreteOntologyBuildDataUpdater::getDataFacetRestriction(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 344 |
CDataFacetRestrictionExpression* expression = nullptr; |
| 345 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 346 |
if (expSplitter.testForExpressionComposition(0,0,0,0,0,1,0,0,1)) { |
| 347 |
CDataLiteralExpression* dataLitExp = dynamic_cast<CDataLiteralExpression*>(expSplitter.getFirstDataLiteralTermExpression()); |
| 348 |
if (dataLitExp) { |
| 349 |
expression = getDataFacetRestriction(dataLitExp, expSplitter.getFirstDataFacetExpression()); |
| 350 |
} |
| 351 |
} else { |
| 352 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'FacetRestriction'-Expression."),this); |
| 353 |
} |
| 354 |
return expression; |
| 355 |
} |
| 356 |
|
| 357 |
CDataSomeValuesFromExpression* CConcreteOntologyBuildDataUpdater::getDataSomeValuesFrom(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 358 |
CDataSomeValuesFromExpression* expression = nullptr; |
| 359 |
CExpressionSplitter expSplitter(expressions); |
| 360 |
if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { |
| 361 |
expression = getDataSomeValuesFrom(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression()); |
| 362 |
} else { |
| 363 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataSomeValuesFrom'-Expression."),this); |
| 364 |
} |
| 365 |
return expression; |
| 366 |
} |
| 367 |
|
| 368 |
CDataSomeValuesFromExpression* CConcreteOntologyBuildDataUpdater::getDataSomeValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 369 |
CDataSomeValuesFromExpression* expression = nullptr; |
| 370 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 371 |
if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { |
| 372 |
expression = getDataSomeValuesFrom(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression()); |
| 373 |
} else { |
| 374 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataSomeValuesFrom'-Expression."),this); |
| 375 |
} |
| 376 |
return expression; |
| 377 |
} |
| 378 |
|
| 379 |
|
| 380 |
CDataLiteralExpression* CConcreteOntologyBuildDataUpdater::getDataLiteral(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 381 |
CDataLiteralExpression* expression = nullptr; |
| 382 |
if (expressions.size() >= 2) { |
| 383 |
expression = getDataLiteral(expressions.first(), expressions.last()); |
| 384 |
} else { |
| 385 |
LOG(ERROR, "::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder", logTr("Couldn't match parameters for 'DataLiteral'-Expression."), this); |
| 386 |
} |
| 387 |
return expression; |
| 388 |
} |
| 389 |
|
| 390 |
|
| 391 |
CDataLiteralExpression* CConcreteOntologyBuildDataUpdater::getDataLiteral(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 392 |
CDataLiteralExpression* expression = nullptr; |
| 393 |
|
| 394 |
CDataLexicalValueExpression* dataLexicalValue = dynamic_cast<CDataLexicalValueExpression*>(expression1); |
| 395 |
CDatatypeExpression* datatype = dynamic_cast<CDatatypeExpression*>(expression2); |
| 396 |
if (!dataLexicalValue) { |
| 397 |
dataLexicalValue = dynamic_cast<CDataLexicalValueExpression*>(expression2); |
| 398 |
datatype = dynamic_cast<CDatatypeExpression*>(expression1); |
| 399 |
} |
| 400 |
|
| 401 |
if (dataLexicalValue && datatype) { |
| 402 |
expression = getDataLiteral(dataLexicalValue, datatype); |
| 403 |
} else { |
| 404 |
LOG(ERROR, "::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder", logTr("Couldn't match parameters for 'DataLiteral'-Expression."), this); |
| 405 |
} |
| 406 |
return expression; |
| 407 |
} |
| 408 |
|
| 409 |
|
| 410 |
|
| 411 |
|
| 412 |
CDataHasValueExpression* CConcreteOntologyBuildDataUpdater::getDataHasValue(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 413 |
CDataHasValueExpression* expression = nullptr; |
| 414 |
CExpressionSplitter expSplitter(expressions); |
| 415 |
if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { |
| 416 |
expression = getDataHasValue(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression()); |
| 417 |
} else { |
| 418 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataHasValue'-Expression."),this); |
| 419 |
} |
| 420 |
return expression; |
| 421 |
} |
| 422 |
|
| 423 |
CDataHasValueExpression* CConcreteOntologyBuildDataUpdater::getDataHasValue(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 424 |
CDataHasValueExpression* expression = nullptr; |
| 425 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 426 |
if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { |
| 427 |
expression = getDataHasValue(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression()); |
| 428 |
} else { |
| 429 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataHasValue'-Expression."),this); |
| 430 |
} |
| 431 |
return expression; |
| 432 |
} |
| 433 |
|
| 434 |
|
| 435 |
|
| 436 |
|
| 437 |
CDataAllValuesFromExpression* CConcreteOntologyBuildDataUpdater::getDataAllValuesFrom(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 438 |
CDataAllValuesFromExpression* expression = nullptr; |
| 439 |
CExpressionSplitter expSplitter(expressions); |
| 440 |
if (expSplitter.testForExpressionComposition(0,0,0,1,1)) { |
| 441 |
expression = getDataAllValuesFrom(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression()); |
| 442 |
} else { |
| 443 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataAllValuesFrom'-Expression."),this); |
| 444 |
} |
| 445 |
return expression; |
| 446 |
} |
| 447 |
|
| 448 |
CDataAllValuesFromExpression* CConcreteOntologyBuildDataUpdater::getDataAllValuesFrom(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 449 |
CDataAllValuesFromExpression* expression = nullptr; |
| 450 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 451 |
if (expSplitter.testForExpressionComposition(0,0,0,1,1)) { |
| 452 |
expression = getDataAllValuesFrom(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression()); |
| 453 |
} else { |
| 454 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataAllValuesFrom'-Expression."),this); |
| 455 |
} |
| 456 |
return expression; |
| 457 |
} |
| 458 |
|
| 459 |
|
| 460 |
|
| 461 |
|
| 462 |
|
| 463 |
CDataIntersectionOfExpression* CConcreteOntologyBuildDataUpdater::getDataIntersectionOf(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 464 |
CDataIntersectionOfExpression* expression = nullptr; |
| 465 |
CExpressionSplitter expSplitter(expressions); |
| 466 |
if (expSplitter.testForExpressionComposition(0,0,0,1)) { |
| 467 |
expression = getDataIntersectionOf(*expSplitter.getDataRangeTermExpressionList()); |
| 468 |
} else { |
| 469 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataIntersectionOf'-Expression."),this); |
| 470 |
} |
| 471 |
return expression; |
| 472 |
} |
| 473 |
|
| 474 |
CDataIntersectionOfExpression* CConcreteOntologyBuildDataUpdater::getDataIntersectionOf(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 475 |
CDataIntersectionOfExpression* expression = nullptr; |
| 476 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 477 |
if (expSplitter.testForExpressionComposition(0,0,0,1)) { |
| 478 |
expression = getDataIntersectionOf(*expSplitter.getDataRangeTermExpressionList()); |
| 479 |
} else { |
| 480 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataIntersectionOf'-Expression."),this); |
| 481 |
} |
| 482 |
return expression; |
| 483 |
} |
| 484 |
|
| 485 |
|
| 486 |
|
| 487 |
|
| 488 |
|
| 489 |
CDataOneOfExpression* CConcreteOntologyBuildDataUpdater::getDataOneOf(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 490 |
CDataOneOfExpression* expression = nullptr; |
| 491 |
CExpressionSplitter expSplitter(expressions); |
| 492 |
if (expSplitter.testForExpressionComposition(0,0,0,1)) { |
| 493 |
expression = getDataOneOf(*expSplitter.getDataRangeTermExpressionList()); |
| 494 |
} else { |
| 495 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataOneOf'-Expression."),this); |
| 496 |
} |
| 497 |
return expression; |
| 498 |
} |
| 499 |
|
| 500 |
CDataOneOfExpression* CConcreteOntologyBuildDataUpdater::getDataOneOf(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 501 |
CDataOneOfExpression* expression = nullptr; |
| 502 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 503 |
if (expSplitter.testForExpressionComposition(0,0,0,1)) { |
| 504 |
expression = getDataOneOf(*expSplitter.getDataRangeTermExpressionList()); |
| 505 |
} else { |
| 506 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataOneOf'-Expression."),this); |
| 507 |
} |
| 508 |
return expression; |
| 509 |
} |
| 510 |
|
| 511 |
|
| 512 |
|
| 513 |
|
| 514 |
|
| 515 |
CDataUnionOfExpression* CConcreteOntologyBuildDataUpdater::getDataUnionOf(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 516 |
CDataUnionOfExpression* expression = nullptr; |
| 517 |
CExpressionSplitter expSplitter(expressions); |
| 518 |
if (expSplitter.testForExpressionComposition(0,0,0,1)) { |
| 519 |
expression = getDataUnionOf(*expSplitter.getDataRangeTermExpressionList()); |
| 520 |
} else { |
| 521 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataUnionOf'-Expression."),this); |
| 522 |
} |
| 523 |
return expression; |
| 524 |
} |
| 525 |
|
| 526 |
CDataUnionOfExpression* CConcreteOntologyBuildDataUpdater::getDataUnionOf(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 527 |
CDataUnionOfExpression* expression = nullptr; |
| 528 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 529 |
if (expSplitter.testForExpressionComposition(0,0,0,1)) { |
| 530 |
expression = getDataUnionOf(*expSplitter.getDataRangeTermExpressionList()); |
| 531 |
} else { |
| 532 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataUnionOf'-Expression."),this); |
| 533 |
} |
| 534 |
return expression; |
| 535 |
} |
| 536 |
|
| 537 |
|
| 538 |
|
| 539 |
|
| 540 |
|
| 541 |
CDataComplementOfExpression* CConcreteOntologyBuildDataUpdater::getDataComplementOf(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 542 |
CDataComplementOfExpression* expression = nullptr; |
| 543 |
CExpressionSplitter expSplitter(expressions); |
| 544 |
if (expSplitter.testForExpressionComposition(0,0,0,1)) { |
| 545 |
expression = getDataComplementOf(expSplitter.getFirstDataRangeTermExpression()); |
| 546 |
} else { |
| 547 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataComplementOf'-Expression."),this); |
| 548 |
} |
| 549 |
return expression; |
| 550 |
} |
| 551 |
|
| 552 |
CDataComplementOfExpression* CConcreteOntologyBuildDataUpdater::getDataComplementOf(CBuildExpression* expression1) { |
| 553 |
CDataComplementOfExpression* expression = nullptr; |
| 554 |
CExpressionSplitter expSplitter(expression1); |
| 555 |
if (expSplitter.testForExpressionComposition(0,0,0,1)) { |
| 556 |
expression = getDataComplementOf(expSplitter.getFirstDataRangeTermExpression()); |
| 557 |
} else { |
| 558 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataComplementOf'-Expression."),this); |
| 559 |
} |
| 560 |
return expression; |
| 561 |
} |
| 562 |
|
| 563 |
|
| 564 |
|
| 565 |
|
| 566 |
CDatatypeRestrictionExpression* CConcreteOntologyBuildDataUpdater::getDatatypeRestriction(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 567 |
CDatatypeRestrictionExpression* expression = nullptr; |
| 568 |
CExpressionSplitter expSplitter(expressions); |
| 569 |
if (expSplitter.testForExpressionComposition(0,0,0,0,0,0,1,1)) { |
| 570 |
expression = getDatatypeRestriction(expSplitter.getFirstDatatypeExpression(),*expSplitter.getDataFacetRestrictionList()); |
| 571 |
} else { |
| 572 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DatatypeRestriction'-Expression."),this); |
| 573 |
} |
| 574 |
return expression; |
| 575 |
} |
| 576 |
|
| 577 |
CDatatypeRestrictionExpression* CConcreteOntologyBuildDataUpdater::getDatatypeRestriction(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 578 |
CDatatypeRestrictionExpression* expression = nullptr; |
| 579 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 580 |
if (expSplitter.testForExpressionComposition(0,0,0,0,0,0,1,1)) { |
| 581 |
expression = getDatatypeRestriction(expSplitter.getFirstDatatypeExpression(),*expSplitter.getDataFacetRestrictionList()); |
| 582 |
} else { |
| 583 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DatatypeRestriction'-Expression."),this); |
| 584 |
} |
| 585 |
return expression; |
| 586 |
} |
| 587 |
|
| 588 |
|
| 589 |
|
| 590 |
|
| 591 |
CDataMaxCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataMaxCardinality(const CEXPRESSIONLIST<CBuildExpression*>& expressions, int cardinality) { |
| 592 |
CDataMaxCardinalityExpression* expression = nullptr; |
| 593 |
CExpressionSplitter expSplitter(expressions); |
| 594 |
if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { |
| 595 |
expression = getDataMaxCardinality(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression(),cardinality); |
| 596 |
} else { |
| 597 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataMaxCardinality'-Expression."),this); |
| 598 |
} |
| 599 |
return expression; |
| 600 |
} |
| 601 |
|
| 602 |
CDataMaxCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataMaxCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { |
| 603 |
CDataMaxCardinalityExpression* expression = nullptr; |
| 604 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 605 |
if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { |
| 606 |
expression = getDataMaxCardinality(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression(),cardinality); |
| 607 |
} else { |
| 608 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataMaxCardinality'-Expression."),this); |
| 609 |
} |
| 610 |
return expression; |
| 611 |
} |
| 612 |
|
| 613 |
|
| 614 |
|
| 615 |
|
| 616 |
|
| 617 |
CDataMinCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataMinCardinality(const CEXPRESSIONLIST<CBuildExpression*>& expressions, int cardinality) { |
| 618 |
CDataMinCardinalityExpression* expression = nullptr; |
| 619 |
CExpressionSplitter expSplitter(expressions); |
| 620 |
if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { |
| 621 |
expression = getDataMinCardinality(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression(),cardinality); |
| 622 |
} else { |
| 623 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataMinCardinality'-Expression."),this); |
| 624 |
} |
| 625 |
return expression; |
| 626 |
} |
| 627 |
|
| 628 |
CDataMinCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataMinCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { |
| 629 |
CDataMinCardinalityExpression* expression = nullptr; |
| 630 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 631 |
if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { |
| 632 |
expression = getDataMinCardinality(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression(),cardinality); |
| 633 |
} else { |
| 634 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataMinCardinality'-Expression."),this); |
| 635 |
} |
| 636 |
return expression; |
| 637 |
} |
| 638 |
|
| 639 |
|
| 640 |
|
| 641 |
|
| 642 |
CDataExactCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataExactCardinality(const CEXPRESSIONLIST<CBuildExpression*>& expressions, int cardinality) { |
| 643 |
CDataExactCardinalityExpression* expression = nullptr; |
| 644 |
CExpressionSplitter expSplitter(expressions); |
| 645 |
if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { |
| 646 |
expression = getDataExactCardinality(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression(),cardinality); |
| 647 |
} else { |
| 648 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataExactCardinality'-Expression."),this); |
| 649 |
} |
| 650 |
return expression; |
| 651 |
} |
| 652 |
|
| 653 |
CDataExactCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataExactCardinality(CBuildExpression* expression1, CBuildExpression* expression2, int cardinality) { |
| 654 |
CDataExactCardinalityExpression* expression = nullptr; |
| 655 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 656 |
if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { |
| 657 |
expression = getDataExactCardinality(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstOptionalDataRangeTermExpression(),cardinality); |
| 658 |
} else { |
| 659 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataExactCardinality'-Expression."),this); |
| 660 |
} |
| 661 |
return expression; |
| 662 |
} |
| 663 |
|
| 664 |
|
| 665 |
|
| 666 |
|
| 667 |
|
| 668 |
|
| 669 |
CObjectOneOfExpression* CConcreteOntologyBuildDataUpdater::getObjectOneOf(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 670 |
CObjectOneOfExpression* expression = nullptr; |
| 671 |
CExpressionSplitter expSplitter(expressions); |
| 672 |
if (expSplitter.testForExpressionComposition(0,0,0)) { |
| 673 |
expression = getObjectOneOf(*expSplitter.getIndividualTermExpressionList()); |
| 674 |
} else { |
| 675 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectOneOf'-Expression."),this); |
| 676 |
} |
| 677 |
return expression; |
| 678 |
} |
| 679 |
|
| 680 |
|
| 681 |
CObjectOneOfExpression* CConcreteOntologyBuildDataUpdater::getObjectOneOf(CBuildExpression* indiExpression) { |
| 682 |
CObjectOneOfExpression* expression = nullptr; |
| 683 |
CExpressionSplitter expSplitter(indiExpression); |
| 684 |
if (expSplitter.testForExpressionComposition(0,0,0)) { |
| 685 |
expression = getObjectOneOf(*expSplitter.getIndividualTermExpressionList()); |
| 686 |
} else { |
| 687 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectOneOf'-Expression."),this); |
| 688 |
} |
| 689 |
return expression; |
| 690 |
} |
| 691 |
|
| 692 |
|
| 693 |
|
| 694 |
CObjectHasValueExpression* CConcreteOntologyBuildDataUpdater::getObjectHasValue(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 695 |
CObjectHasValueExpression* expression = nullptr; |
| 696 |
CExpressionSplitter expSplitter(expressions); |
| 697 |
if (expSplitter.testForExpressionComposition(0,1,1)) { |
| 698 |
expression = getObjectHasValue(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstIndividualTermExpression()); |
| 699 |
} else { |
| 700 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectHasValue'-Expression."),this); |
| 701 |
} |
| 702 |
return expression; |
| 703 |
} |
| 704 |
|
| 705 |
CObjectHasValueExpression* CConcreteOntologyBuildDataUpdater::getObjectHasValue(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 706 |
CObjectHasValueExpression* expression = nullptr; |
| 707 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 708 |
if (expSplitter.testForExpressionComposition(0,1,1)) { |
| 709 |
expression = getObjectHasValue(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstIndividualTermExpression()); |
| 710 |
} else { |
| 711 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectHasValue'-Expression."),this); |
| 712 |
} |
| 713 |
return expression; |
| 714 |
} |
| 715 |
|
| 716 |
|
| 717 |
|
| 718 |
CObjectHasSelfExpression* CConcreteOntologyBuildDataUpdater::getObjectHasSelf(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 719 |
CObjectHasSelfExpression* expression = nullptr; |
| 720 |
CExpressionSplitter expSplitter(expressions); |
| 721 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 722 |
expression = getObjectHasSelf(expSplitter.getFirstObjectPropertyTermExpression()); |
| 723 |
} else { |
| 724 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectHasSelf'-Expression."),this); |
| 725 |
} |
| 726 |
return expression; |
| 727 |
} |
| 728 |
|
| 729 |
CObjectHasSelfExpression* CConcreteOntologyBuildDataUpdater::getObjectHasSelf(CBuildExpression* selfExpression) { |
| 730 |
CObjectHasSelfExpression* expression = nullptr; |
| 731 |
CExpressionSplitter expSplitter(selfExpression); |
| 732 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 733 |
expression = getObjectHasSelf(expSplitter.getFirstObjectPropertyTermExpression()); |
| 734 |
} else { |
| 735 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectHasSelf'-Expression."),this); |
| 736 |
} |
| 737 |
return expression; |
| 738 |
} |
| 739 |
|
| 740 |
|
| 741 |
|
| 742 |
CSubObjectPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getSubObjectPropertyOf(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 743 |
CSubObjectPropertyOfExpression* expression = nullptr; |
| 744 |
if (expressions.count() == 2) { |
| 745 |
CObjectPropertyChainExpression* propertyChain = dynamic_cast<CObjectPropertyChainExpression*>(expressions.first()); |
| 746 |
CObjectPropertyTermExpression* superObjectPropTerm = dynamic_cast<CObjectPropertyTermExpression*>(expressions.last()); |
| 747 |
if (propertyChain && superObjectPropTerm) { |
| 748 |
expression = getSubObjectPropertyOf(propertyChain,superObjectPropTerm); |
| 749 |
} |
| 750 |
} |
| 751 |
if (!expression) { |
| 752 |
CExpressionSplitter expSplitter(expressions); |
| 753 |
if (expSplitter.testForExpressionComposition(0,2)) { |
| 754 |
CEXPRESSIONLIST<CObjectPropertyTermExpression*>* objectPropertyExpressionList = expSplitter.getObjectPropertyTermExpressionList(); |
| 755 |
CObjectPropertyTermExpression* superObjectPropertyExpression = objectPropertyExpressionList->takeLast(); |
| 756 |
expression = getSubObjectPropertyOf(*objectPropertyExpressionList,superObjectPropertyExpression); |
| 757 |
} else { |
| 758 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SubObjectPropertyOf'-Expression."),this); |
| 759 |
} |
| 760 |
} |
| 761 |
return expression; |
| 762 |
} |
| 763 |
|
| 764 |
CSubObjectPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getSubObjectPropertyOf(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 765 |
CSubObjectPropertyOfExpression* expression = nullptr; |
| 766 |
CObjectPropertyChainExpression* propertyChain = dynamic_cast<CObjectPropertyChainExpression*>(expression1); |
| 767 |
CObjectPropertyTermExpression* superObjectPropTerm = dynamic_cast<CObjectPropertyTermExpression*>(expression2); |
| 768 |
if (propertyChain && superObjectPropTerm) { |
| 769 |
expression = getSubObjectPropertyOf(propertyChain,superObjectPropTerm); |
| 770 |
} |
| 771 |
if (!expression) { |
| 772 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 773 |
if (expSplitter.testForExpressionComposition(0,2)) { |
| 774 |
CEXPRESSIONLIST<CObjectPropertyTermExpression*>* objectPropertyExpressionList = expSplitter.getObjectPropertyTermExpressionList(); |
| 775 |
CObjectPropertyTermExpression* superObjectPropertyExpression = objectPropertyExpressionList->takeLast(); |
| 776 |
expression = getSubObjectPropertyOf(*objectPropertyExpressionList,superObjectPropertyExpression); |
| 777 |
} else { |
| 778 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SubObjectPropertyOf'-Expression."),this); |
| 779 |
} |
| 780 |
} |
| 781 |
return expression; |
| 782 |
} |
| 783 |
|
| 784 |
CObjectPropertyChainExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyChain(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 785 |
CObjectPropertyChainExpression* expression = nullptr; |
| 786 |
CExpressionSplitter expSplitter(expressions); |
| 787 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 788 |
expression = getObjectPropertyChain(*expSplitter.getObjectPropertyTermExpressionList()); |
| 789 |
} else { |
| 790 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectPropertyChain'-Expression."),this); |
| 791 |
} |
| 792 |
return expression; |
| 793 |
} |
| 794 |
|
| 795 |
CObjectPropertyChainExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyChain(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 796 |
CObjectPropertyChainExpression* expression = nullptr; |
| 797 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 798 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 799 |
expression = getObjectPropertyChain(*expSplitter.getObjectPropertyTermExpressionList()); |
| 800 |
} else { |
| 801 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectPropertyChain'-Expression."),this); |
| 802 |
} |
| 803 |
return expression; |
| 804 |
} |
| 805 |
|
| 806 |
CEquivalentObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentObjectProperties(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 807 |
CEquivalentObjectPropertiesExpression* expression = nullptr; |
| 808 |
CExpressionSplitter expSplitter(expressions); |
| 809 |
if (expSplitter.testForExpressionComposition(0,2)) { |
| 810 |
expression = getEquivalentObjectProperties(*expSplitter.getObjectPropertyTermExpressionList()); |
| 811 |
} else { |
| 812 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'EquivalentObjectProperties'-Expression."),this); |
| 813 |
} |
| 814 |
return expression; |
| 815 |
} |
| 816 |
|
| 817 |
CEquivalentObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 818 |
CEquivalentObjectPropertiesExpression* expression = nullptr; |
| 819 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 820 |
if (expSplitter.testForExpressionComposition(0,2)) { |
| 821 |
expression = getEquivalentObjectProperties(*expSplitter.getObjectPropertyTermExpressionList()); |
| 822 |
} else { |
| 823 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'EquivalentObjectProperties'-Expression."),this); |
| 824 |
} |
| 825 |
return expression; |
| 826 |
} |
| 827 |
|
| 828 |
CDisjointObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getDisjointObjectProperties(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 829 |
CDisjointObjectPropertiesExpression* expression = nullptr; |
| 830 |
CExpressionSplitter expSplitter(expressions); |
| 831 |
if (expSplitter.testForExpressionComposition(0,2)) { |
| 832 |
expression = getDisjointObjectProperties(*expSplitter.getObjectPropertyTermExpressionList()); |
| 833 |
} else { |
| 834 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DisjointObjectProperties'-Expression."),this); |
| 835 |
} |
| 836 |
return expression; |
| 837 |
} |
| 838 |
|
| 839 |
CDisjointObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getDisjointObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 840 |
CDisjointObjectPropertiesExpression* expression = nullptr; |
| 841 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 842 |
if (expSplitter.testForExpressionComposition(0,2)) { |
| 843 |
expression = getDisjointObjectProperties(*expSplitter.getObjectPropertyTermExpressionList()); |
| 844 |
} else { |
| 845 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DisjointObjectProperties'-Expression."),this); |
| 846 |
} |
| 847 |
return expression; |
| 848 |
} |
| 849 |
|
| 850 |
|
| 851 |
CObjectPropertyDomainExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyDomainExpression(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 852 |
CObjectPropertyDomainExpression* expression = nullptr; |
| 853 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 854 |
if (expSplitter.testForExpressionComposition(1,1)) { |
| 855 |
expression = getObjectPropertyDomainExpression(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstClassTermExpression()); |
| 856 |
} else { |
| 857 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectPropertyDomain'-Expression."),this); |
| 858 |
} |
| 859 |
return expression; |
| 860 |
} |
| 861 |
|
| 862 |
CObjectPropertyDomainExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyDomainExpression(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 863 |
CObjectPropertyDomainExpression* expression = nullptr; |
| 864 |
CExpressionSplitter expSplitter(expressions); |
| 865 |
if (expSplitter.testForExpressionComposition(1,1)) { |
| 866 |
expression = getObjectPropertyDomainExpression(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstClassTermExpression()); |
| 867 |
} else { |
| 868 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectPropertyDomain'-Expression."),this); |
| 869 |
} |
| 870 |
return expression; |
| 871 |
} |
| 872 |
|
| 873 |
CObjectPropertyRangeExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyRangeExpression(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 874 |
CObjectPropertyRangeExpression* expression = nullptr; |
| 875 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 876 |
if (expSplitter.testForExpressionComposition(1,1)) { |
| 877 |
expression = getObjectPropertyRangeExpression(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstClassTermExpression()); |
| 878 |
} else { |
| 879 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectPropertyRange'-Expression."),this); |
| 880 |
} |
| 881 |
return expression; |
| 882 |
} |
| 883 |
|
| 884 |
CObjectPropertyRangeExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyRangeExpression(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 885 |
CObjectPropertyRangeExpression* expression = nullptr; |
| 886 |
CExpressionSplitter expSplitter(expressions); |
| 887 |
if (expSplitter.testForExpressionComposition(1,1)) { |
| 888 |
expression = getObjectPropertyRangeExpression(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getFirstClassTermExpression()); |
| 889 |
} else { |
| 890 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectPropertyRange'-Expression."),this); |
| 891 |
} |
| 892 |
return expression; |
| 893 |
} |
| 894 |
|
| 895 |
|
| 896 |
|
| 897 |
|
| 898 |
|
| 899 |
|
| 900 |
|
| 901 |
|
| 902 |
|
| 903 |
|
| 904 |
CSubDataPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getSubDataPropertyOf(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 905 |
CSubDataPropertyOfExpression* expression = nullptr; |
| 906 |
CExpressionSplitter expSplitter(expressions); |
| 907 |
if (expSplitter.testForExpressionComposition(0,0,0,0,2)) { |
| 908 |
expression = getSubDataPropertyOf(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getSecondDataPropertyTermExpression()); |
| 909 |
} else { |
| 910 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SubDataPropertyOf'-Expression."),this); |
| 911 |
} |
| 912 |
return expression; |
| 913 |
} |
| 914 |
|
| 915 |
CSubDataPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getSubDataPropertyOf(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 916 |
CSubDataPropertyOfExpression* expression = nullptr; |
| 917 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 918 |
if (expSplitter.testForExpressionComposition(0,0,0,0,2)) { |
| 919 |
expression = getSubDataPropertyOf(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getSecondDataPropertyTermExpression()); |
| 920 |
} else { |
| 921 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SubDataPropertyOf'-Expression."),this); |
| 922 |
} |
| 923 |
return expression; |
| 924 |
} |
| 925 |
|
| 926 |
|
| 927 |
CEquivalentDataPropertiesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentDataProperties(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 928 |
CEquivalentDataPropertiesExpression* expression = nullptr; |
| 929 |
CExpressionSplitter expSplitter(expressions); |
| 930 |
if (expSplitter.testForExpressionComposition(0,0,0,0,2)) { |
| 931 |
expression = getEquivalentDataProperties(*expSplitter.getDataPropertyTermExpressionList()); |
| 932 |
} else { |
| 933 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'EquivalentDataProperties'-Expression."),this); |
| 934 |
} |
| 935 |
return expression; |
| 936 |
} |
| 937 |
|
| 938 |
CEquivalentDataPropertiesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentDataProperties(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 939 |
CEquivalentDataPropertiesExpression* expression = nullptr; |
| 940 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 941 |
if (expSplitter.testForExpressionComposition(0,0,0,0,2)) { |
| 942 |
expression = getEquivalentDataProperties(*expSplitter.getDataPropertyTermExpressionList()); |
| 943 |
} else { |
| 944 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'EquivalentDataProperties'-Expression."),this); |
| 945 |
} |
| 946 |
return expression; |
| 947 |
} |
| 948 |
|
| 949 |
CDisjointDataPropertiesExpression* CConcreteOntologyBuildDataUpdater::getDisjointDataProperties(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 950 |
CDisjointDataPropertiesExpression* expression = nullptr; |
| 951 |
CExpressionSplitter expSplitter(expressions); |
| 952 |
if (expSplitter.testForExpressionComposition(0,0,0,0,2)) { |
| 953 |
expression = getDisjointDataProperties(*expSplitter.getDataPropertyTermExpressionList()); |
| 954 |
} else { |
| 955 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DisjointDataProperties'-Expression."),this); |
| 956 |
} |
| 957 |
return expression; |
| 958 |
} |
| 959 |
|
| 960 |
CDisjointDataPropertiesExpression* CConcreteOntologyBuildDataUpdater::getDisjointDataProperties(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 961 |
CDisjointDataPropertiesExpression* expression = nullptr; |
| 962 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 963 |
if (expSplitter.testForExpressionComposition(0,0,0,0,2)) { |
| 964 |
expression = getDisjointDataProperties(*expSplitter.getDataPropertyTermExpressionList()); |
| 965 |
} else { |
| 966 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DisjointDataProperties'-Expression."),this); |
| 967 |
} |
| 968 |
return expression; |
| 969 |
} |
| 970 |
|
| 971 |
|
| 972 |
CDataPropertyDomainExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyDomainExpression(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 973 |
CDataPropertyDomainExpression* expression = nullptr; |
| 974 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 975 |
if (expSplitter.testForExpressionComposition(1,0,0,0,1)) { |
| 976 |
expression = getDataPropertyDomainExpression(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstClassTermExpression()); |
| 977 |
} else { |
| 978 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataPropertyDomain'-Expression."),this); |
| 979 |
} |
| 980 |
return expression; |
| 981 |
} |
| 982 |
|
| 983 |
CDataPropertyDomainExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyDomainExpression(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 984 |
CDataPropertyDomainExpression* expression = nullptr; |
| 985 |
CExpressionSplitter expSplitter(expressions); |
| 986 |
if (expSplitter.testForExpressionComposition(1,0,0,0,1)) { |
| 987 |
expression = getDataPropertyDomainExpression(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstClassTermExpression()); |
| 988 |
} else { |
| 989 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataPropertyDomain'-Expression."),this); |
| 990 |
} |
| 991 |
return expression; |
| 992 |
} |
| 993 |
|
| 994 |
CDataPropertyRangeExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyRangeExpression(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 995 |
CDataPropertyRangeExpression* expression = nullptr; |
| 996 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 997 |
if (expSplitter.testForExpressionComposition(0,0,0,1,1)) { |
| 998 |
expression = getDataPropertyRangeExpression(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstDataRangeTermExpression()); |
| 999 |
} else { |
| 1000 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataPropertyRange'-Expression."),this); |
| 1001 |
} |
| 1002 |
return expression; |
| 1003 |
} |
| 1004 |
|
| 1005 |
CDataPropertyRangeExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyRangeExpression(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1006 |
CDataPropertyRangeExpression* expression = nullptr; |
| 1007 |
CExpressionSplitter expSplitter(expressions); |
| 1008 |
if (expSplitter.testForExpressionComposition(0,0,0,1,1)) { |
| 1009 |
expression = getDataPropertyRangeExpression(expSplitter.getFirstDataPropertyTermExpression(),expSplitter.getFirstDataRangeTermExpression()); |
| 1010 |
} else { |
| 1011 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataPropertyRange'-Expression."),this); |
| 1012 |
} |
| 1013 |
return expression; |
| 1014 |
} |
| 1015 |
|
| 1016 |
|
| 1017 |
CFunctionalDataPropertyExpression* CConcreteOntologyBuildDataUpdater::getFunctionalDataProperty(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1018 |
CFunctionalDataPropertyExpression* expression = nullptr; |
| 1019 |
CExpressionSplitter expSplitter(expressions); |
| 1020 |
if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { |
| 1021 |
expression = getFunctionalDataProperty(expSplitter.getFirstDataPropertyTermExpression()); |
| 1022 |
} else { |
| 1023 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'FunctionalDataProperty'-Expression."),this); |
| 1024 |
} |
| 1025 |
return expression; |
| 1026 |
} |
| 1027 |
|
| 1028 |
CFunctionalDataPropertyExpression* CConcreteOntologyBuildDataUpdater::getFunctionalDataProperty(CBuildExpression* funcExpression) { |
| 1029 |
CFunctionalDataPropertyExpression* expression = nullptr; |
| 1030 |
CExpressionSplitter expSplitter(funcExpression); |
| 1031 |
if (expSplitter.testForExpressionComposition(0,0,0,0,1)) { |
| 1032 |
expression = getFunctionalDataProperty(expSplitter.getFirstDataPropertyTermExpression()); |
| 1033 |
} else { |
| 1034 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'FunctionalDataProperty'-Expression."),this); |
| 1035 |
} |
| 1036 |
return expression; |
| 1037 |
} |
| 1038 |
|
| 1039 |
|
| 1040 |
|
| 1041 |
|
| 1042 |
|
| 1043 |
|
| 1044 |
|
| 1045 |
|
| 1046 |
CInverseObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getInverseObjectProperties(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1047 |
CInverseObjectPropertiesExpression* expression = nullptr; |
| 1048 |
CExpressionSplitter expSplitter(expressions); |
| 1049 |
if (expSplitter.testForExpressionComposition(0,2)) { |
| 1050 |
expression = getInverseObjectProperties(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getSecondObjectPropertyTermExpression()); |
| 1051 |
} else { |
| 1052 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'InverseObjectProperties'-Expression."),this); |
| 1053 |
} |
| 1054 |
return expression; |
| 1055 |
} |
| 1056 |
|
| 1057 |
CInverseObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getInverseObjectProperties(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 1058 |
CInverseObjectPropertiesExpression* expression = nullptr; |
| 1059 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 1060 |
if (expSplitter.testForExpressionComposition(0,2)) { |
| 1061 |
expression = getInverseObjectProperties(expSplitter.getFirstObjectPropertyTermExpression(),expSplitter.getSecondObjectPropertyTermExpression()); |
| 1062 |
} else { |
| 1063 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'InverseObjectProperties'-Expression."),this); |
| 1064 |
} |
| 1065 |
return expression; |
| 1066 |
} |
| 1067 |
|
| 1068 |
|
| 1069 |
CTransetiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getTransetiveObjectProperty(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1070 |
CTransetiveObjectPropertyExpression* expression = nullptr; |
| 1071 |
CExpressionSplitter expSplitter(expressions); |
| 1072 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 1073 |
expression = getTransetiveObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); |
| 1074 |
} else { |
| 1075 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'TransetiveObjectProperty'-Expression."),this); |
| 1076 |
} |
| 1077 |
return expression; |
| 1078 |
} |
| 1079 |
|
| 1080 |
CTransetiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getTransetiveObjectProperty(CBuildExpression* transExpression) { |
| 1081 |
CTransetiveObjectPropertyExpression* expression = nullptr; |
| 1082 |
CExpressionSplitter expSplitter(transExpression); |
| 1083 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 1084 |
expression = getTransetiveObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); |
| 1085 |
} else { |
| 1086 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'TransetiveObjectProperty'-Expression."),this); |
| 1087 |
} |
| 1088 |
return expression; |
| 1089 |
} |
| 1090 |
|
| 1091 |
CFunctionalObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getFunctionalObjectProperty(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1092 |
CFunctionalObjectPropertyExpression* expression = nullptr; |
| 1093 |
CExpressionSplitter expSplitter(expressions); |
| 1094 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 1095 |
expression = getFunctionalObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); |
| 1096 |
} else { |
| 1097 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'FunctionalObjectProperty'-Expression."),this); |
| 1098 |
} |
| 1099 |
return expression; |
| 1100 |
} |
| 1101 |
|
| 1102 |
CFunctionalObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getFunctionalObjectProperty(CBuildExpression* funcExpression) { |
| 1103 |
CFunctionalObjectPropertyExpression* expression = nullptr; |
| 1104 |
CExpressionSplitter expSplitter(funcExpression); |
| 1105 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 1106 |
expression = getFunctionalObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); |
| 1107 |
} else { |
| 1108 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'FunctionalObjectProperty'-Expression."),this); |
| 1109 |
} |
| 1110 |
return expression; |
| 1111 |
} |
| 1112 |
|
| 1113 |
CInverseFunctionalObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getInverseFunctionalObjectProperty(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1114 |
CInverseFunctionalObjectPropertyExpression* expression = nullptr; |
| 1115 |
CExpressionSplitter expSplitter(expressions); |
| 1116 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 1117 |
expression = getInverseFunctionalObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); |
| 1118 |
} else { |
| 1119 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'InverseFunctionalObjectProperty'-Expression."),this); |
| 1120 |
} |
| 1121 |
return expression; |
| 1122 |
} |
| 1123 |
|
| 1124 |
CInverseFunctionalObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getInverseFunctionalObjectProperty(CBuildExpression* funcExpression) { |
| 1125 |
CInverseFunctionalObjectPropertyExpression* expression = nullptr; |
| 1126 |
CExpressionSplitter expSplitter(funcExpression); |
| 1127 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 1128 |
expression = getInverseFunctionalObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); |
| 1129 |
} else { |
| 1130 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'InverseFunctionalObjectProperty'-Expression."),this); |
| 1131 |
} |
| 1132 |
return expression; |
| 1133 |
} |
| 1134 |
CSymmetricObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getSymmetricObjectProperty(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1135 |
CSymmetricObjectPropertyExpression* expression = nullptr; |
| 1136 |
CExpressionSplitter expSplitter(expressions); |
| 1137 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 1138 |
expression = getSymmetricObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); |
| 1139 |
} else { |
| 1140 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SymmetricObjectProperty'-Expression."),this); |
| 1141 |
} |
| 1142 |
return expression; |
| 1143 |
} |
| 1144 |
|
| 1145 |
CSymmetricObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getSymmetricObjectProperty(CBuildExpression* funcExpression) { |
| 1146 |
CSymmetricObjectPropertyExpression* expression = nullptr; |
| 1147 |
CExpressionSplitter expSplitter(funcExpression); |
| 1148 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 1149 |
expression = getSymmetricObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); |
| 1150 |
} else { |
| 1151 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SymmetricObjectProperty'-Expression."),this); |
| 1152 |
} |
| 1153 |
return expression; |
| 1154 |
} |
| 1155 |
|
| 1156 |
|
| 1157 |
CAsymmetricObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getAsymmetricObjectProperty(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1158 |
CAsymmetricObjectPropertyExpression* expression = nullptr; |
| 1159 |
CExpressionSplitter expSplitter(expressions); |
| 1160 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 1161 |
expression = getAsymmetricObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); |
| 1162 |
} else { |
| 1163 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'AsymmetricObjectProperty'-Expression."),this); |
| 1164 |
} |
| 1165 |
return expression; |
| 1166 |
} |
| 1167 |
|
| 1168 |
CAsymmetricObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getAsymmetricObjectProperty(CBuildExpression* funcExpression) { |
| 1169 |
CAsymmetricObjectPropertyExpression* expression = nullptr; |
| 1170 |
CExpressionSplitter expSplitter(funcExpression); |
| 1171 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 1172 |
expression = getAsymmetricObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); |
| 1173 |
} else { |
| 1174 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'AsymmetricObjectProperty'-Expression."),this); |
| 1175 |
} |
| 1176 |
return expression; |
| 1177 |
} |
| 1178 |
|
| 1179 |
|
| 1180 |
CReflexiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getReflexiveObjectProperty(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1181 |
CReflexiveObjectPropertyExpression* expression = nullptr; |
| 1182 |
CExpressionSplitter expSplitter(expressions); |
| 1183 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 1184 |
expression = getReflexiveObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); |
| 1185 |
} else { |
| 1186 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ReflexiveObjectProperty'-Expression."),this); |
| 1187 |
} |
| 1188 |
return expression; |
| 1189 |
} |
| 1190 |
|
| 1191 |
CReflexiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getReflexiveObjectProperty(CBuildExpression* funcExpression) { |
| 1192 |
CReflexiveObjectPropertyExpression* expression = nullptr; |
| 1193 |
CExpressionSplitter expSplitter(funcExpression); |
| 1194 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 1195 |
expression = getReflexiveObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); |
| 1196 |
} else { |
| 1197 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ReflexiveObjectProperty'-Expression."),this); |
| 1198 |
} |
| 1199 |
return expression; |
| 1200 |
} |
| 1201 |
|
| 1202 |
|
| 1203 |
CIrreflexiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getIrreflexiveObjectProperty(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1204 |
CIrreflexiveObjectPropertyExpression* expression = nullptr; |
| 1205 |
CExpressionSplitter expSplitter(expressions); |
| 1206 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 1207 |
expression = getIrreflexiveObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); |
| 1208 |
} else { |
| 1209 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'IrreflexiveObjectProperty'-Expression."),this); |
| 1210 |
} |
| 1211 |
return expression; |
| 1212 |
} |
| 1213 |
|
| 1214 |
CIrreflexiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getIrreflexiveObjectProperty(CBuildExpression* funcExpression) { |
| 1215 |
CIrreflexiveObjectPropertyExpression* expression = nullptr; |
| 1216 |
CExpressionSplitter expSplitter(funcExpression); |
| 1217 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 1218 |
expression = getIrreflexiveObjectProperty(expSplitter.getFirstObjectPropertyTermExpression()); |
| 1219 |
} else { |
| 1220 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'IrreflexiveObjectProperty'-Expression."),this); |
| 1221 |
} |
| 1222 |
return expression; |
| 1223 |
} |
| 1224 |
|
| 1225 |
|
| 1226 |
CInverseObjectPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getInverseObjectPropertyOf(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1227 |
CInverseObjectPropertyOfExpression* expression = nullptr; |
| 1228 |
CExpressionSplitter expSplitter(expressions); |
| 1229 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 1230 |
expression = getInverseObjectPropertyOf(expSplitter.getFirstObjectPropertyTermExpression()); |
| 1231 |
} else { |
| 1232 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'InverseObjectPropertyOf'-Expression."),this); |
| 1233 |
} |
| 1234 |
return expression; |
| 1235 |
} |
| 1236 |
|
| 1237 |
CInverseObjectPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getInverseObjectPropertyOf(CBuildExpression* invExpression) { |
| 1238 |
CInverseObjectPropertyOfExpression* expression = nullptr; |
| 1239 |
CExpressionSplitter expSplitter(invExpression); |
| 1240 |
if (expSplitter.testForExpressionComposition(0,1)) { |
| 1241 |
expression = getInverseObjectPropertyOf(expSplitter.getFirstObjectPropertyTermExpression()); |
| 1242 |
} else { |
| 1243 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'InverseObjectPropertyOf'-Expression."),this); |
| 1244 |
} |
| 1245 |
return expression; |
| 1246 |
} |
| 1247 |
|
| 1248 |
|
| 1249 |
|
| 1250 |
CClassAssertionExpression* CConcreteOntologyBuildDataUpdater::getClassAssertion(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1251 |
CClassAssertionExpression* expression = nullptr; |
| 1252 |
CExpressionSplitter expSplitter(expressions); |
| 1253 |
if (expSplitter.testForExpressionComposition(1,0,1)) { |
| 1254 |
expression = getClassAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getFirstClassTermExpression()); |
| 1255 |
} else { |
| 1256 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ClassAssertion'-Expression."),this); |
| 1257 |
} |
| 1258 |
return expression; |
| 1259 |
} |
| 1260 |
|
| 1261 |
CClassAssertionExpression* CConcreteOntologyBuildDataUpdater::getClassAssertion(CBuildExpression* expression1, CBuildExpression* expression2) { |
| 1262 |
CClassAssertionExpression* expression = nullptr; |
| 1263 |
CExpressionSplitter expSplitter(expression1,expression2); |
| 1264 |
if (expSplitter.testForExpressionComposition(1,0,1)) { |
| 1265 |
expression = getClassAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getFirstClassTermExpression()); |
| 1266 |
} else { |
| 1267 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ClassAssertion'-Expression."),this); |
| 1268 |
} |
| 1269 |
return expression; |
| 1270 |
} |
| 1271 |
|
| 1272 |
|
| 1273 |
|
| 1274 |
|
| 1275 |
|
| 1276 |
CObjectPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyAssertion(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1277 |
CObjectPropertyAssertionExpression* expression = nullptr; |
| 1278 |
CExpressionSplitter expSplitter(expressions); |
| 1279 |
if (expSplitter.testForExpressionComposition(0,1,2)) { |
| 1280 |
expression = getObjectPropertyAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getSecondIndividualTermExpression(),expSplitter.getFirstObjectPropertyTermExpression()); |
| 1281 |
} else { |
| 1282 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectPropertyAssertion'-Expression."),this); |
| 1283 |
} |
| 1284 |
return expression; |
| 1285 |
} |
| 1286 |
|
| 1287 |
CObjectPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) { |
| 1288 |
CObjectPropertyAssertionExpression* expression = nullptr; |
| 1289 |
CExpressionSplitter expSplitter(expression1,expression2,expression3); |
| 1290 |
if (expSplitter.testForExpressionComposition(0,1,2)) { |
| 1291 |
expression = getObjectPropertyAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getSecondIndividualTermExpression(),expSplitter.getFirstObjectPropertyTermExpression()); |
| 1292 |
} else { |
| 1293 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'ObjectPropertyAssertion'-Expression."),this); |
| 1294 |
} |
| 1295 |
return expression; |
| 1296 |
} |
| 1297 |
|
| 1298 |
|
| 1299 |
CNegativeObjectPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getNegativeObjectPropertyAssertion(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1300 |
CNegativeObjectPropertyAssertionExpression* expression = nullptr; |
| 1301 |
CExpressionSplitter expSplitter(expressions); |
| 1302 |
if (expSplitter.testForExpressionComposition(0,1,2)) { |
| 1303 |
expression = getNegativeObjectPropertyAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getSecondIndividualTermExpression(),expSplitter.getFirstObjectPropertyTermExpression()); |
| 1304 |
} else { |
| 1305 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'NegativeObjectPropertyAssertion'-Expression."),this); |
| 1306 |
} |
| 1307 |
return expression; |
| 1308 |
} |
| 1309 |
|
| 1310 |
CNegativeObjectPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getNegativeObjectPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) { |
| 1311 |
CNegativeObjectPropertyAssertionExpression* expression = nullptr; |
| 1312 |
CExpressionSplitter expSplitter(expression1,expression2,expression3); |
| 1313 |
if (expSplitter.testForExpressionComposition(0,1,2)) { |
| 1314 |
expression = getNegativeObjectPropertyAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getSecondIndividualTermExpression(),expSplitter.getFirstObjectPropertyTermExpression()); |
| 1315 |
} else { |
| 1316 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'NegativeObjectPropertyAssertion'-Expression."),this); |
| 1317 |
} |
| 1318 |
return expression; |
| 1319 |
} |
| 1320 |
|
| 1321 |
|
| 1322 |
|
| 1323 |
|
| 1324 |
CDataPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyAssertion(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1325 |
CDataPropertyAssertionExpression* expression = nullptr; |
| 1326 |
CExpressionSplitter expSplitter(expressions); |
| 1327 |
if (expSplitter.testForExpressionComposition(0,0,1,0,1,1)) { |
| 1328 |
expression = getDataPropertyAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getFirstDataLiteralTermExpression(),expSplitter.getFirstDataPropertyTermExpression()); |
| 1329 |
} else { |
| 1330 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataPropertyAssertion'-Expression."),this); |
| 1331 |
} |
| 1332 |
return expression; |
| 1333 |
} |
| 1334 |
|
| 1335 |
CDataPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) { |
| 1336 |
CDataPropertyAssertionExpression* expression = nullptr; |
| 1337 |
CExpressionSplitter expSplitter(expression1,expression2,expression3); |
| 1338 |
if (expSplitter.testForExpressionComposition(0,0,1,0,1,1)) { |
| 1339 |
expression = getDataPropertyAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getFirstDataLiteralTermExpression(),expSplitter.getFirstDataPropertyTermExpression()); |
| 1340 |
} else { |
| 1341 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DataPropertyAssertion'-Expression."),this); |
| 1342 |
} |
| 1343 |
return expression; |
| 1344 |
} |
| 1345 |
|
| 1346 |
CNegativeDataPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getNegativeDataPropertyAssertion(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1347 |
CNegativeDataPropertyAssertionExpression* expression = nullptr; |
| 1348 |
CExpressionSplitter expSplitter(expressions); |
| 1349 |
if (expSplitter.testForExpressionComposition(0,0,1,0,1,1)) { |
| 1350 |
expression = getNegativeDataPropertyAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getFirstDataLiteralTermExpression(),expSplitter.getFirstDataPropertyTermExpression()); |
| 1351 |
} else { |
| 1352 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'NegativeDataPropertyAssertion'-Expression."),this); |
| 1353 |
} |
| 1354 |
return expression; |
| 1355 |
} |
| 1356 |
|
| 1357 |
CNegativeDataPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getNegativeDataPropertyAssertion(CBuildExpression* expression1, CBuildExpression* expression2, CBuildExpression* expression3) { |
| 1358 |
CNegativeDataPropertyAssertionExpression* expression = nullptr; |
| 1359 |
CExpressionSplitter expSplitter(expression1,expression2,expression3); |
| 1360 |
if (expSplitter.testForExpressionComposition(0,0,1,0,1,1)) { |
| 1361 |
expression = getNegativeDataPropertyAssertion(expSplitter.getFirstIndividualTermExpression(),expSplitter.getFirstDataLiteralTermExpression(),expSplitter.getFirstDataPropertyTermExpression()); |
| 1362 |
} else { |
| 1363 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'NegativeDataPropertyAssertion'-Expression."),this); |
| 1364 |
} |
| 1365 |
return expression; |
| 1366 |
} |
| 1367 |
|
| 1368 |
|
| 1369 |
|
| 1370 |
|
| 1371 |
|
| 1372 |
|
| 1373 |
|
| 1374 |
|
| 1375 |
CSameIndividualExpression* CConcreteOntologyBuildDataUpdater::getSameIndividual(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1376 |
CSameIndividualExpression* expression = nullptr; |
| 1377 |
CExpressionSplitter expSplitter(expressions); |
| 1378 |
if (expSplitter.testForExpressionComposition(0,0,2)) { |
| 1379 |
expression = getSameIndividual(*expSplitter.getIndividualTermExpressionList()); |
| 1380 |
} else { |
| 1381 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'SameIndividual'-Expression."),this); |
| 1382 |
} |
| 1383 |
return expression; |
| 1384 |
} |
| 1385 |
|
| 1386 |
|
| 1387 |
CDifferentIndividualsExpression* CConcreteOntologyBuildDataUpdater::getDifferentIndividuals(const CEXPRESSIONLIST<CBuildExpression*>& expressions) { |
| 1388 |
CDifferentIndividualsExpression* expression = nullptr; |
| 1389 |
CExpressionSplitter expSplitter(expressions); |
| 1390 |
if (expSplitter.testForExpressionComposition(0,0,2)) { |
| 1391 |
expression = getDifferentIndividuals(*expSplitter.getIndividualTermExpressionList()); |
| 1392 |
} else { |
| 1393 |
LOG(ERROR,"::Konclude::Reasoner::Generator::ConcretOntologyUpdateBuilder",logTr("Couldn't match parameters for 'DifferentIndividual'-Expression."),this); |
| 1394 |
} |
| 1395 |
return expression; |
| 1396 |
} |
| 1397 |
|
| 1398 |
|
| 1399 |
|
| 1400 |
CConcreteOntologyBuildDataUpdater* CConcreteOntologyBuildDataUpdater::addHashedExpression(CBuildExpression* expression) { |
| 1401 |
mExpressionBuildHash->insert(CExpressionHasher(expression),expression); |
| 1402 |
mExpressionBuildContainerList->append(expression); |
| 1403 |
return this; |
| 1404 |
} |
| 1405 |
|
| 1406 |
|
| 1407 |
CBuildExpression* CConcreteOntologyBuildDataUpdater::getHashedExpression(CBuildExpression* expression) { |
| 1408 |
CBuildExpression* hashExpression = nullptr; |
| 1409 |
hashExpression = mExpressionBuildHash->value(CExpressionHasher(expression),nullptr); |
| 1410 |
return hashExpression; |
| 1411 |
} |
| 1412 |
|
| 1413 |
CDeclarationAxiomExpression* CConcreteOntologyBuildDataUpdater::getDeclaration(CExpressionEntity* entity) { |
| 1414 |
CDeclarationAxiomExpression* expression = nullptr; |
| 1415 |
CDeclarationAxiomExpression tmpExpression(entity); |
| 1416 |
expression = (CDeclarationAxiomExpression*)getHashedExpression(&tmpExpression); |
| 1417 |
if (!expression) { |
| 1418 |
expression = new CDeclarationAxiomExpression(entity); |
| 1419 |
addHashedExpression(expression); |
| 1420 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDECLARATION); |
| 1421 |
} |
| 1422 |
return expression; |
| 1423 |
} |
| 1424 |
|
| 1425 |
|
| 1426 |
|
| 1427 |
CEquivalentClassesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentClasses(const CEXPRESSIONLIST<CClassTermExpression*>& expressions) { |
| 1428 |
CEquivalentClassesExpression* expression = nullptr; |
| 1429 |
CEquivalentClassesExpression tmpExpression(expressions); |
| 1430 |
expression = (CEquivalentClassesExpression*)getHashedExpression(&tmpExpression); |
| 1431 |
if (!expression) { |
| 1432 |
expression = new CEquivalentClassesExpression(expressions); |
| 1433 |
addHashedExpression(expression); |
| 1434 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETEQUIVALENTCLASSES); |
| 1435 |
} |
| 1436 |
return expression; |
| 1437 |
} |
| 1438 |
|
| 1439 |
CSubClassOfExpression* CConcreteOntologyBuildDataUpdater::getSubClassOf(CClassTermExpression* expression1, CClassTermExpression* expression2) { |
| 1440 |
CSubClassOfExpression* expression = nullptr; |
| 1441 |
CSubClassOfExpression tmpExpression(expression1,expression2); |
| 1442 |
expression = (CSubClassOfExpression*)getHashedExpression(&tmpExpression); |
| 1443 |
if (!expression) { |
| 1444 |
expression = new CSubClassOfExpression(expression1,expression2); |
| 1445 |
addHashedExpression(expression); |
| 1446 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETESUBCLASSOF); |
| 1447 |
} |
| 1448 |
return expression; |
| 1449 |
} |
| 1450 |
|
| 1451 |
CDisjointClassesExpression* CConcreteOntologyBuildDataUpdater::getDisjointClasses(const CEXPRESSIONLIST<CClassTermExpression*>& expressions) { |
| 1452 |
CDisjointClassesExpression* expression = nullptr; |
| 1453 |
CDisjointClassesExpression tmpExpression(expressions); |
| 1454 |
expression = (CDisjointClassesExpression*)getHashedExpression(&tmpExpression); |
| 1455 |
if (!expression) { |
| 1456 |
expression = new CDisjointClassesExpression(expressions); |
| 1457 |
addHashedExpression(expression); |
| 1458 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDISJOINTCLASSES); |
| 1459 |
} |
| 1460 |
return expression; |
| 1461 |
} |
| 1462 |
|
| 1463 |
|
| 1464 |
CDisjointUnionExpression* CConcreteOntologyBuildDataUpdater::getDisjointUnion(CClassExpression* classExpression, const CEXPRESSIONLIST<CClassTermExpression*>& expressions) { |
| 1465 |
CDisjointUnionExpression* expression = nullptr; |
| 1466 |
CDisjointUnionExpression tmpExpression(classExpression,expressions); |
| 1467 |
expression = (CDisjointUnionExpression*)getHashedExpression(&tmpExpression); |
| 1468 |
if (!expression) { |
| 1469 |
expression = new CDisjointUnionExpression(classExpression,expressions); |
| 1470 |
addHashedExpression(expression); |
| 1471 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDISJOINTUNION); |
| 1472 |
} |
| 1473 |
return expression; |
| 1474 |
} |
| 1475 |
|
| 1476 |
|
| 1477 |
CObjectComplementOfExpression* CConcreteOntologyBuildDataUpdater::getObjectComplementOf(CClassTermExpression* compExpression) { |
| 1478 |
CObjectComplementOfExpression* expression = nullptr; |
| 1479 |
CObjectComplementOfExpression tmpExpression(compExpression); |
| 1480 |
expression = (CObjectComplementOfExpression*)getHashedExpression(&tmpExpression); |
| 1481 |
if (!expression) { |
| 1482 |
expression = new CObjectComplementOfExpression(compExpression); |
| 1483 |
addHashedExpression(expression); |
| 1484 |
mBuildConceptSet->insert(expression); |
| 1485 |
mBuildConceptList->append(expression); |
| 1486 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTCOMPLEMENTOF); |
| 1487 |
} |
| 1488 |
return expression; |
| 1489 |
} |
| 1490 |
|
| 1491 |
CObjectIntersectionOfExpression* CConcreteOntologyBuildDataUpdater::getObjectIntersectionOf(const CEXPRESSIONLIST<CClassTermExpression*>& expressions) { |
| 1492 |
CObjectIntersectionOfExpression* expression = nullptr; |
| 1493 |
|
| 1494 |
CObjectIntersectionOfExpression tmpExpression(expressions); |
| 1495 |
expression = (CObjectIntersectionOfExpression*)getHashedExpression(&tmpExpression); |
| 1496 |
if (!expression) { |
| 1497 |
expression = new CObjectIntersectionOfExpression(expressions); |
| 1498 |
addHashedExpression(expression); |
| 1499 |
mBuildConceptSet->insert(expression); |
| 1500 |
mBuildConceptList->append(expression); |
| 1501 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTINTERSECTION); |
| 1502 |
} |
| 1503 |
return expression; |
| 1504 |
} |
| 1505 |
|
| 1506 |
CObjectUnionOfExpression* CConcreteOntologyBuildDataUpdater::getObjectUnionOf(const CEXPRESSIONLIST<CClassTermExpression*>& expressions) { |
| 1507 |
CObjectUnionOfExpression* expression = nullptr; |
| 1508 |
|
| 1509 |
CObjectUnionOfExpression tmpExpression(expressions); |
| 1510 |
expression = (CObjectUnionOfExpression*)getHashedExpression(&tmpExpression); |
| 1511 |
if (!expression) { |
| 1512 |
expression = new CObjectUnionOfExpression(expressions); |
| 1513 |
addHashedExpression(expression); |
| 1514 |
mBuildConceptSet->insert(expression); |
| 1515 |
mBuildConceptList->append(expression); |
| 1516 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTUNION); |
| 1517 |
} |
| 1518 |
return expression; |
| 1519 |
} |
| 1520 |
|
| 1521 |
|
| 1522 |
CObjectMaxCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectMaxCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality) { |
| 1523 |
CObjectMaxCardinalityExpression* expression = nullptr; |
| 1524 |
if (expression2 == nullptr) { |
| 1525 |
expression2 = mTopClassExpression; |
| 1526 |
} |
| 1527 |
CObjectMaxCardinalityExpression tmpExpression(expression1,expression2,cardinality); |
| 1528 |
expression = (CObjectMaxCardinalityExpression*)getHashedExpression(&tmpExpression); |
| 1529 |
if (!expression) { |
| 1530 |
expression = new CObjectMaxCardinalityExpression(expression1,expression2,cardinality); |
| 1531 |
addHashedExpression(expression); |
| 1532 |
mBuildConceptSet->insert(expression); |
| 1533 |
mBuildConceptList->append(expression); |
| 1534 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTMAXCARDINALITY); |
| 1535 |
mBuildExpCounter->setMaxObjectCardinalityMinimumMaximumCandidate(cardinality); |
| 1536 |
} |
| 1537 |
return expression; |
| 1538 |
} |
| 1539 |
|
| 1540 |
CObjectMinCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectMinCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality) { |
| 1541 |
CObjectMinCardinalityExpression* expression = nullptr; |
| 1542 |
if (expression2 == nullptr) { |
| 1543 |
expression2 = mTopClassExpression; |
| 1544 |
} |
| 1545 |
CObjectMinCardinalityExpression tmpExpression(expression1,expression2,cardinality); |
| 1546 |
expression = (CObjectMinCardinalityExpression*)getHashedExpression(&tmpExpression); |
| 1547 |
if (!expression) { |
| 1548 |
expression = new CObjectMinCardinalityExpression(expression1,expression2,cardinality); |
| 1549 |
addHashedExpression(expression); |
| 1550 |
mBuildConceptSet->insert(expression); |
| 1551 |
mBuildConceptList->append(expression); |
| 1552 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTMINCARDINALITY); |
| 1553 |
mBuildExpCounter->setMinObjectCardinalityMinimumMaximumCandidate(cardinality); |
| 1554 |
} |
| 1555 |
return expression; |
| 1556 |
} |
| 1557 |
|
| 1558 |
CObjectExactlyCardinalityExpression* CConcreteOntologyBuildDataUpdater::getObjectExactlyCardinality(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2, int cardinality) { |
| 1559 |
CObjectExactlyCardinalityExpression* expression = nullptr; |
| 1560 |
if (expression2 == nullptr) { |
| 1561 |
expression2 = mTopClassExpression; |
| 1562 |
} |
| 1563 |
CObjectExactlyCardinalityExpression tmpExpression(expression1,expression2,cardinality); |
| 1564 |
expression = (CObjectExactlyCardinalityExpression*)getHashedExpression(&tmpExpression); |
| 1565 |
if (!expression) { |
| 1566 |
expression = new CObjectExactlyCardinalityExpression(expression1,expression2,cardinality); |
| 1567 |
addHashedExpression(expression); |
| 1568 |
mBuildConceptSet->insert(expression); |
| 1569 |
mBuildConceptList->append(expression); |
| 1570 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTEXACTLYCARDINALITY); |
| 1571 |
mBuildExpCounter->setMaxObjectCardinalityMinimumMaximumCandidate(cardinality); |
| 1572 |
mBuildExpCounter->setMinObjectCardinalityMinimumMaximumCandidate(cardinality); |
| 1573 |
} |
| 1574 |
return expression; |
| 1575 |
} |
| 1576 |
|
| 1577 |
CObjectAllValuesFromExpression* CConcreteOntologyBuildDataUpdater::getObjectAllValuesFrom(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2) { |
| 1578 |
CObjectAllValuesFromExpression* expression = nullptr; |
| 1579 |
CObjectAllValuesFromExpression tmpExpression(expression1,expression2); |
| 1580 |
expression = (CObjectAllValuesFromExpression*)getHashedExpression(&tmpExpression); |
| 1581 |
if (!expression) { |
| 1582 |
expression = new CObjectAllValuesFromExpression(expression1,expression2); |
| 1583 |
addHashedExpression(expression); |
| 1584 |
mBuildConceptSet->insert(expression); |
| 1585 |
mBuildConceptList->append(expression); |
| 1586 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTALLVALUEFROM); |
| 1587 |
} |
| 1588 |
return expression; |
| 1589 |
} |
| 1590 |
|
| 1591 |
CObjectOneOfExpression* CConcreteOntologyBuildDataUpdater::getObjectOneOf(const CEXPRESSIONLIST<CIndividualTermExpression*> &expressions) { |
| 1592 |
CObjectOneOfExpression* expression = nullptr; |
| 1593 |
CObjectOneOfExpression tmpExpression(expressions); |
| 1594 |
expression = (CObjectOneOfExpression*)getHashedExpression(&tmpExpression); |
| 1595 |
if (!expression) { |
| 1596 |
expression = new CObjectOneOfExpression(expressions); |
| 1597 |
addHashedExpression(expression); |
| 1598 |
mBuildConceptSet->insert(expression); |
| 1599 |
mBuildConceptList->append(expression); |
| 1600 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTONEOF); |
| 1601 |
} |
| 1602 |
return expression; |
| 1603 |
} |
| 1604 |
|
| 1605 |
|
| 1606 |
CObjectOneOfExpression* CConcreteOntologyBuildDataUpdater::getObjectOneOf(CIndividualTermExpression* indiExpression) { |
| 1607 |
if (!mTmpObjectOneOfExpression) { |
| 1608 |
mTmpObjectOneOfExpression = new CObjectOneOfExpression(indiExpression); |
| 1609 |
} else { |
| 1610 |
mTmpObjectOneOfExpression->initObjectOneOfExpression(indiExpression); |
| 1611 |
} |
| 1612 |
CBuildExpression* expression = getHashedExpression(mTmpObjectOneOfExpression); |
| 1613 |
if (!expression) { |
| 1614 |
addHashedExpression(mTmpObjectOneOfExpression); |
| 1615 |
mBuildConceptSet->insert(mTmpObjectOneOfExpression); |
| 1616 |
mBuildConceptList->append(mTmpObjectOneOfExpression); |
| 1617 |
expression = mTmpObjectOneOfExpression; |
| 1618 |
mTmpObjectOneOfExpression = nullptr; |
| 1619 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTONEOF); |
| 1620 |
} |
| 1621 |
return (CObjectOneOfExpression*)expression; |
| 1622 |
} |
| 1623 |
|
| 1624 |
|
| 1625 |
|
| 1626 |
|
| 1627 |
|
| 1628 |
CDataLiteralExpression* CConcreteOntologyBuildDataUpdater::getDataLiteral(CDataLexicalValueExpression* dataLexicalValue, CDatatypeExpression* datatype) { |
| 1629 |
CDataLiteralExpression* expression = nullptr; |
| 1630 |
CDataLiteralExpression tmpExpression(dataLexicalValue,datatype); |
| 1631 |
expression = (CDataLiteralExpression*)getHashedExpression(&tmpExpression); |
| 1632 |
if (!expression) { |
| 1633 |
expression = new CDataLiteralExpression(dataLexicalValue,datatype); |
| 1634 |
addHashedExpression(expression); |
| 1635 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATALITERAL); |
| 1636 |
} |
| 1637 |
return expression; |
| 1638 |
} |
| 1639 |
|
| 1640 |
|
| 1641 |
|
| 1642 |
|
| 1643 |
|
| 1644 |
CDataSomeValuesFromExpression* CConcreteOntologyBuildDataUpdater::getDataSomeValuesFrom(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2) { |
| 1645 |
CDataSomeValuesFromExpression* expression = nullptr; |
| 1646 |
CDataSomeValuesFromExpression tmpExpression(expression1,expression2); |
| 1647 |
expression = (CDataSomeValuesFromExpression*)getHashedExpression(&tmpExpression); |
| 1648 |
if (!expression) { |
| 1649 |
expression = new CDataSomeValuesFromExpression(expression1,expression2); |
| 1650 |
addHashedExpression(expression); |
| 1651 |
mBuildConceptSet->insert(expression); |
| 1652 |
mBuildConceptList->append(expression); |
| 1653 |
if (dynamic_cast<CDataLiteralExpression*>(expression2) && !mBuildDataRangeSet->contains(expression2)) { |
| 1654 |
mBuildDataRangeSet->insert(expression2); |
| 1655 |
mBuildDataRangeList->append(expression2); |
| 1656 |
} |
| 1657 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATASOMEVALUEFROM); |
| 1658 |
} |
| 1659 |
return expression; |
| 1660 |
} |
| 1661 |
|
| 1662 |
|
| 1663 |
|
| 1664 |
CDataHasValueExpression* CConcreteOntologyBuildDataUpdater::getDataHasValue(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2) { |
| 1665 |
CDataHasValueExpression* expression = nullptr; |
| 1666 |
CDataHasValueExpression tmpExpression(expression1,expression2); |
| 1667 |
expression = (CDataHasValueExpression*)getHashedExpression(&tmpExpression); |
| 1668 |
if (!expression) { |
| 1669 |
expression = new CDataHasValueExpression(expression1,expression2); |
| 1670 |
addHashedExpression(expression); |
| 1671 |
mBuildConceptSet->insert(expression); |
| 1672 |
mBuildConceptList->append(expression); |
| 1673 |
if (dynamic_cast<CDataLiteralExpression*>(expression2) && !mBuildDataRangeSet->contains(expression2)) { |
| 1674 |
mBuildDataRangeSet->insert(expression2); |
| 1675 |
mBuildDataRangeList->append(expression2); |
| 1676 |
} |
| 1677 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAHASVALUE); |
| 1678 |
} |
| 1679 |
return expression; |
| 1680 |
} |
| 1681 |
|
| 1682 |
|
| 1683 |
CDataAllValuesFromExpression* CConcreteOntologyBuildDataUpdater::getDataAllValuesFrom(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2) { |
| 1684 |
CDataAllValuesFromExpression* expression = nullptr; |
| 1685 |
CDataAllValuesFromExpression tmpExpression(expression1,expression2); |
| 1686 |
expression = (CDataAllValuesFromExpression*)getHashedExpression(&tmpExpression); |
| 1687 |
if (!expression) { |
| 1688 |
expression = new CDataAllValuesFromExpression(expression1,expression2); |
| 1689 |
addHashedExpression(expression); |
| 1690 |
mBuildConceptSet->insert(expression); |
| 1691 |
mBuildConceptList->append(expression); |
| 1692 |
if (dynamic_cast<CDataLiteralExpression*>(expression2) && !mBuildDataRangeSet->contains(expression2)) { |
| 1693 |
mBuildDataRangeSet->insert(expression2); |
| 1694 |
mBuildDataRangeList->append(expression2); |
| 1695 |
} |
| 1696 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAALLVALUEFROM); |
| 1697 |
} |
| 1698 |
return expression; |
| 1699 |
} |
| 1700 |
|
| 1701 |
|
| 1702 |
|
| 1703 |
CDataMaxCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataMaxCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality) { |
| 1704 |
CDataMaxCardinalityExpression* expression = nullptr; |
| 1705 |
if (expression2 == nullptr) { |
| 1706 |
expression2 = mTopDataRangeExpression; |
| 1707 |
} |
| 1708 |
CDataMaxCardinalityExpression tmpExpression(expression1,expression2,cardinality); |
| 1709 |
expression = (CDataMaxCardinalityExpression*)getHashedExpression(&tmpExpression); |
| 1710 |
if (!expression) { |
| 1711 |
expression = new CDataMaxCardinalityExpression(expression1,expression2,cardinality); |
| 1712 |
addHashedExpression(expression); |
| 1713 |
mBuildConceptSet->insert(expression); |
| 1714 |
mBuildConceptList->append(expression); |
| 1715 |
if (dynamic_cast<CDataLiteralExpression*>(expression2) && !mBuildDataRangeSet->contains(expression2)) { |
| 1716 |
mBuildDataRangeSet->insert(expression2); |
| 1717 |
mBuildDataRangeList->append(expression2); |
| 1718 |
} |
| 1719 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAMAXCARDINALITY); |
| 1720 |
mBuildExpCounter->setMaxDataCardinalityMinimumMaximumCandidate(cardinality); |
| 1721 |
} |
| 1722 |
return expression; |
| 1723 |
} |
| 1724 |
|
| 1725 |
|
| 1726 |
CDataMinCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataMinCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality) { |
| 1727 |
CDataMinCardinalityExpression* expression = nullptr; |
| 1728 |
if (expression2 == nullptr) { |
| 1729 |
expression2 = mTopDataRangeExpression; |
| 1730 |
} |
| 1731 |
CDataMinCardinalityExpression tmpExpression(expression1,expression2,cardinality); |
| 1732 |
expression = (CDataMinCardinalityExpression*)getHashedExpression(&tmpExpression); |
| 1733 |
if (!expression) { |
| 1734 |
expression = new CDataMinCardinalityExpression(expression1,expression2,cardinality); |
| 1735 |
addHashedExpression(expression); |
| 1736 |
mBuildConceptSet->insert(expression); |
| 1737 |
mBuildConceptList->append(expression); |
| 1738 |
if (dynamic_cast<CDataLiteralExpression*>(expression2) && !mBuildDataRangeSet->contains(expression2)) { |
| 1739 |
mBuildDataRangeSet->insert(expression2); |
| 1740 |
mBuildDataRangeList->append(expression2); |
| 1741 |
} |
| 1742 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAMINCARDINALITY); |
| 1743 |
mBuildExpCounter->setMinDataCardinalityMinimumMaximumCandidate(cardinality); |
| 1744 |
} |
| 1745 |
return expression; |
| 1746 |
} |
| 1747 |
|
| 1748 |
|
| 1749 |
|
| 1750 |
|
| 1751 |
CDataExactCardinalityExpression* CConcreteOntologyBuildDataUpdater::getDataExactCardinality(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2, int cardinality) { |
| 1752 |
CDataExactCardinalityExpression* expression = nullptr; |
| 1753 |
if (expression2 == nullptr) { |
| 1754 |
expression2 = mTopDataRangeExpression; |
| 1755 |
} |
| 1756 |
CDataExactCardinalityExpression tmpExpression(expression1,expression2,cardinality); |
| 1757 |
expression = (CDataExactCardinalityExpression*)getHashedExpression(&tmpExpression); |
| 1758 |
if (!expression) { |
| 1759 |
expression = new CDataExactCardinalityExpression(expression1,expression2,cardinality); |
| 1760 |
addHashedExpression(expression); |
| 1761 |
mBuildConceptSet->insert(expression); |
| 1762 |
mBuildConceptList->append(expression); |
| 1763 |
if (dynamic_cast<CDataLiteralExpression*>(expression2) && !mBuildDataRangeSet->contains(expression2)) { |
| 1764 |
mBuildDataRangeSet->insert(expression2); |
| 1765 |
mBuildDataRangeList->append(expression2); |
| 1766 |
} |
| 1767 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAEXACTCARDINALITY); |
| 1768 |
mBuildExpCounter->setMaxDataCardinalityMinimumMaximumCandidate(cardinality); |
| 1769 |
mBuildExpCounter->setMinDataCardinalityMinimumMaximumCandidate(cardinality); |
| 1770 |
} |
| 1771 |
return expression; |
| 1772 |
} |
| 1773 |
|
| 1774 |
|
| 1775 |
|
| 1776 |
CDataFacetRestrictionExpression* CConcreteOntologyBuildDataUpdater::getDataFacetRestriction(CDataLiteralExpression* dataLiteralExpression, CDataFacetExpression* dataFacet) { |
| 1777 |
CDataFacetRestrictionExpression* expression = nullptr; |
| 1778 |
CDataFacetRestrictionExpression tmpExpression(dataLiteralExpression,dataFacet); |
| 1779 |
expression = (CDataFacetRestrictionExpression*)getHashedExpression(&tmpExpression); |
| 1780 |
if (!expression) { |
| 1781 |
expression = new CDataFacetRestrictionExpression(dataLiteralExpression,dataFacet); |
| 1782 |
addHashedExpression(expression); |
| 1783 |
if (dynamic_cast<CDataLiteralExpression*>(dataLiteralExpression) && !mBuildDataRangeSet->contains(dataLiteralExpression)) { |
| 1784 |
mBuildDataRangeSet->insert(dataLiteralExpression); |
| 1785 |
mBuildDataRangeList->append(dataLiteralExpression); |
| 1786 |
} |
| 1787 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATATYPERESTRICTION); |
| 1788 |
} |
| 1789 |
return expression; |
| 1790 |
} |
| 1791 |
|
| 1792 |
|
| 1793 |
|
| 1794 |
|
| 1795 |
|
| 1796 |
|
| 1797 |
CDataIntersectionOfExpression* CConcreteOntologyBuildDataUpdater::getDataIntersectionOf(const CEXPRESSIONLIST<CDataRangeTermExpression*>& expressions) { |
| 1798 |
CDataIntersectionOfExpression* expression = nullptr; |
| 1799 |
CDataIntersectionOfExpression tmpExpression(expressions); |
| 1800 |
expression = (CDataIntersectionOfExpression*)getHashedExpression(&tmpExpression); |
| 1801 |
if (!expression) { |
| 1802 |
expression = new CDataIntersectionOfExpression(expressions); |
| 1803 |
addHashedExpression(expression); |
| 1804 |
mBuildDataRangeSet->insert(expression); |
| 1805 |
mBuildDataRangeList->append(expression); |
| 1806 |
for (CDataRangeTermExpression* exp: expressions) { |
| 1807 |
if (dynamic_cast<CDataLiteralExpression*>(exp) && !mBuildDataRangeSet->contains(exp)) { |
| 1808 |
mBuildDataRangeSet->insert(exp); |
| 1809 |
mBuildDataRangeList->append(exp); |
| 1810 |
} |
| 1811 |
} |
| 1812 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAINTERSECTIONOF); |
| 1813 |
} |
| 1814 |
return expression; |
| 1815 |
} |
| 1816 |
|
| 1817 |
CDataOneOfExpression* CConcreteOntologyBuildDataUpdater::getDataOneOf(const CEXPRESSIONLIST<CDataRangeTermExpression*>& expressions) { |
| 1818 |
CDataOneOfExpression* expression = nullptr; |
| 1819 |
CDataOneOfExpression tmpExpression(expressions); |
| 1820 |
expression = (CDataOneOfExpression*)getHashedExpression(&tmpExpression); |
| 1821 |
if (!expression) { |
| 1822 |
expression = new CDataOneOfExpression(expressions); |
| 1823 |
addHashedExpression(expression); |
| 1824 |
mBuildDataRangeSet->insert(expression); |
| 1825 |
mBuildDataRangeList->append(expression); |
| 1826 |
for (CDataRangeTermExpression* exp : expressions) { |
| 1827 |
if (dynamic_cast<CDataLiteralExpression*>(exp) && !mBuildDataRangeSet->contains(exp)) { |
| 1828 |
mBuildDataRangeSet->insert(exp); |
| 1829 |
mBuildDataRangeList->append(exp); |
| 1830 |
} |
| 1831 |
} |
| 1832 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAONEOF); |
| 1833 |
} |
| 1834 |
return expression; |
| 1835 |
} |
| 1836 |
|
| 1837 |
CDataUnionOfExpression* CConcreteOntologyBuildDataUpdater::getDataUnionOf(const CEXPRESSIONLIST<CDataRangeTermExpression*>& expressions) { |
| 1838 |
CDataUnionOfExpression* expression = nullptr; |
| 1839 |
CDataUnionOfExpression tmpExpression(expressions); |
| 1840 |
expression = (CDataUnionOfExpression*)getHashedExpression(&tmpExpression); |
| 1841 |
if (!expression) { |
| 1842 |
expression = new CDataUnionOfExpression(expressions); |
| 1843 |
addHashedExpression(expression); |
| 1844 |
mBuildDataRangeSet->insert(expression); |
| 1845 |
mBuildDataRangeList->append(expression); |
| 1846 |
for (CDataRangeTermExpression* exp : expressions) { |
| 1847 |
if (dynamic_cast<CDataLiteralExpression*>(exp) && !mBuildDataRangeSet->contains(exp)) { |
| 1848 |
mBuildDataRangeSet->insert(exp); |
| 1849 |
mBuildDataRangeList->append(exp); |
| 1850 |
} |
| 1851 |
} |
| 1852 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAUNIONOF); |
| 1853 |
} |
| 1854 |
return expression; |
| 1855 |
} |
| 1856 |
|
| 1857 |
CDataComplementOfExpression* CConcreteOntologyBuildDataUpdater::getDataComplementOf(CDataRangeTermExpression* expression1) { |
| 1858 |
CDataComplementOfExpression* expression = nullptr; |
| 1859 |
CDataComplementOfExpression tmpExpression(expression1); |
| 1860 |
expression = (CDataComplementOfExpression*)getHashedExpression(&tmpExpression); |
| 1861 |
if (!expression) { |
| 1862 |
expression = new CDataComplementOfExpression(expression1); |
| 1863 |
addHashedExpression(expression); |
| 1864 |
mBuildDataRangeSet->insert(expression); |
| 1865 |
mBuildDataRangeList->append(expression); |
| 1866 |
if (dynamic_cast<CDataLiteralExpression*>(expression1) && !mBuildDataRangeSet->contains(expression1)) { |
| 1867 |
mBuildDataRangeSet->insert(expression1); |
| 1868 |
mBuildDataRangeList->append(expression1); |
| 1869 |
} |
| 1870 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATACOMPLEMENTOF); |
| 1871 |
} |
| 1872 |
return expression; |
| 1873 |
} |
| 1874 |
|
| 1875 |
CDatatypeRestrictionExpression* CConcreteOntologyBuildDataUpdater::getDatatypeRestriction(CDatatypeExpression* datatypeExpression, const CEXPRESSIONLIST<CDataFacetRestrictionExpression*>& expressions) { |
| 1876 |
CDatatypeRestrictionExpression* expression = nullptr; |
| 1877 |
CDatatypeRestrictionExpression tmpExpression(datatypeExpression,expressions); |
| 1878 |
expression = (CDatatypeRestrictionExpression*)getHashedExpression(&tmpExpression);; |
| 1879 |
if (!expression) { |
| 1880 |
expression = new CDatatypeRestrictionExpression(datatypeExpression,expressions); |
| 1881 |
addHashedExpression(expression); |
| 1882 |
mBuildDataRangeSet->insert(expression); |
| 1883 |
mBuildDataRangeList->append(expression); |
| 1884 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAFACETRESTRICION); |
| 1885 |
} |
| 1886 |
return expression; |
| 1887 |
} |
| 1888 |
|
| 1889 |
|
| 1890 |
|
| 1891 |
|
| 1892 |
|
| 1893 |
|
| 1894 |
|
| 1895 |
|
| 1896 |
|
| 1897 |
|
| 1898 |
|
| 1899 |
|
| 1900 |
|
| 1901 |
|
| 1902 |
|
| 1903 |
|
| 1904 |
|
| 1905 |
|
| 1906 |
|
| 1907 |
CObjectSomeValuesFromExpression* CConcreteOntologyBuildDataUpdater::getObjectSomeValuesFrom(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2) { |
| 1908 |
CObjectSomeValuesFromExpression* expression = nullptr; |
| 1909 |
CObjectSomeValuesFromExpression tmpExpression(expression1,expression2); |
| 1910 |
expression = (CObjectSomeValuesFromExpression*)getHashedExpression(&tmpExpression); |
| 1911 |
if (!expression) { |
| 1912 |
expression = new CObjectSomeValuesFromExpression(expression1,expression2); |
| 1913 |
addHashedExpression(expression); |
| 1914 |
mBuildConceptSet->insert(expression); |
| 1915 |
mBuildConceptList->append(expression); |
| 1916 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTSOMEVALUEFROM); |
| 1917 |
} |
| 1918 |
return expression; |
| 1919 |
} |
| 1920 |
|
| 1921 |
CObjectHasValueExpression* CConcreteOntologyBuildDataUpdater::getObjectHasValue(CObjectPropertyTermExpression* expression1, CIndividualTermExpression* expression2) { |
| 1922 |
CObjectHasValueExpression* expression = nullptr; |
| 1923 |
CObjectHasValueExpression tmpExpression(expression1,expression2); |
| 1924 |
expression = (CObjectHasValueExpression*)getHashedExpression(&tmpExpression); |
| 1925 |
if (!expression) { |
| 1926 |
expression = new CObjectHasValueExpression(expression1,expression2); |
| 1927 |
addHashedExpression(expression); |
| 1928 |
mBuildConceptSet->insert(expression); |
| 1929 |
mBuildConceptList->append(expression); |
| 1930 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTHASVALUE); |
| 1931 |
} |
| 1932 |
return expression; |
| 1933 |
} |
| 1934 |
|
| 1935 |
CObjectHasSelfExpression* CConcreteOntologyBuildDataUpdater::getObjectHasSelf(CObjectPropertyTermExpression* obPrExpression) { |
| 1936 |
CObjectHasSelfExpression* expression = nullptr; |
| 1937 |
CObjectHasSelfExpression tmpExpression(obPrExpression); |
| 1938 |
expression = (CObjectHasSelfExpression*)getHashedExpression(&tmpExpression); |
| 1939 |
if (!expression) { |
| 1940 |
expression = new CObjectHasSelfExpression(obPrExpression); |
| 1941 |
addHashedExpression(expression); |
| 1942 |
mBuildConceptSet->insert(expression); |
| 1943 |
mBuildConceptList->append(expression); |
| 1944 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTHASSELF); |
| 1945 |
} |
| 1946 |
return expression; |
| 1947 |
} |
| 1948 |
|
| 1949 |
|
| 1950 |
CSubObjectPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getSubObjectPropertyOf(const CEXPRESSIONLIST<CObjectPropertyTermExpression*>& subExpressions, CObjectPropertyTermExpression* superExpression) { |
| 1951 |
CSubObjectPropertyOfExpression* expression = nullptr; |
| 1952 |
CSubObjectPropertyOfExpression tmpExpression(subExpressions,superExpression); |
| 1953 |
expression = (CSubObjectPropertyOfExpression*)getHashedExpression(&tmpExpression); |
| 1954 |
if (!expression) { |
| 1955 |
expression = new CSubObjectPropertyOfExpression(subExpressions,superExpression); |
| 1956 |
addHashedExpression(expression); |
| 1957 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETSUBOBJECTPROPERTYOF); |
| 1958 |
} |
| 1959 |
return expression; |
| 1960 |
} |
| 1961 |
|
| 1962 |
CSubObjectPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getSubObjectPropertyOf(CObjectPropertyChainExpression* expressions, CObjectPropertyTermExpression* superExpression) { |
| 1963 |
CSubObjectPropertyOfExpression* expression = nullptr; |
| 1964 |
expression = getSubObjectPropertyOf(*expressions->getChainObjectPropertyTermExpressionList(),superExpression); |
| 1965 |
return expression; |
| 1966 |
} |
| 1967 |
|
| 1968 |
|
| 1969 |
CObjectPropertyChainExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyChain(const CEXPRESSIONLIST<CObjectPropertyTermExpression*>& expressions) { |
| 1970 |
CObjectPropertyChainExpression* expression = nullptr; |
| 1971 |
CObjectPropertyChainExpression tmpExpression(expressions); |
| 1972 |
expression = (CObjectPropertyChainExpression*)getHashedExpression(&tmpExpression); |
| 1973 |
if (!expression) { |
| 1974 |
expression = new CObjectPropertyChainExpression(expressions); |
| 1975 |
addHashedExpression(expression); |
| 1976 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTPROPERTYCHAIN); |
| 1977 |
} |
| 1978 |
return expression; |
| 1979 |
} |
| 1980 |
|
| 1981 |
CEquivalentObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentObjectProperties(const CEXPRESSIONLIST<CObjectPropertyTermExpression*>& expressions) { |
| 1982 |
CEquivalentObjectPropertiesExpression* expression = nullptr; |
| 1983 |
CEquivalentObjectPropertiesExpression tmpExpression(expressions); |
| 1984 |
expression = (CEquivalentObjectPropertiesExpression*)getHashedExpression(&tmpExpression); |
| 1985 |
if (!expression) { |
| 1986 |
expression = new CEquivalentObjectPropertiesExpression(expressions); |
| 1987 |
addHashedExpression(expression); |
| 1988 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETEQUIVALENTOBJECTPROPERTIES); |
| 1989 |
} |
| 1990 |
return expression; |
| 1991 |
} |
| 1992 |
|
| 1993 |
CDisjointObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getDisjointObjectProperties(const CEXPRESSIONLIST<CObjectPropertyTermExpression*>& expressions) { |
| 1994 |
CDisjointObjectPropertiesExpression* expression = nullptr; |
| 1995 |
CDisjointObjectPropertiesExpression tmpExpression(expressions); |
| 1996 |
expression = (CDisjointObjectPropertiesExpression*)getHashedExpression(&tmpExpression); |
| 1997 |
if (!expression) { |
| 1998 |
expression = new CDisjointObjectPropertiesExpression(expressions); |
| 1999 |
addHashedExpression(expression); |
| 2000 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDISJOINTOBJECTPROPERTIES); |
| 2001 |
} |
| 2002 |
return expression; |
| 2003 |
} |
| 2004 |
|
| 2005 |
|
| 2006 |
CObjectPropertyDomainExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyDomainExpression(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2) { |
| 2007 |
CObjectPropertyDomainExpression* expression = nullptr; |
| 2008 |
CObjectPropertyDomainExpression tmpExpression(expression1,expression2); |
| 2009 |
expression = (CObjectPropertyDomainExpression*)getHashedExpression(&tmpExpression); |
| 2010 |
if (!expression) { |
| 2011 |
expression = new CObjectPropertyDomainExpression(expression1,expression2); |
| 2012 |
addHashedExpression(expression); |
| 2013 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTPROPERTYDOMAIN); |
| 2014 |
} |
| 2015 |
return expression; |
| 2016 |
} |
| 2017 |
|
| 2018 |
CObjectPropertyRangeExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyRangeExpression(CObjectPropertyTermExpression* expression1, CClassTermExpression* expression2) { |
| 2019 |
CObjectPropertyRangeExpression* expression = nullptr; |
| 2020 |
CObjectPropertyRangeExpression tmpExpression(expression1,expression2); |
| 2021 |
expression = (CObjectPropertyRangeExpression*)getHashedExpression(&tmpExpression); |
| 2022 |
if (!expression) { |
| 2023 |
expression = new CObjectPropertyRangeExpression(expression1,expression2); |
| 2024 |
addHashedExpression(expression); |
| 2025 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTPROPERTYRANGE); |
| 2026 |
} |
| 2027 |
return expression; |
| 2028 |
} |
| 2029 |
|
| 2030 |
|
| 2031 |
|
| 2032 |
|
| 2033 |
|
| 2034 |
|
| 2035 |
|
| 2036 |
|
| 2037 |
CSubDataPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getSubDataPropertyOf(CDataPropertyTermExpression* subExpression, CDataPropertyTermExpression* superExpression) { |
| 2038 |
CSubDataPropertyOfExpression* expression = nullptr; |
| 2039 |
CSubDataPropertyOfExpression tmpExpression(subExpression,superExpression); |
| 2040 |
expression = (CSubDataPropertyOfExpression*)getHashedExpression(&tmpExpression); |
| 2041 |
if (!expression) { |
| 2042 |
expression = new CSubDataPropertyOfExpression(subExpression,superExpression); |
| 2043 |
addHashedExpression(expression); |
| 2044 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETSUBDATAPROPERTYOF); |
| 2045 |
} |
| 2046 |
return expression; |
| 2047 |
} |
| 2048 |
|
| 2049 |
CEquivalentDataPropertiesExpression* CConcreteOntologyBuildDataUpdater::getEquivalentDataProperties(const CEXPRESSIONLIST<CDataPropertyTermExpression*>& expressions) { |
| 2050 |
CEquivalentDataPropertiesExpression* expression = nullptr; |
| 2051 |
CEquivalentDataPropertiesExpression tmpExpression(expressions); |
| 2052 |
expression = (CEquivalentDataPropertiesExpression*)getHashedExpression(&tmpExpression); |
| 2053 |
if (!expression) { |
| 2054 |
expression = new CEquivalentDataPropertiesExpression(expressions); |
| 2055 |
addHashedExpression(expression); |
| 2056 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETEQUIVALENTDATAPROPERTIES); |
| 2057 |
} |
| 2058 |
return expression; |
| 2059 |
} |
| 2060 |
|
| 2061 |
CDisjointDataPropertiesExpression* CConcreteOntologyBuildDataUpdater::getDisjointDataProperties(const CEXPRESSIONLIST<CDataPropertyTermExpression*>& expressions) { |
| 2062 |
CDisjointDataPropertiesExpression* expression = nullptr; |
| 2063 |
CDisjointDataPropertiesExpression tmpExpression(expressions); |
| 2064 |
expression = (CDisjointDataPropertiesExpression*)getHashedExpression(&tmpExpression); |
| 2065 |
if (!expression) { |
| 2066 |
expression = new CDisjointDataPropertiesExpression(expressions); |
| 2067 |
addHashedExpression(expression); |
| 2068 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDISJOINTDATAPROPERTIES); |
| 2069 |
} |
| 2070 |
return expression; |
| 2071 |
} |
| 2072 |
|
| 2073 |
|
| 2074 |
CDataPropertyDomainExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyDomainExpression(CDataPropertyTermExpression* expression1, CClassTermExpression* expression2) { |
| 2075 |
CDataPropertyDomainExpression* expression = nullptr; |
| 2076 |
CDataPropertyDomainExpression tmpExpression(expression1,expression2); |
| 2077 |
expression = (CDataPropertyDomainExpression*)getHashedExpression(&tmpExpression); |
| 2078 |
if (!expression) { |
| 2079 |
expression = new CDataPropertyDomainExpression(expression1,expression2); |
| 2080 |
addHashedExpression(expression); |
| 2081 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAPROPERTYDOMAIN); |
| 2082 |
} |
| 2083 |
return expression; |
| 2084 |
} |
| 2085 |
|
| 2086 |
CDataPropertyRangeExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyRangeExpression(CDataPropertyTermExpression* expression1, CDataRangeTermExpression* expression2) { |
| 2087 |
CDataPropertyRangeExpression* expression = nullptr; |
| 2088 |
CDataPropertyRangeExpression tmpExpression(expression1,expression2); |
| 2089 |
expression = (CDataPropertyRangeExpression*)getHashedExpression(&tmpExpression); |
| 2090 |
if (!expression) { |
| 2091 |
expression = new CDataPropertyRangeExpression(expression1,expression2); |
| 2092 |
addHashedExpression(expression); |
| 2093 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAPROPERTYRANGE); |
| 2094 |
} |
| 2095 |
return expression; |
| 2096 |
} |
| 2097 |
|
| 2098 |
CFunctionalDataPropertyExpression* CConcreteOntologyBuildDataUpdater::getFunctionalDataProperty(CDataPropertyTermExpression* buildExpression) { |
| 2099 |
CFunctionalDataPropertyExpression* expression = nullptr; |
| 2100 |
CFunctionalDataPropertyExpression tmpExpression(buildExpression); |
| 2101 |
expression = (CFunctionalDataPropertyExpression*)getHashedExpression(&tmpExpression); |
| 2102 |
if (!expression) { |
| 2103 |
expression = new CFunctionalDataPropertyExpression(buildExpression); |
| 2104 |
addHashedExpression(expression); |
| 2105 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETFUNCTIONALPROPERTYOF); |
| 2106 |
} |
| 2107 |
return expression; |
| 2108 |
} |
| 2109 |
|
| 2110 |
|
| 2111 |
|
| 2112 |
|
| 2113 |
|
| 2114 |
|
| 2115 |
|
| 2116 |
|
| 2117 |
CInverseObjectPropertiesExpression* CConcreteOntologyBuildDataUpdater::getInverseObjectProperties(CObjectPropertyTermExpression* expression1, CObjectPropertyTermExpression* expression2) { |
| 2118 |
CInverseObjectPropertiesExpression* expression = nullptr; |
| 2119 |
CInverseObjectPropertiesExpression tmpExpression(expression1,expression2); |
| 2120 |
expression = (CInverseObjectPropertiesExpression*)getHashedExpression(&tmpExpression); |
| 2121 |
if (!expression) { |
| 2122 |
expression = new CInverseObjectPropertiesExpression(expression1,expression2); |
| 2123 |
addHashedExpression(expression); |
| 2124 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETINVERSEOBJECTPROPERTIES); |
| 2125 |
} |
| 2126 |
return expression; |
| 2127 |
} |
| 2128 |
|
| 2129 |
CTransetiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getTransetiveObjectProperty(CObjectPropertyTermExpression* buildExpression) { |
| 2130 |
CTransetiveObjectPropertyExpression* expression = nullptr; |
| 2131 |
CTransetiveObjectPropertyExpression tmpExpression(buildExpression); |
| 2132 |
expression = (CTransetiveObjectPropertyExpression*)getHashedExpression(&tmpExpression); |
| 2133 |
if (!expression) { |
| 2134 |
expression = new CTransetiveObjectPropertyExpression(buildExpression); |
| 2135 |
addHashedExpression(expression); |
| 2136 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETTRANSETIVEPROPERTYOF); |
| 2137 |
} |
| 2138 |
return expression; |
| 2139 |
} |
| 2140 |
|
| 2141 |
CFunctionalObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getFunctionalObjectProperty(CObjectPropertyTermExpression* buildExpression) { |
| 2142 |
CFunctionalObjectPropertyExpression* expression = nullptr; |
| 2143 |
CFunctionalObjectPropertyExpression tmpExpression(buildExpression); |
| 2144 |
expression = (CFunctionalObjectPropertyExpression*)getHashedExpression(&tmpExpression); |
| 2145 |
if (!expression) { |
| 2146 |
expression = new CFunctionalObjectPropertyExpression(buildExpression); |
| 2147 |
addHashedExpression(expression); |
| 2148 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETFUNCTIONALOBJECTPROPERTY); |
| 2149 |
} |
| 2150 |
return expression; |
| 2151 |
} |
| 2152 |
|
| 2153 |
|
| 2154 |
CInverseFunctionalObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getInverseFunctionalObjectProperty(CObjectPropertyTermExpression* buildExpression) { |
| 2155 |
CInverseFunctionalObjectPropertyExpression* expression = nullptr; |
| 2156 |
CInverseFunctionalObjectPropertyExpression tmpExpression(buildExpression); |
| 2157 |
expression = (CInverseFunctionalObjectPropertyExpression*)getHashedExpression(&tmpExpression); |
| 2158 |
if (!expression) { |
| 2159 |
expression = new CInverseFunctionalObjectPropertyExpression(buildExpression); |
| 2160 |
addHashedExpression(expression); |
| 2161 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETINVERSEFUNCTIONALPROPERTY); |
| 2162 |
} |
| 2163 |
return expression; |
| 2164 |
} |
| 2165 |
|
| 2166 |
CSymmetricObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getSymmetricObjectProperty(CObjectPropertyTermExpression* buildExpression) { |
| 2167 |
CSymmetricObjectPropertyExpression* expression = nullptr; |
| 2168 |
CSymmetricObjectPropertyExpression tmpExpression(buildExpression); |
| 2169 |
expression = (CSymmetricObjectPropertyExpression*)getHashedExpression(&tmpExpression); |
| 2170 |
if (!expression) { |
| 2171 |
expression = new CSymmetricObjectPropertyExpression(buildExpression); |
| 2172 |
addHashedExpression(expression); |
| 2173 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETSYMMETRICPROPERTY); |
| 2174 |
} |
| 2175 |
return expression; |
| 2176 |
} |
| 2177 |
|
| 2178 |
CAsymmetricObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getAsymmetricObjectProperty(CObjectPropertyTermExpression* buildExpression) { |
| 2179 |
CAsymmetricObjectPropertyExpression* expression = nullptr; |
| 2180 |
CAsymmetricObjectPropertyExpression tmpExpression(buildExpression); |
| 2181 |
expression = (CAsymmetricObjectPropertyExpression*)getHashedExpression(&tmpExpression); |
| 2182 |
if (!expression) { |
| 2183 |
expression = new CAsymmetricObjectPropertyExpression(buildExpression); |
| 2184 |
addHashedExpression(expression); |
| 2185 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETASYMMETRICPROPERTY); |
| 2186 |
} |
| 2187 |
return expression; |
| 2188 |
} |
| 2189 |
|
| 2190 |
CReflexiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getReflexiveObjectProperty(CObjectPropertyTermExpression* buildExpression) { |
| 2191 |
CReflexiveObjectPropertyExpression* expression = nullptr; |
| 2192 |
CReflexiveObjectPropertyExpression tmpExpression(buildExpression); |
| 2193 |
expression = (CReflexiveObjectPropertyExpression*)getHashedExpression(&tmpExpression); |
| 2194 |
if (!expression) { |
| 2195 |
expression = new CReflexiveObjectPropertyExpression(buildExpression); |
| 2196 |
addHashedExpression(expression); |
| 2197 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETREFLEXIVEPROPERTY); |
| 2198 |
} |
| 2199 |
return expression; |
| 2200 |
} |
| 2201 |
|
| 2202 |
|
| 2203 |
CIrreflexiveObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getIrreflexiveObjectProperty(CObjectPropertyTermExpression* buildExpression) { |
| 2204 |
CIrreflexiveObjectPropertyExpression* expression = nullptr; |
| 2205 |
CIrreflexiveObjectPropertyExpression tmpExpression(buildExpression); |
| 2206 |
expression = (CIrreflexiveObjectPropertyExpression*)getHashedExpression(&tmpExpression); |
| 2207 |
if (!expression) { |
| 2208 |
expression = new CIrreflexiveObjectPropertyExpression(buildExpression); |
| 2209 |
addHashedExpression(expression); |
| 2210 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETIRREFLEXIVEPROPERTY); |
| 2211 |
} |
| 2212 |
return expression; |
| 2213 |
} |
| 2214 |
|
| 2215 |
CInverseObjectPropertyOfExpression* CConcreteOntologyBuildDataUpdater::getInverseObjectPropertyOf(CObjectPropertyTermExpression* buildExpression) { |
| 2216 |
CInverseObjectPropertyOfExpression* expression = nullptr; |
| 2217 |
CInverseObjectPropertyOfExpression tmpExpression(buildExpression); |
| 2218 |
expression = (CInverseObjectPropertyOfExpression*)getHashedExpression(&tmpExpression); |
| 2219 |
if (!expression) { |
| 2220 |
expression = new CInverseObjectPropertyOfExpression(buildExpression); |
| 2221 |
addHashedExpression(expression); |
| 2222 |
mBuildObjectRoleSet->insert(expression); |
| 2223 |
mBuildObjectRoleList->append(expression); |
| 2224 |
mInverseObjectPropertyHash->insert(buildExpression,expression); |
| 2225 |
mInverseObjectPropertyHash->insert(expression,buildExpression); |
| 2226 |
mInverseObjectPropertyList->append( QPair<CObjectPropertyTermExpression*,CObjectPropertyTermExpression*>(expression,buildExpression) ); |
| 2227 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETINVERSEOBJECTPROPERTYOF); |
| 2228 |
} |
| 2229 |
return expression; |
| 2230 |
} |
| 2231 |
|
| 2232 |
|
| 2233 |
CObjectPropertyTermExpression* CConcreteOntologyBuildDataUpdater::getCorrectedInverseObjectPropertyOf(CObjectPropertyTermExpression* invExpression) { |
| 2234 |
CInverseObjectPropertyOfExpression* invCastExpression = dynamic_cast<CInverseObjectPropertyOfExpression*>(invExpression); |
| 2235 |
if (invCastExpression) { |
| 2236 |
return invCastExpression->getInverseOfExpression(); |
| 2237 |
} |
| 2238 |
CObjectPropertyTermExpression* inverseObjPropTermExp = mInverseObjectPropertyHash->value(invExpression, nullptr); |
| 2239 |
if (inverseObjPropTermExp) { |
| 2240 |
return inverseObjPropTermExp; |
| 2241 |
} |
| 2242 |
CInverseObjectPropertyOfExpression* expression = nullptr; |
| 2243 |
expression = getInverseObjectPropertyOf(invExpression); |
| 2244 |
return expression; |
| 2245 |
} |
| 2246 |
|
| 2247 |
|
| 2248 |
|
| 2249 |
CClassAssertionExpression* CConcreteOntologyBuildDataUpdater::getClassAssertion(CIndividualTermExpression* expression1, CClassTermExpression* expression2) { |
| 2250 |
CClassAssertionExpression* expression = nullptr; |
| 2251 |
CClassAssertionExpression tmpExpression(expression1,expression2); |
| 2252 |
expression = (CClassAssertionExpression*)getHashedExpression(&tmpExpression); |
| 2253 |
if (!expression) { |
| 2254 |
expression = new CClassAssertionExpression(expression1,expression2); |
| 2255 |
addHashedExpression(expression); |
| 2256 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETCLASSASSERTION); |
| 2257 |
} |
| 2258 |
return expression; |
| 2259 |
} |
| 2260 |
|
| 2261 |
CObjectPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyAssertion(CIndividualTermExpression* expression1, CIndividualTermExpression* expression2, CObjectPropertyTermExpression* expression3) { |
| 2262 |
CObjectPropertyAssertionExpression* expression = nullptr; |
| 2263 |
CObjectPropertyAssertionExpression tmpExpression(expression3,expression1,expression2); |
| 2264 |
expression = (CObjectPropertyAssertionExpression*)getHashedExpression(&tmpExpression); |
| 2265 |
if (!expression) { |
| 2266 |
expression = new CObjectPropertyAssertionExpression(expression3,expression1,expression2); |
| 2267 |
addHashedExpression(expression); |
| 2268 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTPROPERTYASSERTION); |
| 2269 |
} |
| 2270 |
return expression; |
| 2271 |
} |
| 2272 |
|
| 2273 |
CNegativeObjectPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getNegativeObjectPropertyAssertion(CIndividualTermExpression* expression1, CIndividualTermExpression* expression2, CObjectPropertyTermExpression* expression3) { |
| 2274 |
CNegativeObjectPropertyAssertionExpression* expression = nullptr; |
| 2275 |
CNegativeObjectPropertyAssertionExpression tmpExpression(expression3,expression1,expression2); |
| 2276 |
expression = (CNegativeObjectPropertyAssertionExpression*)getHashedExpression(&tmpExpression); |
| 2277 |
if (!expression) { |
| 2278 |
expression = new CNegativeObjectPropertyAssertionExpression(expression3,expression1,expression2); |
| 2279 |
addHashedExpression(expression); |
| 2280 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETNEGATIVEOBJECTPROPERTYASSERTION); |
| 2281 |
} |
| 2282 |
return expression; |
| 2283 |
} |
| 2284 |
|
| 2285 |
CSameIndividualExpression* CConcreteOntologyBuildDataUpdater::getSameIndividual(const CEXPRESSIONLIST<CIndividualTermExpression*>& expressions) { |
| 2286 |
CSameIndividualExpression* expression = nullptr; |
| 2287 |
CSameIndividualExpression tmpExpression(expressions); |
| 2288 |
expression = (CSameIndividualExpression*)getHashedExpression(&tmpExpression); |
| 2289 |
if (!expression) { |
| 2290 |
expression = new CSameIndividualExpression(expressions); |
| 2291 |
addHashedExpression(expression); |
| 2292 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETSAMEINDIVIDUAL); |
| 2293 |
} |
| 2294 |
return expression; |
| 2295 |
} |
| 2296 |
|
| 2297 |
CDifferentIndividualsExpression* CConcreteOntologyBuildDataUpdater::getDifferentIndividuals(const CEXPRESSIONLIST<CIndividualTermExpression*>& expressions) { |
| 2298 |
CDifferentIndividualsExpression* expression = nullptr; |
| 2299 |
CDifferentIndividualsExpression tmpExpression(expressions); |
| 2300 |
expression = (CDifferentIndividualsExpression*)getHashedExpression(&tmpExpression); |
| 2301 |
if (!expression) { |
| 2302 |
expression = new CDifferentIndividualsExpression(expressions); |
| 2303 |
addHashedExpression(expression); |
| 2304 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDIFFERENTINDIVIDUAL); |
| 2305 |
} |
| 2306 |
return expression; |
| 2307 |
} |
| 2308 |
|
| 2309 |
|
| 2310 |
|
| 2311 |
CDataPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyAssertion(CIndividualTermExpression* expression1, CDataLiteralTermExpression* expression2, CDataPropertyTermExpression* expression3) { |
| 2312 |
CDataPropertyAssertionExpression* expression = nullptr; |
| 2313 |
CDataPropertyAssertionExpression tmpExpression(expression3,expression1,expression2); |
| 2314 |
expression = (CDataPropertyAssertionExpression*)getHashedExpression(&tmpExpression); |
| 2315 |
if (!expression) { |
| 2316 |
expression = new CDataPropertyAssertionExpression(expression3,expression1,expression2); |
| 2317 |
addHashedExpression(expression); |
| 2318 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAPROPERTYASSERTION); |
| 2319 |
} |
| 2320 |
return expression; |
| 2321 |
} |
| 2322 |
|
| 2323 |
CNegativeDataPropertyAssertionExpression* CConcreteOntologyBuildDataUpdater::getNegativeDataPropertyAssertion(CIndividualTermExpression* expression1, CDataLiteralTermExpression* expression2, CDataPropertyTermExpression* expression3) { |
| 2324 |
CNegativeDataPropertyAssertionExpression* expression = nullptr; |
| 2325 |
CNegativeDataPropertyAssertionExpression tmpExpression(expression3,expression1,expression2); |
| 2326 |
expression = (CNegativeDataPropertyAssertionExpression*)getHashedExpression(&tmpExpression); |
| 2327 |
if (!expression) { |
| 2328 |
expression = new CNegativeDataPropertyAssertionExpression(expression3,expression1,expression2); |
| 2329 |
addHashedExpression(expression); |
| 2330 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETNEGATIVEDATAPROPERTYASSERTION); |
| 2331 |
} |
| 2332 |
return expression; |
| 2333 |
} |
| 2334 |
|
| 2335 |
|
| 2336 |
|
| 2337 |
|
| 2338 |
|
| 2339 |
bool CConcreteOntologyBuildDataUpdater::addTriplesData(CTriplesData* tripleData) { |
| 2340 |
mOntologyTriplesData->addTriplesData(tripleData); |
| 2341 |
return true; |
| 2342 |
} |
| 2343 |
|
| 2344 |
CTriplesData* CConcreteOntologyBuildDataUpdater::getLatestTriplesData(bool onlyLocal, bool* localFlag) { |
| 2345 |
CTriplesData* tripleData = mOntologyTriplesData->getLatestTriplesData(onlyLocal); |
| 2346 |
if (localFlag && tripleData) { |
| 2347 |
if (mOntologyTriplesData->getLatestTriplesData(true)) { |
| 2348 |
*localFlag = true; |
| 2349 |
} else { |
| 2350 |
*localFlag = false; |
| 2351 |
} |
| 2352 |
} |
| 2353 |
return tripleData; |
| 2354 |
} |
| 2355 |
|
| 2356 |
|
| 2357 |
|
| 2358 |
|
| 2359 |
|
| 2360 |
bool CConcreteOntologyBuildDataUpdater::initializeBuilding() { |
| 2361 |
|
| 2362 |
mTmpObjectOneOfExpression = nullptr; |
| 2363 |
|
| 2364 |
|
| 2365 |
mMemManager = CContext::getMemoryAllocationManager(mOnto->getOntologyContext()); |
| 2366 |
|
| 2367 |
mOntoStrings = mOnto->getStringMapping(); |
| 2368 |
mOntoBuild = mOnto->getBuildData(); |
| 2369 |
|
| 2370 |
mBuildExpCounter = mOntoBuild->getBuildExpressionCounter(); |
| 2371 |
|
| 2372 |
mDeclarationAxiomSet = mOntoBuild->getDeclarationAxiomSet(); |
| 2373 |
|
| 2374 |
mTopClassExpression = mOntoBuild->getTopClassExpression(); |
| 2375 |
mBottomClassExpression = mOntoBuild->getBottomClassExpression(); |
| 2376 |
mTopObjPropExpression = mOntoBuild->getTopObjectPropertyExpression(); |
| 2377 |
mBottomObjPropExpression = mOntoBuild->getBottomObjectPropertyExpression(); |
| 2378 |
|
| 2379 |
mTopDataRangeExpression = mOntoBuild->getTopDataRangeExpression(); |
| 2380 |
mBottomDataRangeExpression = mOntoBuild->getBottomDataRangeExpression(); |
| 2381 |
|
| 2382 |
mTopDataPropExpression = mOntoBuild->getTopDataPropertyExpression(); |
| 2383 |
mBottomDataPropExpression = mOntoBuild->getBottomDataPropertyExpression(); |
| 2384 |
|
| 2385 |
mBuildConceptSet = mOntoBuild->getBuildConceptSet(); |
| 2386 |
mBuildObjectRoleSet = mOntoBuild->getBuildObjectRoleSet(); |
| 2387 |
mBuildIndividualSet = mOntoBuild->getBuildIndividualSet(); |
| 2388 |
mBuildDataRoleSet = mOntoBuild->getBuildDataRoleSet(); |
| 2389 |
mBuildDatatypeSet = mOntoBuild->getBuildDatatypeSet(); |
| 2390 |
mBuildDataRangeSet = mOntoBuild->getBuildDataRangeSet(); |
| 2391 |
|
| 2392 |
mBuildConceptList = mOntoBuild->getBuildConceptList(); |
| 2393 |
mBuildObjectRoleList = mOntoBuild->getBuildObjectRoleList(); |
| 2394 |
mBuildIndividualList = mOntoBuild->getBuildIndividualList(); |
| 2395 |
mBuildDataRoleList = mOntoBuild->getBuildDataRoleList(); |
| 2396 |
mBuildDataRangeList = mOntoBuild->getBuildDataRangeList(); |
| 2397 |
mBuildDatatypeList = mOntoBuild->getBuildDatatypeList(); |
| 2398 |
|
| 2399 |
mExpressionBuildContainerList = mOntoBuild->getExpressionBuildListContainer(); |
| 2400 |
mInverseObjectPropertyHash = mOntoBuild->getInverseObjectPropertyHash(); |
| 2401 |
mInverseObjectPropertyList = mOntoBuild->getInverseObjectPropertyList(); |
| 2402 |
|
| 2403 |
mExpressionBuildHash = mOntoBuild->getStructuralExpressionBuildHash(); |
| 2404 |
|
| 2405 |
mClassBuildHash = mOntoBuild->getClassEntityBuildHash(); |
| 2406 |
mObjectPropertyBuildHash = mOntoBuild->getObjectPropertyEntityBuildHash(); |
| 2407 |
mIndividualBuildHash = mOntoBuild->getIndividualEntityBuildHash(); |
| 2408 |
mAnoIndividualBuildHash = mOntoBuild->getAnonymousIndividualBuildHash(); |
| 2409 |
mNominalIndividualVariableBuildHash = mOntoBuild->getNominalIndividualVariableBuildHash(); |
| 2410 |
|
| 2411 |
mAnonymousIndividualVariableBuildHash = mOntoBuild->getAnonymousIndividualVariableBuildHash(); |
| 2412 |
mNamedIndividualVariableBuildHash = mOntoBuild->getNamedIndividualVariableBuildHash(); |
| 2413 |
|
| 2414 |
mDataValueVariableBuildHash = mOntoBuild->getDataValueVariableBuildHash(); |
| 2415 |
mDataLiteralVariableBuildHash = mOntoBuild->getDataLiteralVariableBuildHash(); |
| 2416 |
|
| 2417 |
mClassVariableBuildHash = mOntoBuild->getClassVariableBuildHash(); |
| 2418 |
mObjectPropertyVariableBuildHash = mOntoBuild->getObjectPropertyVariableBuildHash(); |
| 2419 |
mDataPropertyVariableBuildHash = mOntoBuild->getDataPropertyVariableBuildHash(); |
| 2420 |
|
| 2421 |
|
| 2422 |
mDataPropertyBuildHash = mOntoBuild->getDataPropertyEntityBuildHash(); |
| 2423 |
mDataLexicalValueBuildHash = mOntoBuild->getDataLexicalValueBuildHash(); |
| 2424 |
|
| 2425 |
mNextAxiomNumber = mOntoBuild->getNextAxiomNumber(); |
| 2426 |
mNextEntityNumber = mOntoBuild->getNextEntityNumber(); |
| 2427 |
mNextMaxAxiomNumberOffset = 0; |
| 2428 |
|
| 2429 |
|
| 2430 |
mAbbreviatedNamePrefixMapHash = mOntoStrings->getAbbreviatedNamePrefixHash(); |
| 2431 |
mNamePrefixMapHash = mOntoStrings->getNamePrefixHash(); |
| 2432 |
mPrefixList = mOntoStrings->getPrefixList(); |
| 2433 |
|
| 2434 |
mIndividualVariableIDHash = mOntoBuild->getIndividualVariableIDHash(); |
| 2435 |
|
| 2436 |
mDatatypeBuildHash = mOntoBuild->getDatatypeIRIBuildHash(); |
| 2437 |
mDataFacetBuildHash = mOntoBuild->getFacetIRIBuildHash(); |
| 2438 |
|
| 2439 |
mImportDataHash = mOntoBuild->getImportDataHash(); |
| 2440 |
|
| 2441 |
mOntologyTriplesData = mOnto->getOntologyTriplesData(); |
| 2442 |
return true; |
| 2443 |
} |
| 2444 |
|
| 2445 |
|
| 2446 |
|
| 2447 |
bool CConcreteOntologyBuildDataUpdater::completeBuilding() { |
| 2448 |
|
| 2449 |
delete mTmpObjectOneOfExpression; |
| 2450 |
mTmpObjectOneOfExpression = nullptr; |
| 2451 |
|
| 2452 |
return true; |
| 2453 |
} |
| 2454 |
|
| 2455 |
|
| 2456 |
cint64 CConcreteOntologyBuildDataUpdater::getAxiomNumber() { |
| 2457 |
return mNextAxiomNumber; |
| 2458 |
} |
| 2459 |
|
| 2460 |
CDataRangeTermExpression* CConcreteOntologyBuildDataUpdater::getTopDataRange() { |
| 2461 |
return mTopDataRangeExpression; |
| 2462 |
} |
| 2463 |
|
| 2464 |
CDataRangeTermExpression* CConcreteOntologyBuildDataUpdater::getBottomDataRange() { |
| 2465 |
return mBottomDataRangeExpression; |
| 2466 |
} |
| 2467 |
|
| 2468 |
|
| 2469 |
|
| 2470 |
CObjectPropertyTermExpression* CConcreteOntologyBuildDataUpdater::getTopObjectProberty() { |
| 2471 |
return mTopObjPropExpression; |
| 2472 |
} |
| 2473 |
|
| 2474 |
|
| 2475 |
CObjectPropertyTermExpression* CConcreteOntologyBuildDataUpdater::getBottomObjectProberty() { |
| 2476 |
return mBottomObjPropExpression; |
| 2477 |
} |
| 2478 |
|
| 2479 |
CClassTermExpression* CConcreteOntologyBuildDataUpdater::getTopClass() { |
| 2480 |
CClassTermExpression* expression = mTopClassExpression; |
| 2481 |
return expression; |
| 2482 |
} |
| 2483 |
|
| 2484 |
CClassTermExpression* CConcreteOntologyBuildDataUpdater::getBottomClass() { |
| 2485 |
CClassTermExpression* expression = mBottomClassExpression; |
| 2486 |
return expression; |
| 2487 |
} |
| 2488 |
|
| 2489 |
|
| 2490 |
|
| 2491 |
|
| 2492 |
bool CConcreteOntologyBuildDataUpdater::addOntologyImport(const QStringRef& name) { |
| 2493 |
if (!mImportDataHash->contains(CStringRefStringHasher(name))) { |
| 2494 |
QString importIRIString = name.toString(); |
| 2495 |
COntologyImportData*& importData = (*mImportDataHash)[CStringRefStringHasher(importIRIString)]; |
| 2496 |
importData = new COntologyImportData(); |
| 2497 |
importData->initOntologyImportData(importIRIString); |
| 2498 |
return true; |
| 2499 |
} |
| 2500 |
return false; |
| 2501 |
} |
| 2502 |
|
| 2503 |
bool CConcreteOntologyBuildDataUpdater::addOntologyImport(const QString& name) { |
| 2504 |
COntologyImportData*& importData = (*mImportDataHash)[CStringRefStringHasher(name)]; |
| 2505 |
if (!importData) { |
| 2506 |
importData = new COntologyImportData(); |
| 2507 |
importData->initOntologyImportData(name); |
| 2508 |
return true; |
| 2509 |
} |
| 2510 |
return false; |
| 2511 |
} |
| 2512 |
|
| 2513 |
|
| 2514 |
|
| 2515 |
|
| 2516 |
|
| 2517 |
bool CConcreteOntologyBuildDataUpdater::addNameAbbreviation(const QString &name, const QString &abbreviatedName) { |
| 2518 |
CNamePrefix* previousNamePrefix = mAbbreviatedNamePrefixMapHash->value(abbreviatedName); |
| 2519 |
if (!previousNamePrefix || previousNamePrefix->getPrefixString() != name) { |
| 2520 |
CNamePrefix* namePrefix = new CNamePrefix(abbreviatedName,name); |
| 2521 |
mAbbreviatedNamePrefixMapHash->insert(abbreviatedName,namePrefix); |
| 2522 |
mNamePrefixMapHash->insert(name,namePrefix); |
| 2523 |
mPrefixList->append(namePrefix); |
| 2524 |
return true; |
| 2525 |
} else { |
| 2526 |
return false; |
| 2527 |
} |
| 2528 |
} |
| 2529 |
|
| 2530 |
QString CConcreteOntologyBuildDataUpdater::getOntologyName() { |
| 2531 |
return mOnto->getOntologyName(); |
| 2532 |
} |
| 2533 |
|
| 2534 |
QString CConcreteOntologyBuildDataUpdater::resolveAbbreviationName(const QString& name) { |
| 2535 |
QString resolvedString(name); |
| 2536 |
cint64 colonPos = name.indexOf(":"); |
| 2537 |
if (colonPos >= 0 && colonPos < name.length()) { |
| 2538 |
QString abbName = name.mid(0,colonPos); |
| 2539 |
QString idName = name.mid(colonPos+1); |
| 2540 |
CNamePrefix* namePrefix = mAbbreviatedNamePrefixMapHash->value(abbName,nullptr); |
| 2541 |
if (namePrefix) { |
| 2542 |
resolvedString = namePrefix->getPrefixString()+idName; |
| 2543 |
} |
| 2544 |
} |
| 2545 |
return resolvedString; |
| 2546 |
} |
| 2547 |
|
| 2548 |
QString CConcreteOntologyBuildDataUpdater::resolveAbbreviationName(const QStringRef& name) { |
| 2549 |
QString resolvedString(name.toString()); |
| 2550 |
cint64 colonPos = resolvedString.indexOf(":"); |
| 2551 |
if (colonPos >= 0 && colonPos < resolvedString.length()) { |
| 2552 |
QString abbName = resolvedString.mid(0,colonPos); |
| 2553 |
QString idName = resolvedString.mid(colonPos+1); |
| 2554 |
CNamePrefix* namePrefix = mAbbreviatedNamePrefixMapHash->value(abbName,nullptr); |
| 2555 |
if (namePrefix) { |
| 2556 |
resolvedString = namePrefix->getPrefixString()+idName; |
| 2557 |
} |
| 2558 |
} |
| 2559 |
return resolvedString; |
| 2560 |
} |
| 2561 |
|
| 2562 |
CClassExpression* CConcreteOntologyBuildDataUpdater::getClass(const QString& className) { |
| 2563 |
CClassExpression* expression = nullptr; |
| 2564 |
expression = mClassBuildHash->value(className); |
| 2565 |
if (!expression) { |
| 2566 |
expression = new CClassExpression(className); |
| 2567 |
expression->setEntityID(mNextEntityNumber++); |
| 2568 |
mClassBuildHash->insert(className,expression); |
| 2569 |
mBuildConceptSet->insert(expression); |
| 2570 |
mBuildConceptList->append(expression); |
| 2571 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETCLASS); |
| 2572 |
} else { |
| 2573 |
if (expression == mBottomClassExpression) { |
| 2574 |
mBuildExpCounter->incRefferedBottomClassCount(); |
| 2575 |
} |
| 2576 |
} |
| 2577 |
return expression; |
| 2578 |
} |
| 2579 |
|
| 2580 |
CClassExpression* CConcreteOntologyBuildDataUpdater::getClass(const QStringRef& className) { |
| 2581 |
CClassExpression* expression = nullptr; |
| 2582 |
expression = mClassBuildHash->value(className); |
| 2583 |
if (!expression) { |
| 2584 |
QString classNameString(className.toString()); |
| 2585 |
expression = new CClassExpression(classNameString); |
| 2586 |
expression->setEntityID(mNextEntityNumber++); |
| 2587 |
mClassBuildHash->insert(classNameString,expression); |
| 2588 |
mBuildConceptSet->insert(expression); |
| 2589 |
mBuildConceptList->append(expression); |
| 2590 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETCLASS); |
| 2591 |
} else { |
| 2592 |
if (expression == mBottomClassExpression) { |
| 2593 |
mBuildExpCounter->incRefferedBottomClassCount(); |
| 2594 |
} |
| 2595 |
} |
| 2596 |
return expression; |
| 2597 |
} |
| 2598 |
|
| 2599 |
|
| 2600 |
|
| 2601 |
CDatatypeExpression* CConcreteOntologyBuildDataUpdater::getDatatype(const QString& datatypeName) { |
| 2602 |
CDatatypeExpression* expression = nullptr; |
| 2603 |
expression = mDatatypeBuildHash->value(datatypeName); |
| 2604 |
if (!expression) { |
| 2605 |
expression = new CDatatypeExpression(datatypeName); |
| 2606 |
expression->setEntityID(mNextEntityNumber++); |
| 2607 |
mDatatypeBuildHash->insert(datatypeName,expression); |
| 2608 |
mBuildDatatypeSet->insert(expression); |
| 2609 |
mBuildDatatypeList->append(expression); |
| 2610 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATATYPE); |
| 2611 |
} |
| 2612 |
return expression; |
| 2613 |
} |
| 2614 |
|
| 2615 |
CDatatypeExpression* CConcreteOntologyBuildDataUpdater::getDatatype(const QStringRef& datatypeName) { |
| 2616 |
CDatatypeExpression* expression = nullptr; |
| 2617 |
expression = mDatatypeBuildHash->value(datatypeName); |
| 2618 |
if (!expression) { |
| 2619 |
QString datatypeNameString(datatypeName.toString()); |
| 2620 |
expression = new CDatatypeExpression(datatypeNameString); |
| 2621 |
expression->setEntityID(mNextEntityNumber++); |
| 2622 |
mDatatypeBuildHash->insert(datatypeNameString,expression); |
| 2623 |
mBuildDatatypeSet->insert(expression); |
| 2624 |
mBuildDatatypeList->append(expression); |
| 2625 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATATYPE); |
| 2626 |
} |
| 2627 |
return expression; |
| 2628 |
} |
| 2629 |
|
| 2630 |
|
| 2631 |
|
| 2632 |
|
| 2633 |
|
| 2634 |
|
| 2635 |
|
| 2636 |
CDataFacetExpression* CConcreteOntologyBuildDataUpdater::getDataFacet(const QString& dataFacetIRI) { |
| 2637 |
CDataFacetExpression* expression = nullptr; |
| 2638 |
expression = mDataFacetBuildHash->value(dataFacetIRI); |
| 2639 |
if (!expression) { |
| 2640 |
expression = new CDataFacetExpression(dataFacetIRI); |
| 2641 |
expression->setEntityID(mNextEntityNumber++); |
| 2642 |
mDataFacetBuildHash->insert(dataFacetIRI,expression); |
| 2643 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAFACETIRI); |
| 2644 |
} |
| 2645 |
return expression; |
| 2646 |
} |
| 2647 |
|
| 2648 |
CDataFacetExpression* CConcreteOntologyBuildDataUpdater::getDataFacet(const QStringRef& dataFacetIRI) { |
| 2649 |
CDataFacetExpression* expression = nullptr; |
| 2650 |
expression = mDataFacetBuildHash->value(dataFacetIRI); |
| 2651 |
if (!expression) { |
| 2652 |
QString datatypeNameString(dataFacetIRI.toString()); |
| 2653 |
expression = new CDataFacetExpression(datatypeNameString); |
| 2654 |
expression->setEntityID(mNextEntityNumber++); |
| 2655 |
mDataFacetBuildHash->insert(dataFacetIRI,expression); |
| 2656 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAFACETIRI); |
| 2657 |
} |
| 2658 |
return expression; |
| 2659 |
} |
| 2660 |
|
| 2661 |
|
| 2662 |
|
| 2663 |
|
| 2664 |
|
| 2665 |
|
| 2666 |
|
| 2667 |
CDataLexicalValueExpression* CConcreteOntologyBuildDataUpdater::getDataLexicalValue(const QString& dataLexicalValue) { |
| 2668 |
CDataLexicalValueExpression* expression = nullptr; |
| 2669 |
expression = mDataLexicalValueBuildHash->value(dataLexicalValue); |
| 2670 |
if (!expression) { |
| 2671 |
expression = new CDataLexicalValueExpression(dataLexicalValue); |
| 2672 |
expression->setEntityID(mNextEntityNumber++); |
| 2673 |
mDataLexicalValueBuildHash->insert(dataLexicalValue,expression); |
| 2674 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATALEXICALVALUE); |
| 2675 |
} |
| 2676 |
return expression; |
| 2677 |
} |
| 2678 |
|
| 2679 |
CDataLexicalValueExpression* CConcreteOntologyBuildDataUpdater::getDataLexicalValue(const QStringRef& dataLexicalValue) { |
| 2680 |
CDataLexicalValueExpression* expression = nullptr; |
| 2681 |
expression = mDataLexicalValueBuildHash->value(dataLexicalValue); |
| 2682 |
if (!expression) { |
| 2683 |
QString dataLexicalValueString(dataLexicalValue.toString()); |
| 2684 |
expression = new CDataLexicalValueExpression(dataLexicalValueString); |
| 2685 |
expression->setEntityID(mNextEntityNumber++); |
| 2686 |
mDataLexicalValueBuildHash->insert(dataLexicalValueString,expression); |
| 2687 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATALEXICALVALUE); |
| 2688 |
} |
| 2689 |
return expression; |
| 2690 |
} |
| 2691 |
|
| 2692 |
|
| 2693 |
|
| 2694 |
|
| 2695 |
|
| 2696 |
|
| 2697 |
|
| 2698 |
CDataPropertyExpression* CConcreteOntologyBuildDataUpdater::getDataProberty(const QString& dataPropertyName) { |
| 2699 |
CDataPropertyExpression* expression = nullptr; |
| 2700 |
expression = mDataPropertyBuildHash->value(dataPropertyName); |
| 2701 |
if (!expression) { |
| 2702 |
expression = new CDataPropertyExpression(dataPropertyName); |
| 2703 |
expression->setEntityID(mNextEntityNumber++); |
| 2704 |
mDataPropertyBuildHash->insert(dataPropertyName,expression); |
| 2705 |
mBuildDataRoleSet->insert(expression); |
| 2706 |
mBuildDataRoleList->append(expression); |
| 2707 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAPROPERTY); |
| 2708 |
} else { |
| 2709 |
if (expression == mBottomDataPropExpression) { |
| 2710 |
mBuildExpCounter->incRefferedBottomDataPropertyCount(); |
| 2711 |
} |
| 2712 |
} |
| 2713 |
return expression; |
| 2714 |
} |
| 2715 |
|
| 2716 |
CDataPropertyExpression* CConcreteOntologyBuildDataUpdater::getDataProberty(const QStringRef& dataPropertyName) { |
| 2717 |
CDataPropertyExpression* expression = nullptr; |
| 2718 |
expression = mDataPropertyBuildHash->value(dataPropertyName); |
| 2719 |
if (!expression) { |
| 2720 |
QString dataPropertyNameString(dataPropertyName.toString()); |
| 2721 |
expression = new CDataPropertyExpression(dataPropertyNameString); |
| 2722 |
expression->setEntityID(mNextEntityNumber++); |
| 2723 |
mDataPropertyBuildHash->insert(dataPropertyNameString,expression); |
| 2724 |
mBuildDataRoleSet->insert(expression); |
| 2725 |
mBuildDataRoleList->append(expression); |
| 2726 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAPROPERTY); |
| 2727 |
} else { |
| 2728 |
if (expression == mBottomDataPropExpression) { |
| 2729 |
mBuildExpCounter->incRefferedBottomDataPropertyCount(); |
| 2730 |
} |
| 2731 |
} |
| 2732 |
return expression; |
| 2733 |
} |
| 2734 |
|
| 2735 |
|
| 2736 |
|
| 2737 |
|
| 2738 |
|
| 2739 |
|
| 2740 |
|
| 2741 |
CObjectIndividualVariableExpression* CConcreteOntologyBuildDataUpdater::getNominalIndividualVariable(const QString &individualVariableName, cint64 axiomNumber) { |
| 2742 |
CObjectIndividualVariableExpression* expression = nullptr; |
| 2743 |
expression = mNominalIndividualVariableBuildHash->value(QPair<CStringRefStringHasher,cint64>(individualVariableName,axiomNumber)); |
| 2744 |
if (!expression) { |
| 2745 |
expression = new CObjectIndividualVariableExpression(individualVariableName,axiomNumber); |
| 2746 |
expression->setEntityID(mNextEntityNumber++); |
| 2747 |
mNextMaxAxiomNumberOffset = qMax(axiomNumber,mNextMaxAxiomNumberOffset); |
| 2748 |
mNominalIndividualVariableBuildHash->insert(QPair<CStringRefStringHasher,cint64>(individualVariableName,axiomNumber),expression); |
| 2749 |
mBuildConceptSet->insert(expression); |
| 2750 |
mBuildConceptList->append(expression); |
| 2751 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETNOMINALINDIVIDUALVARIABLE); |
| 2752 |
} |
| 2753 |
return expression; |
| 2754 |
} |
| 2755 |
|
| 2756 |
CObjectIndividualVariableExpression* CConcreteOntologyBuildDataUpdater::getNominalIndividualVariable(const QStringRef &individualVariableName, cint64 axiomNumber) { |
| 2757 |
CObjectIndividualVariableExpression* expression = nullptr; |
| 2758 |
expression = mNominalIndividualVariableBuildHash->value(QPair<CStringRefStringHasher,cint64>(individualVariableName,axiomNumber)); |
| 2759 |
if (!expression) { |
| 2760 |
QString individualVariableNameString(individualVariableName.toString()); |
| 2761 |
mNextMaxAxiomNumberOffset = qMax(axiomNumber,mNextMaxAxiomNumberOffset); |
| 2762 |
expression = new CObjectIndividualVariableExpression(individualVariableNameString,axiomNumber); |
| 2763 |
expression->setEntityID(mNextEntityNumber++); |
| 2764 |
mNominalIndividualVariableBuildHash->insert(QPair<CStringRefStringHasher,cint64>(individualVariableNameString,axiomNumber),expression); |
| 2765 |
mBuildConceptSet->insert(expression); |
| 2766 |
mBuildConceptList->append(expression); |
| 2767 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETNOMINALINDIVIDUALVARIABLE); |
| 2768 |
} |
| 2769 |
return expression; |
| 2770 |
} |
| 2771 |
|
| 2772 |
|
| 2773 |
|
| 2774 |
|
| 2775 |
|
| 2776 |
CIndividualVariableExpression* CConcreteOntologyBuildDataUpdater::getIndividualVariable(const QStringRef &individualVariableName, bool anonymousVariable) { |
| 2777 |
CIndividualVariableExpression* expression = nullptr; |
| 2778 |
CBUILDHASH<CStringRefStringHasher, CIndividualVariableExpression*>* indiVarNameExpHash = mNamedIndividualVariableBuildHash; |
| 2779 |
if (anonymousVariable) { |
| 2780 |
indiVarNameExpHash = mAnonymousIndividualVariableBuildHash; |
| 2781 |
} |
| 2782 |
expression = indiVarNameExpHash->value(individualVariableName); |
| 2783 |
if (!expression) { |
| 2784 |
if (!anonymousVariable) { |
| 2785 |
expression = new CNamedIndividualVariableExpression(individualVariableName.toString()); |
| 2786 |
} else { |
| 2787 |
expression = new CAnonymousIndividualVariableExpression(individualVariableName.toString()); |
| 2788 |
} |
| 2789 |
expression->setEntityID(mNextEntityNumber++); |
| 2790 |
indiVarNameExpHash->insert(individualVariableName, expression); |
| 2791 |
if (!anonymousVariable) { |
| 2792 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETNAMEDINDIVIDUALVARIABLE); |
| 2793 |
} else { |
| 2794 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETANONYMOUSINDIVIDUALVARIABLE); |
| 2795 |
} |
| 2796 |
} |
| 2797 |
return expression; |
| 2798 |
} |
| 2799 |
|
| 2800 |
|
| 2801 |
CIndividualVariableExpression* CConcreteOntologyBuildDataUpdater::getIndividualVariable(const QString &individualVariableName, bool anonymousVariable) { |
| 2802 |
CIndividualVariableExpression* expression = nullptr; |
| 2803 |
CBUILDHASH<CStringRefStringHasher, CIndividualVariableExpression*>* indiVarNameExpHash = mNamedIndividualVariableBuildHash; |
| 2804 |
if (anonymousVariable) { |
| 2805 |
indiVarNameExpHash = mAnonymousIndividualVariableBuildHash; |
| 2806 |
} |
| 2807 |
expression = indiVarNameExpHash->value(individualVariableName); |
| 2808 |
if (!expression) { |
| 2809 |
if (!anonymousVariable) { |
| 2810 |
expression = new CNamedIndividualVariableExpression(individualVariableName); |
| 2811 |
} else { |
| 2812 |
expression = new CAnonymousIndividualVariableExpression(individualVariableName); |
| 2813 |
} |
| 2814 |
expression->setEntityID(mNextEntityNumber++); |
| 2815 |
indiVarNameExpHash->insert(individualVariableName, expression); |
| 2816 |
if (!anonymousVariable) { |
| 2817 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETNAMEDINDIVIDUALVARIABLE); |
| 2818 |
} else { |
| 2819 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETANONYMOUSINDIVIDUALVARIABLE); |
| 2820 |
} |
| 2821 |
} |
| 2822 |
return expression; |
| 2823 |
} |
| 2824 |
|
| 2825 |
|
| 2826 |
|
| 2827 |
|
| 2828 |
|
| 2829 |
CDataValueVariableExpression* CConcreteOntologyBuildDataUpdater::getDataValueVariable(const QStringRef &dataValueVariableName) { |
| 2830 |
CDataValueVariableExpression* expression = nullptr; |
| 2831 |
expression = mDataValueVariableBuildHash->value(dataValueVariableName); |
| 2832 |
if (!expression) { |
| 2833 |
expression = new CDataValueVariableExpression(dataValueVariableName.toString()); |
| 2834 |
expression->setEntityID(mNextEntityNumber++); |
| 2835 |
mDataValueVariableBuildHash->insert(dataValueVariableName, expression); |
| 2836 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAVALUEVARIABLE); |
| 2837 |
} |
| 2838 |
return expression; |
| 2839 |
} |
| 2840 |
|
| 2841 |
|
| 2842 |
CDataValueVariableExpression* CConcreteOntologyBuildDataUpdater::getDataValueVariable(const QString &dataValueVariableName) { |
| 2843 |
CDataValueVariableExpression* expression = nullptr; |
| 2844 |
expression = mDataValueVariableBuildHash->value(dataValueVariableName); |
| 2845 |
if (!expression) { |
| 2846 |
expression = new CDataValueVariableExpression(dataValueVariableName); |
| 2847 |
expression->setEntityID(mNextEntityNumber++); |
| 2848 |
mDataValueVariableBuildHash->insert(dataValueVariableName, expression); |
| 2849 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATAVALUEVARIABLE); |
| 2850 |
} |
| 2851 |
return expression; |
| 2852 |
} |
| 2853 |
|
| 2854 |
|
| 2855 |
|
| 2856 |
|
| 2857 |
CDataLiteralVariableExpression* CConcreteOntologyBuildDataUpdater::getDataLiteralVariable(const QStringRef &dataLiteralVariableName) { |
| 2858 |
CDataLiteralVariableExpression* expression = nullptr; |
| 2859 |
expression = mDataLiteralVariableBuildHash->value(dataLiteralVariableName); |
| 2860 |
if (!expression) { |
| 2861 |
expression = new CDataLiteralVariableExpression(dataLiteralVariableName.toString()); |
| 2862 |
expression->setEntityID(mNextEntityNumber++); |
| 2863 |
mDataLiteralVariableBuildHash->insert(dataLiteralVariableName, expression); |
| 2864 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATALITERALVARIABLE); |
| 2865 |
} |
| 2866 |
return expression; |
| 2867 |
} |
| 2868 |
|
| 2869 |
|
| 2870 |
CDataLiteralVariableExpression* CConcreteOntologyBuildDataUpdater::getDataLiteralVariable(const QString &dataLiteralVariableName) { |
| 2871 |
CDataLiteralVariableExpression* expression = nullptr; |
| 2872 |
expression = mDataLiteralVariableBuildHash->value(dataLiteralVariableName); |
| 2873 |
if (!expression) { |
| 2874 |
expression = new CDataLiteralVariableExpression(dataLiteralVariableName); |
| 2875 |
expression->setEntityID(mNextEntityNumber++); |
| 2876 |
mDataLiteralVariableBuildHash->insert(dataLiteralVariableName, expression); |
| 2877 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETDATALITERALVARIABLE); |
| 2878 |
} |
| 2879 |
return expression; |
| 2880 |
} |
| 2881 |
|
| 2882 |
|
| 2883 |
|
| 2884 |
CClassVariableExpression* CConcreteOntologyBuildDataUpdater::getClassVariable(const QStringRef &classVariableName) { |
| 2885 |
CClassVariableExpression* expression = nullptr; |
| 2886 |
expression = mClassVariableBuildHash->value(classVariableName); |
| 2887 |
if (!expression) { |
| 2888 |
expression = new CClassVariableExpression(classVariableName.toString()); |
| 2889 |
expression->setEntityID(mNextEntityNumber++); |
| 2890 |
mClassVariableBuildHash->insert(classVariableName, expression); |
| 2891 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETCLASSVARIABLE); |
| 2892 |
} |
| 2893 |
return expression; |
| 2894 |
} |
| 2895 |
|
| 2896 |
CClassVariableExpression* CConcreteOntologyBuildDataUpdater::getClassVariable(const QString &classVariableName) { |
| 2897 |
CClassVariableExpression* expression = nullptr; |
| 2898 |
expression = mClassVariableBuildHash->value(classVariableName); |
| 2899 |
if (!expression) { |
| 2900 |
expression = new CClassVariableExpression(classVariableName); |
| 2901 |
expression->setEntityID(mNextEntityNumber++); |
| 2902 |
mClassVariableBuildHash->insert(classVariableName, expression); |
| 2903 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETCLASSVARIABLE); |
| 2904 |
} |
| 2905 |
return expression; |
| 2906 |
} |
| 2907 |
|
| 2908 |
|
| 2909 |
CObjectPropertyVariableExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyVariable(const QStringRef &objectPropertyVariableName) { |
| 2910 |
CObjectPropertyVariableExpression* expression = nullptr; |
| 2911 |
expression = mObjectPropertyVariableBuildHash->value(objectPropertyVariableName); |
| 2912 |
if (!expression) { |
| 2913 |
expression = new CObjectPropertyVariableExpression(objectPropertyVariableName.toString()); |
| 2914 |
expression->setEntityID(mNextEntityNumber++); |
| 2915 |
mObjectPropertyVariableBuildHash->insert(objectPropertyVariableName, expression); |
| 2916 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTPROPERTYVARIABLE); |
| 2917 |
} |
| 2918 |
return expression; |
| 2919 |
} |
| 2920 |
|
| 2921 |
CObjectPropertyVariableExpression* CConcreteOntologyBuildDataUpdater::getObjectPropertyVariable(const QString &objectPropertyVariableName) { |
| 2922 |
CObjectPropertyVariableExpression* expression = nullptr; |
| 2923 |
expression = mObjectPropertyVariableBuildHash->value(objectPropertyVariableName); |
| 2924 |
if (!expression) { |
| 2925 |
expression = new CObjectPropertyVariableExpression(objectPropertyVariableName); |
| 2926 |
expression->setEntityID(mNextEntityNumber++); |
| 2927 |
mObjectPropertyVariableBuildHash->insert(objectPropertyVariableName, expression); |
| 2928 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTPROPERTYVARIABLE); |
| 2929 |
} |
| 2930 |
return expression; |
| 2931 |
} |
| 2932 |
|
| 2933 |
|
| 2934 |
CDataPropertyVariableExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyVariable(const QStringRef &dataPropertyVariableName) { |
| 2935 |
CDataPropertyVariableExpression* expression = nullptr; |
| 2936 |
expression = mDataPropertyVariableBuildHash->value(dataPropertyVariableName); |
| 2937 |
if (!expression) { |
| 2938 |
expression = new CDataPropertyVariableExpression(dataPropertyVariableName.toString()); |
| 2939 |
expression->setEntityID(mNextEntityNumber++); |
| 2940 |
mDataPropertyVariableBuildHash->insert(dataPropertyVariableName, expression); |
| 2941 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTPROPERTYVARIABLE); |
| 2942 |
} |
| 2943 |
return expression; |
| 2944 |
} |
| 2945 |
|
| 2946 |
CDataPropertyVariableExpression* CConcreteOntologyBuildDataUpdater::getDataPropertyVariable(const QString &dataPropertyVariableName) { |
| 2947 |
CDataPropertyVariableExpression* expression = nullptr; |
| 2948 |
expression = mDataPropertyVariableBuildHash->value(dataPropertyVariableName); |
| 2949 |
if (!expression) { |
| 2950 |
expression = new CDataPropertyVariableExpression(dataPropertyVariableName); |
| 2951 |
expression->setEntityID(mNextEntityNumber++); |
| 2952 |
mDataPropertyVariableBuildHash->insert(dataPropertyVariableName, expression); |
| 2953 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTPROPERTYVARIABLE); |
| 2954 |
} |
| 2955 |
return expression; |
| 2956 |
} |
| 2957 |
|
| 2958 |
|
| 2959 |
|
| 2960 |
|
| 2961 |
|
| 2962 |
CObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getObjectProberty(const QString& probertyName) { |
| 2963 |
CObjectPropertyExpression* expression = nullptr; |
| 2964 |
expression = mObjectPropertyBuildHash->value(probertyName); |
| 2965 |
if (!expression) { |
| 2966 |
expression = new CObjectPropertyExpression(probertyName); |
| 2967 |
expression->setEntityID(mNextEntityNumber++); |
| 2968 |
mObjectPropertyBuildHash->insert(probertyName,expression); |
| 2969 |
mBuildObjectRoleSet->insert(expression); |
| 2970 |
mBuildObjectRoleList->append(expression); |
| 2971 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTPROPERTY); |
| 2972 |
} else { |
| 2973 |
if (expression == mBottomObjPropExpression) { |
| 2974 |
mBuildExpCounter->incRefferedBottomObjectPropertyCount(); |
| 2975 |
} |
| 2976 |
} |
| 2977 |
return expression; |
| 2978 |
} |
| 2979 |
|
| 2980 |
CObjectPropertyExpression* CConcreteOntologyBuildDataUpdater::getObjectProberty(const QStringRef& probertyName) { |
| 2981 |
CObjectPropertyExpression* expression = nullptr; |
| 2982 |
expression = mObjectPropertyBuildHash->value(probertyName); |
| 2983 |
if (!expression) { |
| 2984 |
QString propertyNameString(probertyName.toString()); |
| 2985 |
expression = new CObjectPropertyExpression(propertyNameString); |
| 2986 |
expression->setEntityID(mNextEntityNumber++); |
| 2987 |
mObjectPropertyBuildHash->insert(propertyNameString,expression); |
| 2988 |
mBuildObjectRoleSet->insert(expression); |
| 2989 |
mBuildObjectRoleList->append(expression); |
| 2990 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETOBJECTPROPERTY); |
| 2991 |
} else { |
| 2992 |
if (expression == mBottomObjPropExpression) { |
| 2993 |
mBuildExpCounter->incRefferedBottomObjectPropertyCount(); |
| 2994 |
} |
| 2995 |
} |
| 2996 |
return expression; |
| 2997 |
} |
| 2998 |
|
| 2999 |
CNamedIndividualExpression* CConcreteOntologyBuildDataUpdater::getNamedIndividual(const QString& individualName) { |
| 3000 |
CNamedIndividualExpression* expression = nullptr; |
| 3001 |
expression = mIndividualBuildHash->value(individualName); |
| 3002 |
if (!expression) { |
| 3003 |
expression = new CNamedIndividualExpression(individualName); |
| 3004 |
expression->setEntityID(mNextEntityNumber++); |
| 3005 |
mIndividualBuildHash->insert(individualName,expression); |
| 3006 |
mBuildIndividualSet->insert(expression); |
| 3007 |
mBuildIndividualList->append(expression); |
| 3008 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETNAMEDINDIVIDUAL); |
| 3009 |
} |
| 3010 |
return expression; |
| 3011 |
} |
| 3012 |
|
| 3013 |
CNamedIndividualExpression* CConcreteOntologyBuildDataUpdater::getNamedIndividual(const QStringRef& individualName) { |
| 3014 |
CNamedIndividualExpression* expression = nullptr; |
| 3015 |
expression = mIndividualBuildHash->value(individualName); |
| 3016 |
if (!expression) { |
| 3017 |
QString individualNameString(individualName.toString()); |
| 3018 |
expression = new CNamedIndividualExpression(individualNameString); |
| 3019 |
expression->setEntityID(mNextEntityNumber++); |
| 3020 |
mIndividualBuildHash->insert(individualNameString,expression); |
| 3021 |
mBuildIndividualSet->insert(expression); |
| 3022 |
mBuildIndividualList->append(expression); |
| 3023 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETNAMEDINDIVIDUAL); |
| 3024 |
} |
| 3025 |
return expression; |
| 3026 |
} |
| 3027 |
|
| 3028 |
|
| 3029 |
|
| 3030 |
CAnonymousIndividualExpression* CConcreteOntologyBuildDataUpdater::getAnonymousIndividual(const QString& ontologyName, const QString& individualName) { |
| 3031 |
CAnonymousIndividualExpression* expression = nullptr; |
| 3032 |
QStringRef useIndividualName(&individualName); |
| 3033 |
if (individualName.startsWith("_:")) { |
| 3034 |
useIndividualName = individualName.midRef(2); |
| 3035 |
} |
| 3036 |
QPair<CStringRefStringHasher,CStringRefStringHasher> namePair(ontologyName, useIndividualName); |
| 3037 |
expression = mAnoIndividualBuildHash->value(namePair); |
| 3038 |
if (!expression) { |
| 3039 |
QString individualNameString(useIndividualName.toString()); |
| 3040 |
expression = new CAnonymousIndividualExpression(ontologyName, individualNameString); |
| 3041 |
expression->setEntityID(mNextEntityNumber++); |
| 3042 |
mAnoIndividualBuildHash->insert(QPair<CStringRefStringHasher, CStringRefStringHasher>(ontologyName, individualNameString),expression); |
| 3043 |
mBuildIndividualSet->insert(expression); |
| 3044 |
mBuildIndividualList->append(expression); |
| 3045 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETANONYMOUSINDIVIDUAL); |
| 3046 |
} |
| 3047 |
return expression; |
| 3048 |
} |
| 3049 |
|
| 3050 |
|
| 3051 |
CAnonymousIndividualExpression* CConcreteOntologyBuildDataUpdater::getAnonymousIndividual(const QStringRef& ontologyName, const QStringRef& individualName) { |
| 3052 |
CAnonymousIndividualExpression* expression = nullptr; |
| 3053 |
QStringRef useIndividualName(individualName); |
| 3054 |
if (individualName.startsWith("_:")) { |
| 3055 |
useIndividualName = individualName.mid(2); |
| 3056 |
} |
| 3057 |
QPair<CStringRefStringHasher,CStringRefStringHasher> namePair(ontologyName, useIndividualName); |
| 3058 |
expression = mAnoIndividualBuildHash->value(namePair); |
| 3059 |
if (!expression) { |
| 3060 |
QString ontologyNameString(ontologyName.toString()); |
| 3061 |
QString individualNameString(useIndividualName.toString()); |
| 3062 |
expression = new CAnonymousIndividualExpression(ontologyNameString,individualNameString); |
| 3063 |
expression->setEntityID(mNextEntityNumber++); |
| 3064 |
mAnoIndividualBuildHash->insert(QPair<CStringRefStringHasher,CStringRefStringHasher>(ontologyNameString,individualNameString),expression); |
| 3065 |
mBuildIndividualSet->insert(expression); |
| 3066 |
mBuildIndividualList->append(expression); |
| 3067 |
mBuildExpCounter->incBuildExpressionCount(CBuildExpression::BETANONYMOUSINDIVIDUAL); |
| 3068 |
} |
| 3069 |
return expression; |
| 3070 |
} |
| 3071 |
|
| 3072 |
|
| 3073 |
|
| 3074 |
}; // end namespace Generator |
| 3075 |
|
| 3076 |
}; // end namespace Reasoner |
| 3077 |
|
| 3078 |
}; // end namespace Konclude |