| 1 | /* This file is part of the FaCT++ DL reasoner |
| 2 | Copyright (C) 2003-2015 Dmitry Tsarkov and The University of Manchester |
| 3 | Copyright (C) 2015-2017 Dmitry Tsarkov |
| 4 | |
| 5 | This library is free software; you can redistribute it and/or |
| 6 | modify it under the terms of the GNU Lesser General Public |
| 7 | License as published by the Free Software Foundation; either |
| 8 | version 2.1 of the License, or (at your option) any later version. |
| 9 | |
| 10 | This library is distributed in the hope that it will be useful, |
| 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 | Lesser General Public License for more details. |
| 14 | |
| 15 | You should have received a copy of the GNU Lesser General Public |
| 16 | License along with this library; if not, write to the Free Software |
| 17 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
| 18 | */ |
| 19 | |
| 20 | #ifndef TONTOLOGYLOADER_H |
| 21 | #define TONTOLOGYLOADER_Hcxx . . $ `Kernel/tOntologyLoader.h:21:9`! |
| 22 | |
| 23 | #include "tOntology.h"cxx . . $ `<file>/Kernel/tOntology.h`/ |
| 24 | #include "tExpressionTranslator.h"cxx . . $ `<file>/Kernel/tExpressionTranslator.h`/ |
| 25 | #include "dlTBox.h"cxx . . $ `<file>/Kernel/dlTBox.h`/ |
| 26 | |
| 27 | class TOntologyLoadercxx . . $ TOntologyLoader#: public DLAxiomVisitorcxx . . $ DLAxiomVisitor# |
| 28 | { |
| 29 | protected: // members |
| 30 | /// KB to load the ontology |
| 31 | TBoxcxx . . $ TBox#& kbcxx . . $ TOntologyLoader#kb.; |
| 32 | /// Transforms TDLExpression hierarchy to the DLTree* |
| 33 | TExpressionTranslatorcxx . . $ TExpressionTranslator# ETranscxx . . $ TOntologyLoader#ETrans.; |
| 34 | /// temporary vector for arguments of TBox n-ary axioms |
| 35 | stdcxx . . $ std/::vectorcxx . . $ std/vector#<DLTreecxx . . $ DLTree#*> ArgListcxx . . $ TOntologyLoader#ArgList.; |
| 36 | |
| 37 | protected: // methods |
| 38 | /// get DLTree corresponding to an expression EXPR |
| 39 | DLTreecxx . . $ DLTree#* ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a). ( const TDLExpressioncxx . . $ TDLExpression#* expr ) |
| 40 | { |
| 41 | expr->acceptcxx . . $ TDLExpression#accept(8c3f5312553ddf9b).(ETranscxx . . $ TOntologyLoader#ETrans.); |
| 42 | return ETranscxx . . $ TOntologyLoader#ETrans.; |
| 43 | } |
| 44 | /// get role by the DLTree; throw exception if unable |
| 45 | TRolecxx . . $ TRole#* getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( const TDLRoleExpressioncxx . . $ TDLRoleExpression#* r, const char* reason ) |
| 46 | { |
| 47 | try |
| 48 | { |
| 49 | return resolveRolecxx . . $ resolveRole(c256d257f6e22050).(TreeDeletercxx . . $ TreeDeleter#(ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(r))); |
| 50 | } |
| 51 | catch ( const EFaCTPlusPluscxx . . $ EFaCTPlusPlus#& ) { throw EFaCTPlusPluscxx . . $ EFaCTPlusPlus#(reason); } |
| 52 | } |
| 53 | /// get an individual be the DLTree; throw exception if unable |
| 54 | TIndividualcxx . . $ TIndividual#* getIndividualcxx . . $ TOntologyLoader#getIndividual(d410642517b2f838). ( const TDLIndividualExpressioncxx . . $ TDLIndividualExpression#* I, const char* reason ) |
| 55 | { |
| 56 | try |
| 57 | { |
| 58 | TreeDeletercxx . . $ TreeDeleter# icxx . . $ TreeDeleter#TreeDeleter(edf821a2fc5509f9).{ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(I)}; |
| 59 | if ( i == nullptr ) |
| 60 | throw EFaCTPlusPluscxx . . $ EFaCTPlusPlus#(reason); |
| 61 | return static_cast<TIndividualcxx . . $ TIndividual#*>(kbcxx . . $ TOntologyLoader#kb..getCIcxx . . $ TBox#getCI(a9db10ac0cf504ba).(i)); |
| 62 | } |
| 63 | catch(...) |
| 64 | { |
| 65 | throw EFaCTPlusPluscxx . . $ EFaCTPlusPlus#(reason); |
| 66 | } |
| 67 | } |
| 68 | /// ensure that the expression EXPR has its named entities linked to the KB ones |
| 69 | void ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472). ( const TDLExpressioncxx . . $ TDLExpression#* Expr ) |
| 70 | { |
| 71 | fpp_assertcxx . . $ `Kernel/fpp_assert.h:46:10`! ( Expr != nullptr ); // FORNOW |
| 72 | } |
| 73 | /// prepare arguments for the [begin,end) interval |
| 74 | template <typename Collection> |
| 75 | void prepareArgListcxx . . $ TOntologyLoader#prepareArgList(9b289cee16747614). ( Collection argList ) |
| 76 | { |
| 77 | ArgListcxx . . $ TOntologyLoader#ArgList..clearcxx . . $ std/vector#clear(49f6e7a06ebc5aa8).(); |
| 78 | for ( const auto& expr: argList ) |
| 79 | { |
| 80 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(expr); |
| 81 | ArgListcxx . . $ TOntologyLoader#ArgList..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(expr)); |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | public: // visitor interface |
| 86 | void visitcxx . . $ TOntologyLoader#visit(d9d59c22ba059f26). ( const TDLAxiomDeclarationcxx . . $ TDLAxiomDeclaration#& axiom ) override |
| 87 | { |
| 88 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getDeclarationcxx . . $ TDLAxiomDeclaration#getDeclaration(64c3665937a632bf).()); |
| 89 | TreeDeletercxx . . $ TreeDeleter#(ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getDeclarationcxx . . $ TDLAxiomDeclaration#getDeclaration(64c3665937a632bf).())); // register names in the KB |
| 90 | } |
| 91 | |
| 92 | // n-ary axioms |
| 93 | |
| 94 | void visitcxx . . $ TOntologyLoader#visit(9ecff12220e47c40). ( const TDLAxiomEquivalentConceptscxx . . $ TDLAxiomEquivalentConcepts#& axiom ) override |
| 95 | { |
| 96 | prepareArgListcxx . . $ TOntologyLoader#prepareArgList(9b289cee16747614).(axiom); |
| 97 | kbcxx . . $ TOntologyLoader#kb..processEquivalentCcxx . . $ TBox#processEquivalentC(117de6f0d8a75fcb).(ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..begincxx . . $ std/vector#begin(33b10a496a38335b).(),ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..endcxx . . $ std/vector#end(33b10a496a38335b).()); |
| 98 | } |
| 99 | void visitcxx . . $ TOntologyLoader#visit(aa51a7285ba589ba). ( const TDLAxiomDisjointConceptscxx . . $ TDLAxiomDisjointConcepts#& axiom ) override |
| 100 | { |
| 101 | prepareArgListcxx . . $ TOntologyLoader#prepareArgList(9b289cee16747614).(axiom); |
| 102 | kbcxx . . $ TOntologyLoader#kb..processDisjointCcxx . . $ TBox#processDisjointC(117de6f0d8a75fcb).(ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..begincxx . . $ std/vector#begin(33b10a496a38335b).(),ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..endcxx . . $ std/vector#end(33b10a496a38335b).()); |
| 103 | } |
| 104 | void visitcxx . . $ TOntologyLoader#visit(402fe14fc3eb0067). ( const TDLAxiomDisjointUnioncxx . . $ TDLAxiomDisjointUnion#& axiom ) override |
| 105 | { |
| 106 | // first make a disjoint axiom |
| 107 | prepareArgListcxx . . $ TOntologyLoader#prepareArgList(9b289cee16747614).(axiom); |
| 108 | kbcxx . . $ TOntologyLoader#kb..processDisjointCcxx . . $ TBox#processDisjointC(117de6f0d8a75fcb).(ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..begincxx . . $ std/vector#begin(33b10a496a38335b).(),ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..endcxx . . $ std/vector#end(33b10a496a38335b).()); |
| 109 | // now define C as a union-of axiom |
| 110 | ArgListcxx . . $ TOntologyLoader#ArgList..clearcxx . . $ std/vector#clear(49f6e7a06ebc5aa8).(); |
| 111 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getCcxx . . $ TDLAxiomDisjointUnion#getC(76ab2b9ad52d3e83).()); |
| 112 | ArgListcxx . . $ TOntologyLoader#ArgList..push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getCcxx . . $ TDLAxiomDisjointUnion#getC(76ab2b9ad52d3e83).())); |
| 113 | DLTreecxx . . $ DLTree#* acc = createBottomcxx . . $ createBottom(aa22cc08b69ae2ef).(); |
| 114 | for ( const auto* arg : axiom ) |
| 115 | acc = createSNFOrcxx . . $ createSNFOr(f2877343b7b69ea7). ( acc, ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(arg) ); |
| 116 | ArgListcxx . . $ TOntologyLoader#ArgList..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(acc); |
| 117 | kbcxx . . $ TOntologyLoader#kb..processEquivalentCcxx . . $ TBox#processEquivalentC(117de6f0d8a75fcb).(ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..begincxx . . $ std/vector#begin(33b10a496a38335b).(),ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..endcxx . . $ std/vector#end(33b10a496a38335b).()); |
| 118 | } |
| 119 | void visitcxx . . $ TOntologyLoader#visit(c0fc84e0a2be77f7). ( const TDLAxiomEquivalentORolescxx . . $ TDLAxiomEquivalentORoles#& axiom ) override |
| 120 | { |
| 121 | prepareArgListcxx . . $ TOntologyLoader#prepareArgList(9b289cee16747614).(axiom); |
| 122 | kbcxx . . $ TOntologyLoader#kb..processEquivalentRcxx . . $ TBox#processEquivalentR(117de6f0d8a75fcb).(ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..begincxx . . $ std/vector#begin(33b10a496a38335b).(),ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..endcxx . . $ std/vector#end(33b10a496a38335b).()); |
| 123 | } |
| 124 | void visitcxx . . $ TOntologyLoader#visit(c126fb3da66d6497). ( const TDLAxiomEquivalentDRolescxx . . $ TDLAxiomEquivalentDRoles#& axiom ) override |
| 125 | { |
| 126 | prepareArgListcxx . . $ TOntologyLoader#prepareArgList(9b289cee16747614).(axiom); |
| 127 | kbcxx . . $ TOntologyLoader#kb..processEquivalentRcxx . . $ TBox#processEquivalentR(117de6f0d8a75fcb).(ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..begincxx . . $ std/vector#begin(33b10a496a38335b).(),ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..endcxx . . $ std/vector#end(33b10a496a38335b).()); |
| 128 | } |
| 129 | void visitcxx . . $ TOntologyLoader#visit(9b4c04465f82a032). ( const TDLAxiomDisjointORolescxx . . $ TDLAxiomDisjointORoles#& axiom ) override |
| 130 | { |
| 131 | prepareArgListcxx . . $ TOntologyLoader#prepareArgList(9b289cee16747614).(axiom); |
| 132 | kbcxx . . $ TOntologyLoader#kb..processDisjointRcxx . . $ TBox#processDisjointR(117de6f0d8a75fcb).(ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..begincxx . . $ std/vector#begin(33b10a496a38335b).(),ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..endcxx . . $ std/vector#end(33b10a496a38335b).()); |
| 133 | } |
| 134 | void visitcxx . . $ TOntologyLoader#visit(f937f280b5be5d09). ( const TDLAxiomDisjointDRolescxx . . $ TDLAxiomDisjointDRoles#& axiom ) override |
| 135 | { |
| 136 | prepareArgListcxx . . $ TOntologyLoader#prepareArgList(9b289cee16747614).(axiom); |
| 137 | kbcxx . . $ TOntologyLoader#kb..processDisjointRcxx . . $ TBox#processDisjointR(117de6f0d8a75fcb).(ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..begincxx . . $ std/vector#begin(33b10a496a38335b).(),ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..endcxx . . $ std/vector#end(33b10a496a38335b).()); |
| 138 | } |
| 139 | void visitcxx . . $ TOntologyLoader#visit(d37f1d21cd25a5f3). ( const TDLAxiomSameIndividualscxx . . $ TDLAxiomSameIndividuals#& axiom ) override |
| 140 | { |
| 141 | prepareArgListcxx . . $ TOntologyLoader#prepareArgList(9b289cee16747614).(axiom); |
| 142 | kbcxx . . $ TOntologyLoader#kb..processSamecxx . . $ TBox#processSame(117de6f0d8a75fcb).(ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..begincxx . . $ std/vector#begin(33b10a496a38335b).(),ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..endcxx . . $ std/vector#end(33b10a496a38335b).()); |
| 143 | } |
| 144 | void visitcxx . . $ TOntologyLoader#visit(d0a24753794666b). ( const TDLAxiomDifferentIndividualscxx . . $ TDLAxiomDifferentIndividuals#& axiom ) override |
| 145 | { |
| 146 | prepareArgListcxx . . $ TOntologyLoader#prepareArgList(9b289cee16747614).(axiom); |
| 147 | kbcxx . . $ TOntologyLoader#kb..processDifferentcxx . . $ TBox#processDifferent(117de6f0d8a75fcb).(ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..begincxx . . $ std/vector#begin(33b10a496a38335b).(),ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..endcxx . . $ std/vector#end(33b10a496a38335b).()); |
| 148 | } |
| 149 | void visitcxx . . $ TOntologyLoader#visit(8ec85f1c9f859b33). ( const TDLAxiomFairnessConstraintcxx . . $ TDLAxiomFairnessConstraint#& axiom ) override |
| 150 | { |
| 151 | prepareArgListcxx . . $ TOntologyLoader#prepareArgList(9b289cee16747614).(axiom); |
| 152 | kbcxx . . $ TOntologyLoader#kb..setFairnessConstraintcxx . . $ TBox#setFairnessConstraint(117de6f0d8a75fcb).(ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..begincxx . . $ std/vector#begin(33b10a496a38335b).(),ArgListcxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..endcxx . . $ std/vector#end(33b10a496a38335b).()); |
| 153 | } |
| 154 | |
| 155 | // role axioms |
| 156 | |
| 157 | void visitcxx . . $ TOntologyLoader#visit(dbfe2e7150e0dc38). ( const TDLAxiomRoleInversecxx . . $ TDLAxiomRoleInverse#& axiom ) override |
| 158 | { |
| 159 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).()); |
| 160 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getInvRolecxx . . $ TDLAxiomRoleInverse#getInvRole(b0a963b5b1b1e1ae).()); |
| 161 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).(), "Role expression expected in Role Inverse axiom" ); |
| 162 | TRolecxx . . $ TRole#* iR = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getInvRolecxx . . $ TDLAxiomRoleInverse#getInvRole(b0a963b5b1b1e1ae).(), "Role expression expected in Role Inverse axiom" ); |
| 163 | kbcxx . . $ TOntologyLoader#kb..getRMcxx . . $ TBox#getRM(d63bc69855fc8040).(R).addRoleSynonymcxx . . $ RoleMaster#addRoleSynonym(46569ce1194069bb). ( iR->inversecxx . . $ TRole#inverse(6cda9dc08d29302e).(), R ); |
| 164 | } |
| 165 | void visitcxx . . $ TOntologyLoader#visit(71a707b53d3a8b2f). ( const TDLAxiomORoleSubsumptioncxx . . $ TDLAxiomORoleSubsumption#& axiom ) override |
| 166 | { |
| 167 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).()); |
| 168 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getSubRolecxx . . $ TDLAxiomORoleSubsumption#getSubRole(15ec025ea2d791ae).()); |
| 169 | DLTreecxx . . $ DLTree#* Sub = ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getSubRolecxx . . $ TDLAxiomORoleSubsumption#getSubRole(15ec025ea2d791ae).()); |
| 170 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).(), "Role expression expected in Object Roles Subsumption axiom" ); |
| 171 | kbcxx . . $ TOntologyLoader#kb..getRMcxx . . $ TBox#getRM(d63bc69855fc8040).(R).addRoleParentcxx . . $ RoleMaster#addRoleParent(3b1ea77690ef9b91). ( Sub, R ); |
| 172 | } |
| 173 | void visitcxx . . $ TOntologyLoader#visit(20fca8e39bd7f9de). ( const TDLAxiomDRoleSubsumptioncxx . . $ TDLAxiomDRoleSubsumption#& axiom ) override |
| 174 | { |
| 175 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRolecxx . . $ TDLAxiomSingleDRole#getRole(a81f3d9965bf170b).()); |
| 176 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getSubRolecxx . . $ TDLAxiomDRoleSubsumption#getSubRole(a81f3d9965bf170b).()); |
| 177 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getRolecxx . . $ TDLAxiomSingleDRole#getRole(a81f3d9965bf170b).(), "Role expression expected in Data Roles Subsumption axiom" ); |
| 178 | TRolecxx . . $ TRole#* S = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getSubRolecxx . . $ TDLAxiomDRoleSubsumption#getSubRole(a81f3d9965bf170b).(), "Role expression expected in Data Roles Subsumption axiom" ); |
| 179 | kbcxx . . $ TOntologyLoader#kb..getDRMcxx . . $ TBox#getDRM(94330852db6e789a).().addRoleParentcxx . . $ RoleMaster#addRoleParent(46569ce1194069bb). ( S, R ); |
| 180 | } |
| 181 | void visitcxx . . $ TOntologyLoader#visit(b19917e065e373b0). ( const TDLAxiomORoleDomaincxx . . $ TDLAxiomORoleDomain#& axiom ) override |
| 182 | { |
| 183 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).()); |
| 184 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getDomaincxx . . $ TDLAxiomORoleDomain#getDomain(76ab2b9ad52d3e83).()); |
| 185 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).(), "Role expression expected in Object Role Domain axiom" ); |
| 186 | DLTreecxx . . $ DLTree#* C = ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getDomaincxx . . $ TDLAxiomORoleDomain#getDomain(76ab2b9ad52d3e83).()); |
| 187 | |
| 188 | if ( unlikelycxx . . $ `Kernel/globaldef.h:29:10`!(R->isTop()) ) // add GCI |
| 189 | kbcxx . . $ TOntologyLoader#kb..addSubsumeAxiomcxx . . $ TBox#addSubsumeAxiom(237c04ede5740138). ( createTopcxx . . $ createTop(aa22cc08b69ae2ef).(), C ); |
| 190 | else if ( likelycxx . . $ `Kernel/globaldef.h:28:10`!(!R->isBottom()) ) // nothing to do for bottom |
| 191 | R->setDomaincxx . . $ TRole#setDomain(edf821a2fc5509f9).(C); |
| 192 | } |
| 193 | void visitcxx . . $ TOntologyLoader#visit(6a89384f45b02cb7). ( const TDLAxiomDRoleDomaincxx . . $ TDLAxiomDRoleDomain#& axiom ) override |
| 194 | { |
| 195 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRolecxx . . $ TDLAxiomSingleDRole#getRole(a81f3d9965bf170b).()); |
| 196 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getDomaincxx . . $ TDLAxiomDRoleDomain#getDomain(76ab2b9ad52d3e83).()); |
| 197 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getRolecxx . . $ TDLAxiomSingleDRole#getRole(a81f3d9965bf170b).(), "Role expression expected in Data Role Domain axiom" ); |
| 198 | DLTreecxx . . $ DLTree#* C = ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getDomaincxx . . $ TDLAxiomDRoleDomain#getDomain(76ab2b9ad52d3e83).()); |
| 199 | |
| 200 | if ( unlikelycxx . . $ `Kernel/globaldef.h:29:10`!(R->isTop()) ) // add GCI |
| 201 | kbcxx . . $ TOntologyLoader#kb..addSubsumeAxiomcxx . . $ TBox#addSubsumeAxiom(237c04ede5740138). ( createTopcxx . . $ createTop(aa22cc08b69ae2ef).(), C ); |
| 202 | else if ( likelycxx . . $ `Kernel/globaldef.h:28:10`!(!R->isBottom()) ) // nothing to do for bottom |
| 203 | R->setDomaincxx . . $ TRole#setDomain(edf821a2fc5509f9).(C); |
| 204 | } |
| 205 | void visitcxx . . $ TOntologyLoader#visit(eef9ff8aad06e081). ( const TDLAxiomORoleRangecxx . . $ TDLAxiomORoleRange#& axiom ) override |
| 206 | { |
| 207 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).()); |
| 208 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRangecxx . . $ TDLAxiomORoleRange#getRange(76ab2b9ad52d3e83).()); |
| 209 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).(), "Role expression expected in Object Role Range axiom" ); |
| 210 | DLTreecxx . . $ DLTree#* C = ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getRangecxx . . $ TDLAxiomORoleRange#getRange(76ab2b9ad52d3e83).()); |
| 211 | |
| 212 | if ( unlikelycxx . . $ `Kernel/globaldef.h:29:10`!(R->isTop()) ) // add GCI |
| 213 | kbcxx . . $ TOntologyLoader#kb..addSubsumeAxiomcxx . . $ TBox#addSubsumeAxiom(237c04ede5740138). ( createTopcxx . . $ createTop(aa22cc08b69ae2ef).(), C ); |
| 214 | else if ( likelycxx . . $ `Kernel/globaldef.h:28:10`!(!R->isBottom()) ) // nothing to do for bottom |
| 215 | R->setRangecxx . . $ TRole#setRange(edf821a2fc5509f9).(C); |
| 216 | } |
| 217 | void visitcxx . . $ TOntologyLoader#visit(da8dca8cacae49f9). ( const TDLAxiomDRoleRangecxx . . $ TDLAxiomDRoleRange#& axiom ) override |
| 218 | { |
| 219 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRolecxx . . $ TDLAxiomSingleDRole#getRole(a81f3d9965bf170b).()); |
| 220 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRangecxx . . $ TDLAxiomDRoleRange#getRange(8a5cd50e478c5d2c).()); |
| 221 | getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getRolecxx . . $ TDLAxiomSingleDRole#getRole(a81f3d9965bf170b).(), "Role expression expected in Data Role Range axiom" )->setRangecxx . . $ TRole#setRange(edf821a2fc5509f9).(ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getRangecxx . . $ TDLAxiomDRoleRange#getRange(8a5cd50e478c5d2c).())); |
| 222 | } |
| 223 | void visitcxx . . $ TOntologyLoader#visit(e8585e86130514df). ( const TDLAxiomRoleTransitivecxx . . $ TDLAxiomRoleTransitive#& axiom ) override |
| 224 | { |
| 225 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).()); |
| 226 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).(), "Role expression expected in Role Transitivity axiom" ); |
| 227 | if ( !R->isTopcxx . . $ TNamedEntry#isTop(50ce9a9e25b4a850).() && !R->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).() ) // top/bottom roles are always transitive |
| 228 | R->setTransitivecxx . . $ TRole#setTransitive(b45ddcbc8423892c).(); |
| 229 | } |
| 230 | void visitcxx . . $ TOntologyLoader#visit(1555e5dd37550403). ( const TDLAxiomRoleReflexivecxx . . $ TDLAxiomRoleReflexive#& axiom ) override |
| 231 | { |
| 232 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).()); |
| 233 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).(), "Role expression expected in Role Reflexivity axiom" ); |
| 234 | if ( R->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).() ) // empty role can't be reflexive |
| 235 | throw EFPPInconsistentKBcxx . . $ EFPPInconsistentKB#EFPPInconsistentKB(49f6e7a06ebc5aa8).(); |
| 236 | if ( !R->isTopcxx . . $ TNamedEntry#isTop(50ce9a9e25b4a850).() ) // universal role always reflexive |
| 237 | R->setReflexivecxx . . $ TRole#setReflexive(b45ddcbc8423892c).(true); |
| 238 | } |
| 239 | void visitcxx . . $ TOntologyLoader#visit(eabfd54a3bd95b2). ( const TDLAxiomRoleIrreflexivecxx . . $ TDLAxiomRoleIrreflexive#& axiom ) override |
| 240 | { |
| 241 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).()); |
| 242 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).(), "Role expression expected in Role Irreflexivity axiom" ); |
| 243 | if ( R->isTopcxx . . $ TNamedEntry#isTop(50ce9a9e25b4a850).() ) // KB became inconsistent |
| 244 | throw EFPPInconsistentKBcxx . . $ EFPPInconsistentKB#EFPPInconsistentKB(49f6e7a06ebc5aa8).(); |
| 245 | if ( !R->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).() ) // empty role already irreflexive |
| 246 | { |
| 247 | R->setDomaincxx . . $ TRole#setDomain(edf821a2fc5509f9).(createSNFNotcxx . . $ createSNFNot(1bf715d485c1268).(createSNFSelfcxx . . $ createSNFSelf(1bf715d485c1268).(ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).())))); |
| 248 | R->setIrreflexivecxx . . $ TRole#setIrreflexive(b45ddcbc8423892c).(true); |
| 249 | } |
| 250 | } |
| 251 | void visitcxx . . $ TOntologyLoader#visit(371dc479b720f66a). ( const TDLAxiomRoleSymmetriccxx . . $ TDLAxiomRoleSymmetric#& axiom ) override |
| 252 | { |
| 253 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).()); |
| 254 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).(), "Role expression expected in Role Symmetry axiom" ); |
| 255 | if ( !R->isTopcxx . . $ TNamedEntry#isTop(50ce9a9e25b4a850).() && !R->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).() ) // both are symmetric |
| 256 | { |
| 257 | R->setSymmetriccxx . . $ TRole#setSymmetric(b45ddcbc8423892c).(true); |
| 258 | kbcxx . . $ TOntologyLoader#kb..getORMcxx . . $ TBox#getORM(94330852db6e789a).().addRoleParentcxx . . $ RoleMaster#addRoleParent(46569ce1194069bb). ( R, R->inversecxx . . $ TRole#inverse(6cda9dc08d29302e).() ); |
| 259 | } |
| 260 | } |
| 261 | void visitcxx . . $ TOntologyLoader#visit(2eab0e2ee768d6ea). ( const TDLAxiomRoleAsymmetriccxx . . $ TDLAxiomRoleAsymmetric#& axiom ) override |
| 262 | { |
| 263 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).()); |
| 264 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).(), "Role expression expected in Role Asymmetry axiom" ); |
| 265 | if ( R->isTopcxx . . $ TNamedEntry#isTop(50ce9a9e25b4a850).() ) // KB became inconsistent |
| 266 | throw EFPPInconsistentKBcxx . . $ EFPPInconsistentKB#EFPPInconsistentKB(49f6e7a06ebc5aa8).(); |
| 267 | if ( !R->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).() ) |
| 268 | { |
| 269 | R->setAsymmetriccxx . . $ TRole#setAsymmetric(b45ddcbc8423892c).(true); |
| 270 | kbcxx . . $ TOntologyLoader#kb..getORMcxx . . $ TBox#getORM(94330852db6e789a).().addDisjointRolescxx . . $ RoleMaster#addDisjointRoles(898137b4008d6b89). ( R, R->inversecxx . . $ TRole#inverse(6cda9dc08d29302e).() ); |
| 271 | } |
| 272 | } |
| 273 | void visitcxx . . $ TOntologyLoader#visit(1cb3074f4e7d0a89). ( const TDLAxiomORoleFunctionalcxx . . $ TDLAxiomORoleFunctional#& axiom ) override |
| 274 | { |
| 275 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).()); |
| 276 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).(), "Role expression expected in Object Role Functionality axiom" ); |
| 277 | if ( R->isTopcxx . . $ TNamedEntry#isTop(50ce9a9e25b4a850).() ) // NOTE!! not really the case (1-point models are fine here), but OWL 2 forbid this |
| 278 | throw EFPPInconsistentKBcxx . . $ EFPPInconsistentKB#EFPPInconsistentKB(49f6e7a06ebc5aa8).(); |
| 279 | if ( !R->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).() ) |
| 280 | R->setFunctionalcxx . . $ TRole#setFunctional(49f6e7a06ebc5aa8).(); |
| 281 | } |
| 282 | void visitcxx . . $ TOntologyLoader#visit(4ed58748b443d4d). ( const TDLAxiomDRoleFunctionalcxx . . $ TDLAxiomDRoleFunctional#& axiom ) override |
| 283 | { |
| 284 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRolecxx . . $ TDLAxiomSingleDRole#getRole(a81f3d9965bf170b).()); |
| 285 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getRolecxx . . $ TDLAxiomSingleDRole#getRole(a81f3d9965bf170b).(), "Role expression expected in Data Role Functionality axiom" ); |
| 286 | if ( R->isTopcxx . . $ TNamedEntry#isTop(50ce9a9e25b4a850).() ) // KB became inconsistent |
| 287 | throw EFPPInconsistentKBcxx . . $ EFPPInconsistentKB#EFPPInconsistentKB(49f6e7a06ebc5aa8).(); |
| 288 | if ( !R->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).() ) |
| 289 | R->setFunctionalcxx . . $ TRole#setFunctional(49f6e7a06ebc5aa8).(); |
| 290 | } |
| 291 | void visitcxx . . $ TOntologyLoader#visit(92d9880035cab613). ( const TDLAxiomRoleInverseFunctionalcxx . . $ TDLAxiomRoleInverseFunctional#& axiom ) override |
| 292 | { |
| 293 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).()); |
| 294 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getRolecxx . . $ TDLAxiomSingleORole#getRole(b0a963b5b1b1e1ae).(), "Role expression expected in Role Inverse Functionality axiom" ); |
| 295 | if ( R->isTopcxx . . $ TNamedEntry#isTop(50ce9a9e25b4a850).() ) // NOTE!! not really the case (1-point models are fine here), but OWL 2 forbid this |
| 296 | throw EFPPInconsistentKBcxx . . $ EFPPInconsistentKB#EFPPInconsistentKB(49f6e7a06ebc5aa8).(); |
| 297 | if ( !R->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).() ) |
| 298 | R->inversecxx . . $ TRole#inverse(6cda9dc08d29302e).()->setFunctionalcxx . . $ TRole#setFunctional(49f6e7a06ebc5aa8).(); |
| 299 | } |
| 300 | |
| 301 | // concept/individual axioms |
| 302 | |
| 303 | void visitcxx . . $ TOntologyLoader#visit(4415e73e741b43da). ( const TDLAxiomConceptInclusioncxx . . $ TDLAxiomConceptInclusion#& axiom ) override |
| 304 | { |
| 305 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getSubCcxx . . $ TDLAxiomConceptInclusion#getSubC(76ab2b9ad52d3e83).()); |
| 306 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getSupCcxx . . $ TDLAxiomConceptInclusion#getSupC(76ab2b9ad52d3e83).()); |
| 307 | DLTreecxx . . $ DLTree#* C = ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getSubCcxx . . $ TDLAxiomConceptInclusion#getSubC(76ab2b9ad52d3e83).()); |
| 308 | DLTreecxx . . $ DLTree#* D = ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getSupCcxx . . $ TDLAxiomConceptInclusion#getSupC(76ab2b9ad52d3e83).()); |
| 309 | kbcxx . . $ TOntologyLoader#kb..addSubsumeAxiomcxx . . $ TBox#addSubsumeAxiom(237c04ede5740138). ( C, D ); |
| 310 | } |
| 311 | void visitcxx . . $ TOntologyLoader#visit(ac53f03206c5ffd8). ( const TDLAxiomInstanceOfcxx . . $ TDLAxiomInstanceOf#& axiom ) override |
| 312 | { |
| 313 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getIndividualcxx . . $ TDLAxiomIndividual#getIndividual(11d970b45c73cfb9).()); |
| 314 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getCcxx . . $ TDLAxiomInstanceOf#getC(76ab2b9ad52d3e83).()); |
| 315 | getIndividualcxx . . $ TOntologyLoader#getIndividual(d410642517b2f838). ( axiom.getIndividualcxx . . $ TDLAxiomIndividual#getIndividual(11d970b45c73cfb9).(), "Individual expected in Instance axiom" ); |
| 316 | DLTreecxx . . $ DLTree#* I = ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getIndividualcxx . . $ TDLAxiomIndividual#getIndividual(11d970b45c73cfb9).()); |
| 317 | DLTreecxx . . $ DLTree#* C = ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getCcxx . . $ TDLAxiomInstanceOf#getC(76ab2b9ad52d3e83).()); |
| 318 | kbcxx . . $ TOntologyLoader#kb..addSubsumeAxiomcxx . . $ TBox#addSubsumeAxiom(237c04ede5740138). ( I, C ); |
| 319 | } |
| 320 | void visitcxx . . $ TOntologyLoader#visit(adefee3ba499aec2). ( const TDLAxiomRelatedTocxx . . $ TDLAxiomRelatedTo#& axiom ) override |
| 321 | { |
| 322 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getIndividualcxx . . $ TDLAxiomIndividual#getIndividual(11d970b45c73cfb9).()); |
| 323 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRelationcxx . . $ TDLAxiomRelatedTo#getRelation(b0a963b5b1b1e1ae).()); |
| 324 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRelatedIndividualcxx . . $ TDLAxiomRelatedTo#getRelatedIndividual(11d970b45c73cfb9).()); |
| 325 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getRelationcxx . . $ TDLAxiomRelatedTo#getRelation(b0a963b5b1b1e1ae).(), "Role expression expected in Related To axiom" ); |
| 326 | if ( R->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).() ) |
| 327 | throw EFPPInconsistentKBcxx . . $ EFPPInconsistentKB#EFPPInconsistentKB(49f6e7a06ebc5aa8).(); |
| 328 | if ( !R->isTopcxx . . $ TNamedEntry#isTop(50ce9a9e25b4a850).() ) // nothing to do for universal role |
| 329 | { |
| 330 | TIndividualcxx . . $ TIndividual#* I = getIndividualcxx . . $ TOntologyLoader#getIndividual(d410642517b2f838). ( axiom.getIndividualcxx . . $ TDLAxiomIndividual#getIndividual(11d970b45c73cfb9).(), "Individual expected in Related To axiom" ); |
| 331 | TIndividualcxx . . $ TIndividual#* J = getIndividualcxx . . $ TOntologyLoader#getIndividual(d410642517b2f838). ( axiom.getRelatedIndividualcxx . . $ TDLAxiomRelatedTo#getRelatedIndividual(11d970b45c73cfb9).(), "Individual expected in Related To axiom" ); |
| 332 | kbcxx . . $ TOntologyLoader#kb..RegisterIndividualRelationcxx . . $ TBox#RegisterIndividualRelation(b27626525369bbbd). ( I, R, J ); |
| 333 | } |
| 334 | } |
| 335 | void visitcxx . . $ TOntologyLoader#visit(8c7dc9507962ec65). ( const TDLAxiomRelatedToNotcxx . . $ TDLAxiomRelatedToNot#& axiom ) override |
| 336 | { |
| 337 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getIndividualcxx . . $ TDLAxiomIndividual#getIndividual(11d970b45c73cfb9).()); |
| 338 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRelationcxx . . $ TDLAxiomRelatedToNot#getRelation(b0a963b5b1b1e1ae).()); |
| 339 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getRelatedIndividualcxx . . $ TDLAxiomRelatedToNot#getRelatedIndividual(11d970b45c73cfb9).()); |
| 340 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getRelationcxx . . $ TDLAxiomRelatedToNot#getRelation(b0a963b5b1b1e1ae).(), "Role expression expected in Related To Not axiom" ); |
| 341 | if ( R->isTopcxx . . $ TNamedEntry#isTop(50ce9a9e25b4a850).() ) // inconsistent ontology |
| 342 | throw EFPPInconsistentKBcxx . . $ EFPPInconsistentKB#EFPPInconsistentKB(49f6e7a06ebc5aa8).(); |
| 343 | // make sure everything is consistent |
| 344 | getIndividualcxx . . $ TOntologyLoader#getIndividual(d410642517b2f838). ( axiom.getIndividualcxx . . $ TDLAxiomIndividual#getIndividual(11d970b45c73cfb9).(), "Individual expected in Related To Not axiom" ), |
| 345 | getIndividualcxx . . $ TOntologyLoader#getIndividual(d410642517b2f838). ( axiom.getRelatedIndividualcxx . . $ TDLAxiomRelatedToNot#getRelatedIndividual(11d970b45c73cfb9).(), "Individual expected in Related To Not axiom" ); |
| 346 | if ( !R->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).() ) // nothing to do |
| 347 | kbcxx . . $ TOntologyLoader#kb..addSubsumeAxiomcxx . . $ TBox#addSubsumeAxiom(237c04ede5740138). ( // make an axiom i:AR.\neg{j} |
| 348 | ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getIndividualcxx . . $ TDLAxiomIndividual#getIndividual(11d970b45c73cfb9).()), |
| 349 | createSNFForallcxx . . $ createSNFForall(f2877343b7b69ea7). ( ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getRelationcxx . . $ TDLAxiomRelatedToNot#getRelation(b0a963b5b1b1e1ae).()), createSNFNotcxx . . $ createSNFNot(1bf715d485c1268).(ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getRelatedIndividualcxx . . $ TDLAxiomRelatedToNot#getRelatedIndividual(11d970b45c73cfb9).())) ) ); |
| 350 | } |
| 351 | void visitcxx . . $ TOntologyLoader#visit(ff1a1ebde6ad8bad). ( const TDLAxiomValueOfcxx . . $ TDLAxiomValueOf#& axiom ) override |
| 352 | { |
| 353 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getIndividualcxx . . $ TDLAxiomIndividual#getIndividual(11d970b45c73cfb9).()); |
| 354 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getAttributecxx . . $ TDLAxiomValueOf#getAttribute(a81f3d9965bf170b).()); |
| 355 | getIndividualcxx . . $ TOntologyLoader#getIndividual(d410642517b2f838). ( axiom.getIndividualcxx . . $ TDLAxiomIndividual#getIndividual(11d970b45c73cfb9).(), "Individual expected in Value Of axiom" ); |
| 356 | // FIXME!! think about ensuring the value |
| 357 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getAttributecxx . . $ TDLAxiomValueOf#getAttribute(a81f3d9965bf170b).(), "Role expression expected in Value Of axiom" ); |
| 358 | if ( R->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).() ) |
| 359 | throw EFPPInconsistentKBcxx . . $ EFPPInconsistentKB#EFPPInconsistentKB(49f6e7a06ebc5aa8).(); |
| 360 | if ( !R->isTopcxx . . $ TNamedEntry#isTop(50ce9a9e25b4a850).() ) // nothing to do for universal role |
| 361 | kbcxx . . $ TOntologyLoader#kb..addSubsumeAxiomcxx . . $ TBox#addSubsumeAxiom(237c04ede5740138). ( // make an axiom i:EA.V |
| 362 | ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getIndividualcxx . . $ TDLAxiomIndividual#getIndividual(11d970b45c73cfb9).()), |
| 363 | createSNFExistscxx . . $ createSNFExists(f2877343b7b69ea7). ( ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getAttributecxx . . $ TDLAxiomValueOf#getAttribute(a81f3d9965bf170b).()), ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getValuecxx . . $ TDLAxiomValueOf#getValue(493934cfcada0bd8).())) ); |
| 364 | } |
| 365 | void visitcxx . . $ TOntologyLoader#visit(df12686069e02fa4). ( const TDLAxiomValueOfNotcxx . . $ TDLAxiomValueOfNot#& axiom ) override |
| 366 | { |
| 367 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getIndividualcxx . . $ TDLAxiomIndividual#getIndividual(11d970b45c73cfb9).()); |
| 368 | ensureNamescxx . . $ TOntologyLoader#ensureNames(ca1ea7df707d7472).(axiom.getAttributecxx . . $ TDLAxiomValueOfNot#getAttribute(a81f3d9965bf170b).()); |
| 369 | getIndividualcxx . . $ TOntologyLoader#getIndividual(d410642517b2f838). ( axiom.getIndividualcxx . . $ TDLAxiomIndividual#getIndividual(11d970b45c73cfb9).(), "Individual expected in Value Of Not axiom" ); |
| 370 | // FIXME!! think about ensuring the value |
| 371 | TRolecxx . . $ TRole#* R = getRolecxx . . $ TOntologyLoader#getRole(ed2e21ac85945398). ( axiom.getAttributecxx . . $ TDLAxiomValueOfNot#getAttribute(a81f3d9965bf170b).(), "Role expression expected in Value Of Not axiom" ); |
| 372 | if ( R->isTopcxx . . $ TNamedEntry#isTop(50ce9a9e25b4a850).() ) |
| 373 | throw EFPPInconsistentKBcxx . . $ EFPPInconsistentKB#EFPPInconsistentKB(49f6e7a06ebc5aa8).(); |
| 374 | if ( !R->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).() ) // nothing to do for empty role |
| 375 | kbcxx . . $ TOntologyLoader#kb..addSubsumeAxiomcxx . . $ TBox#addSubsumeAxiom(237c04ede5740138). ( // make an axiom i:AA.\neg V |
| 376 | ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getIndividualcxx . . $ TDLAxiomIndividual#getIndividual(11d970b45c73cfb9).()), |
| 377 | createSNFForallcxx . . $ createSNFForall(f2877343b7b69ea7). ( ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getAttributecxx . . $ TDLAxiomValueOfNot#getAttribute(a81f3d9965bf170b).()), createSNFNotcxx . . $ createSNFNot(1bf715d485c1268).(ecxx . . $ TOntologyLoader#e(b64a00ed5e9da28a).(axiom.getValuecxx . . $ TDLAxiomValueOfNot#getValue(493934cfcada0bd8).()))) ); |
| 378 | } |
| 379 | |
| 380 | public: // interface |
| 381 | /// init c'tor |
| 382 | explicit TOntologyLoadercxx . . $ TOntologyLoader#TOntologyLoader(8683a8a7d2fb73f). ( TBoxcxx . . $ TBox#& KB ) : kbcxx . . $ TOntologyLoader#kb.(KB), ETranscxx . . $ TOntologyLoader#ETrans.(KB) {} |
| 383 | |
| 384 | /// load ontology to a given KB |
| 385 | void visitOntologycxx . . $ TOntologyLoader#visitOntology(7f72607dde8f2d1b). ( TOntologycxx . . $ TOntology#& ontology ) |
| 386 | { |
| 387 | ontology.visitOntologycxx . . $ TOntology#visitOntology(3f8a807a0d935434).(*this); |
| 388 | kbcxx . . $ TOntologyLoader#kb..finishLoadingcxx . . $ TBox#finishLoading(49f6e7a06ebc5aa8).(); |
| 389 | } |
| 390 | }; // TOntologyLoader |
| 391 | |
| 392 | #endif |