Debian Codegraph @

Kernel/Kernel.cpp

raw symbols SCIP
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 Copyright (C) 2021-2024 Ivan Rygaev and Tilde MI
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
10
11 This library 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 GNU
14 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 this library; if not, write to the Free Software
18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include "Kernel.h"cxx . . $ `<file>/Kernel/Kernel.h`/
22 #include "tOntologyLoader.h"cxx . . $ `<file>/Kernel/tOntologyLoader.h`/
23 #include "tOntologyPrinterLISP.h"cxx . . $ `<file>/Kernel/tOntologyPrinterLISP.h`/
24 #include "AtomicDecomposer.h"cxx . . $ `<file>/Kernel/AtomicDecomposer.h`/
25 #include "OntologyBasedModularizer.h"cxx . . $ `<file>/Kernel/OntologyBasedModularizer.h`/
26 #include "eFPPSaveLoad.h"cxx . . $ `<file>/Kernel/eFPPSaveLoad.h`/
27 #include "SaveLoadManager.h"cxx . . $ `<file>/Kernel/SaveLoadManager.h`/
28 #include "TripleGatherer.h"cxx . . $ `<file>/Kernel/TripleGatherer.h`/
29
30 const char* ReasoningKernelcxx . . $ ReasoningKernel# :: Versioncxx . . $ ReasoningKernel#Version. = "1.8.2-SNAPSHOT";
31 const char* ReasoningKernelcxx . . $ ReasoningKernel# :: SupportedDLcxx . . $ ReasoningKernel#SupportedDL. = "SROIQ(D)";
32 const char* ReasoningKernelcxx . . $ ReasoningKernel# :: Copyrightcxx . . $ ReasoningKernel#Copyright. =
33 "Copyright (C) Dmitry Tsarkov, Ivan Rygaev, 2002-2024";
34 const char* ReasoningKernelcxx . . $ ReasoningKernel# :: ReleaseDatecxx . . $ ReasoningKernel#ReleaseDate. = "2 February 2024";
35
36 // print the FaCT++ information only once
37 static bool KernelFirstRuncxx . . $ KernelFirstRun. = true;
38
39 // debug related individual/values switch
40 //#define FPP_DEBUG_PRINT_RELATED_PROGRESS
41
42 ReasoningKernelcxx . . $ ReasoningKernel# :: ReasoningKernelcxx . . $ ReasoningKernel#ReasoningKernel(49f6e7a06ebc5aa8). ( void )
43 {
44 // Intro
45 if ( KernelFirstRuncxx . . $ KernelFirstRun. )
46 {
47 stdcxx . . $ std/::cerrcxx . . $ std/cerr. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "FaCT++.Kernel: Reasoner for the " <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). SupportedDLcxx . . $ ReasoningKernel#SupportedDL. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " Description Logic, " <<cxx . . $ std/basic_ostream#`operator<<`(b09cd8ec4365c7ed). 8*sizeof(void*) <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). "-bit\n"
48 <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). Copyrightcxx . . $ ReasoningKernel#Copyright. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). ". Version " <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). Versioncxx . . $ ReasoningKernel#Version. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). " (" <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). ReleaseDatecxx . . $ ReasoningKernel#ReleaseDate. <<cxx . . $ std/`operator<<`(efaf8c13fc75f3c7). ")\n";
49 KernelFirstRuncxx . . $ KernelFirstRun. = false;
50 }
51
52 // init option set (fill with options):
53 if ( initOptionscxx . . $ ReasoningKernel#initOptions(c9857a73d68e59ba). () )
54 throw EFaCTPlusPluscxx . . $ EFaCTPlusPlus#("FaCT++ kernel: Cannot init options");
55 }
56
57 /// d'tor
58 ReasoningKernelcxx . . $ ReasoningKernel# :: ~cxx . . $ ReasoningKernel#`~ReasoningKernel`(49f6e7a06ebc5aa8).ReasoningKernelcxx . . $ ReasoningKernel#()
59 {
60 clearTBoxcxx . . $ ReasoningKernel#clearTBox(49f6e7a06ebc5aa8).();
61 deleteTreecxx . . $ deleteTree(c5beffd064a5e5b2).(cachedQueryTreecxx . . $ ReasoningKernel#cachedQueryTree.);
62 delete pMonitorcxx . . $ ReasoningKernel#pMonitor.;
63 delete pSLManagercxx . . $ ReasoningKernel#pSLManager.;
64 for ( NameSigMapcxx . . $ ReasoningKernel#NameSigMap#::iteratorcxx . . $ std/map#iterator# p = Name2Sigcxx . . $ ReasoningKernel#Name2Sig..begincxx . . $ std/map#begin(fbe2f8c57595edf).(), p_end = Name2Sigcxx . . $ ReasoningKernel#Name2Sig..endcxx . . $ std/map#end(fbe2f8c57595edf).(); p !=cxx . . $ std/`operator!=`(84f83906d8995b82). p_end; ++cxx . . $ std/_Rb_tree_iterator#operator++(9461e5518c11c498).p )
65 delete p->cxx . . $ std/_Rb_tree_iterator#`operator->`(5a2a78a048fb49a8).secondcxx . . $ std/pair#second.;
66 }
67
68 /// clear TBox and related structures; keep ontology in place
69 void
70 ReasoningKernelcxx . . $ ReasoningKernel# :: clearTBoxcxx . . $ ReasoningKernel#clearTBox(49f6e7a06ebc5aa8). ( void )
71 {
72 delete pTBoxcxx . . $ ReasoningKernel#pTBox.;
73 pTBoxcxx . . $ ReasoningKernel#pTBox. = nullptr;
74 delete pETcxx . . $ ReasoningKernel#pET.;
75 pETcxx . . $ ReasoningKernel#pET. = nullptr;
76 delete KEcxx . . $ ReasoningKernel#KE.;
77 KEcxx . . $ ReasoningKernel#KE. = nullptr;
78 delete ADcxx . . $ ReasoningKernel#AD.;
79 ADcxx . . $ ReasoningKernel#AD. = nullptr;
80 delete ModSemcxx . . $ ReasoningKernel#ModSem.;
81 ModSemcxx . . $ ReasoningKernel#ModSem. = nullptr;
82 delete ModSyncxx . . $ ReasoningKernel#ModSyn.;
83 ModSyncxx . . $ ReasoningKernel#ModSyn. = nullptr;
84 delete ModSynCountcxx . . $ ReasoningKernel#ModSynCount.;
85 ModSynCountcxx . . $ ReasoningKernel#ModSynCount. = nullptr;
86 // during preprocessing the TBox names were cached. clear that cache now.
87 getExpressionManagercxx . . $ ReasoningKernel#getExpressionManager(867f96a8caac8aab).()->clearNameCachecxx . . $ TExpressionManager#clearNameCache(49f6e7a06ebc5aa8).();
88 }
89
90 bool
91 ReasoningKernelcxx . . $ ReasoningKernel# :: needForceReloadcxx . . $ ReasoningKernel#needForceReload(50ce9a9e25b4a850). ( void ) const
92 {
93 // if no TBox known -- reload
94 if ( pTBoxcxx . . $ ReasoningKernel#pTBox. == nullptr )
95 return true;
96 // if ontology wasn't change -- no need to reload
97 if ( !Ontologycxx . . $ ReasoningKernel#Ontology..isChangedcxx . . $ TOntology#isChanged(50ce9a9e25b4a850).() )
98 return false;
99 // no incremental required -- nothing to do
100 if ( !useIncrementalReasoningcxx . . $ ReasoningKernel#useIncrementalReasoning. )
101 return true;
102 return false;
103 }
104
105 /// force the re-classification of the changed ontology
106 void
107 ReasoningKernelcxx . . $ ReasoningKernel# :: forceReloadcxx . . $ ReasoningKernel#forceReload(49f6e7a06ebc5aa8). ( void )
108 {
109 // reset TBox
110 clearTBoxcxx . . $ ReasoningKernel#clearTBox(49f6e7a06ebc5aa8).();
111 newKBcxx . . $ ReasoningKernel#newKB(c9857a73d68e59ba).();
112
113 // Protege (as the only user of non-trivial monitors with reload) does not accept multiple usage of a monitor
114 // so switch it off after the 1st usage
115 pMonitorcxx . . $ ReasoningKernel#pMonitor. = nullptr;
116
117 // (re)load ontology
118 TOntologyLoadercxx . . $ TOntologyLoader# OntologyLoadercxx . . $ TOntologyLoader#TOntologyLoader(8683a8a7d2fb73f).(*getTBoxcxx . . $ ReasoningKernel#getTBox(e1a36bcbc166a7c5).());
119 OntologyLoader.visitOntologycxx . . $ TOntologyLoader#visitOntology(7f72607dde8f2d1b).(Ontologycxx . . $ ReasoningKernel#Ontology.);
120
121 if ( dumpOntologycxx . . $ ReasoningKernel#dumpOntology. )
122 dumpLISPcxx . . $ ReasoningKernel#dumpLISP(f7f45734e6842120).(stdcxx . . $ std/::coutcxx . . $ std/cout.);
123 if ( useIncrementalReasoningcxx . . $ ReasoningKernel#useIncrementalReasoning. )
124 initIncrementalcxx . . $ ReasoningKernel#initIncremental(49f6e7a06ebc5aa8).();
125
126 // after loading ontology became processed completely
127 Ontologycxx . . $ ReasoningKernel#Ontology..setProcessedcxx . . $ TOntology#setProcessed(49f6e7a06ebc5aa8).();
128 }
129
130 void ReasoningKernelcxx . . $ ReasoningKernel# :: dumpLISPcxx . . $ ReasoningKernel#dumpLISP(f7f45734e6842120). ( stdcxx . . $ std/::ostreamcxx . . $ std/ostream#& o_ ) {
131 TLISPOntologyPrintercxx . . $ TLISPOntologyPrinter# OntologyPrintercxx . . $ TLISPOntologyPrinter#TLISPOntologyPrinter(f7f45734e6842120).(o_);
132 // First print all the declaration (as datarole declarations should be before usages)
133 OntologyPrinter.setPrintFlagscxx . . $ TLISPOntologyPrinter#setPrintFlags(b0b38cda41d4ede4).(/*declarations=*/true, /*axioms=*/false);
134 Ontologycxx . . $ ReasoningKernel#Ontology..visitOntologycxx . . $ TOntology#visitOntology(3f8a807a0d935434).(OntologyPrinter);
135 // Then print logical axioms
136 OntologyPrinter.setPrintFlagscxx . . $ TLISPOntologyPrinter#setPrintFlags(b0b38cda41d4ede4).(/*declarations=*/false, /*axioms=*/true);
137 Ontologycxx . . $ ReasoningKernel#Ontology..visitOntologycxx . . $ TOntology#visitOntology(3f8a807a0d935434).(OntologyPrinter);
138 }
139
140
141 //-------------------------------------------------
142 // Prepare reasoning/query
143 //-------------------------------------------------
144
145 void
146 ReasoningKernelcxx . . $ ReasoningKernel# :: ClassifyOrLoadcxx . . $ ReasoningKernel#ClassifyOrLoad(b45ddcbc8423892c). ( bool needIndividuals )
147 {
148 if ( pSLManagercxx . . $ ReasoningKernel#pSLManager. != nullptr ) // try to load the taxonomy
149 {
150 if ( pSLManagercxx . . $ ReasoningKernel#pSLManager.->existsContentcxx . . $ SaveLoadManager#existsContent(50ce9a9e25b4a850).() )
151 { // previous version exists
152 try
153 {
154 Loadcxx . . $ ReasoningKernel#Load(49f6e7a06ebc5aa8).(); // loaded => nothing to do
155 return;
156 }
157 catch ( const EFPPSaveLoadcxx . . $ EFPPSaveLoad#& )
158 {
159 // fail to load -- fall through to the real action
160 }
161 }
162 }
163 // perform the real classification
164 if ( needIndividuals )
165 pTBoxcxx . . $ ReasoningKernel#pTBox.->performRealisationcxx . . $ TBox#performRealisation(49f6e7a06ebc5aa8).();
166 else
167 pTBoxcxx . . $ ReasoningKernel#pTBox.->performClassificationcxx . . $ TBox#performClassification(49f6e7a06ebc5aa8).();
168
169 // save the result if necessary
170 if ( pSLManagercxx . . $ ReasoningKernel#pSLManager. != nullptr )
171 Savecxx . . $ ReasoningKernel#Save(49f6e7a06ebc5aa8).();
172 }
173
174 void
175 ReasoningKernelcxx . . $ ReasoningKernel# :: processKBcxx . . $ ReasoningKernel#processKB(9496fe1b27827f43). ( KBStatuscxx . . $ KBStatus# status )
176 {
177 fpp_assertcxx . . $ `Kernel/fpp_assert.h:46:10`! ( status >= kbCChecked );
178
179 // check whether reasoning was failed
180 if ( reasoningFailedcxx . . $ ReasoningKernel#reasoningFailed. )
181 throw EFaCTPlusPluscxx . . $ EFaCTPlusPlus#("Can't answer queries due to previous errors");
182
183 KBStatuscxx . . $ KBStatus# curStatus = getStatuscxx . . $ ReasoningKernel#getStatus(6b8689a3d707128a).();
184
185 if ( curStatus >= status )
186 { // nothing to do; but make sure that we are consistent
187 if ( !isKBConsistentcxx . . $ ReasoningKernel#isKBConsistent(c9857a73d68e59ba).() )
188 throw EFPPInconsistentKBcxx . . $ EFPPInconsistentKB#EFPPInconsistentKB(49f6e7a06ebc5aa8).();
189 return;
190 }
191
192 // here curStatus < kbRealised, and status >= kbChecked
193 if ( curStatus == kbEmptycxx . . $ kbEmpty. || curStatus == kbLoadingcxx . . $ kbLoading. )
194 { // load and preprocess KB -- here might be failures
195 reasoningFailedcxx . . $ ReasoningKernel#reasoningFailed. = true;
196
197 // load the axioms from the ontology to the TBox
198 if ( needForceReloadcxx . . $ ReasoningKernel#needForceReload(50ce9a9e25b4a850).() )
199 forceReloadcxx . . $ ReasoningKernel#forceReload(49f6e7a06ebc5aa8).();
200 else // just do incremental classification and exit
201 {
202 doIncrementalcxx . . $ ReasoningKernel#doIncremental(49f6e7a06ebc5aa8).();
203 reasoningFailedcxx . . $ ReasoningKernel#reasoningFailed. = false;
204 return;
205 }
206
207 // do the preprocessing and consistency check
208 pTBoxcxx . . $ ReasoningKernel#pTBox.->isConsistentcxx . . $ TBox#isConsistent(c9857a73d68e59ba).();
209
210 // if there were no exception thrown -- clear the failure status
211 reasoningFailedcxx . . $ ReasoningKernel#reasoningFailed. = false;
212
213 // if the consistency check is all we need -- return
214 if ( status == kbCCheckedcxx . . $ kbCChecked. )
215 return;
216 }
217
218 // here we need to do classification or realisation
219
220 if ( !pTBoxcxx . . $ ReasoningKernel#pTBox.->isConsistentcxx . . $ TBox#isConsistent(c9857a73d68e59ba).() ) // nothing to do for inconsistent ontologies
221 return;
222
223 ClassifyOrLoadcxx . . $ ReasoningKernel#ClassifyOrLoad(b45ddcbc8423892c).(status == kbRealisedcxx . . $ kbRealised.);
224 }
225
226 //-----------------------------------------------------------------------------
227 //-- query caching support
228 //-----------------------------------------------------------------------------
229
230 /// classify query; cache is ready at the point. NAMED means whether concept is just a name
231 void
232 ReasoningKernelcxx . . $ ReasoningKernel# :: classifyQuerycxx . . $ ReasoningKernel#classifyQuery(49f6e7a06ebc5aa8). ( void )
233 {
234 // make sure KB is classified
235 classifyKBcxx . . $ ReasoningKernel#classifyKB(49f6e7a06ebc5aa8).();
236
237 // ... and the cache entry is properly cleared
238 fpp_assertcxx . . $ `Kernel/fpp_assert.h:46:10`! ( cachedVertex == nullptr );
239
240 // classify general query expression
241 bool complexQuery = getTBoxcxx . . $ ReasoningKernel#getTBox(e1a36bcbc166a7c5).()->isComplexQuerycxx . . $ TBox#isComplexQuery(b352c686bfa4bc3f).(cachedConceptcxx . . $ ReasoningKernel#cachedConcept.);
242 if ( complexQuery )
243 getTBoxcxx . . $ ReasoningKernel#getTBox(e1a36bcbc166a7c5).()->classifyQueryConceptcxx . . $ TBox#classifyQueryConcept(49f6e7a06ebc5aa8).();
244
245 // now cached concept is classified
246 cachedVertexcxx . . $ ReasoningKernel#cachedVertex. = cachedConceptcxx . . $ ReasoningKernel#cachedConcept.->getTaxVertexcxx . . $ ClassifiableEntry#getTaxVertex(16f9ca5fa66f7d36).();
247
248 if ( unlikelycxx . . $ `Kernel/globaldef.h:29:10`!(cachedVertex == nullptr) ) // fresh concept
249 {
250 fpp_assertcxx . . $ `Kernel/fpp_assert.h:46:10`! (!complexQuery);
251 cachedVertexcxx . . $ ReasoningKernel#cachedVertex. = getCTaxonomycxx . . $ ReasoningKernel#getCTaxonomy(f40506d1380adb7f).()->getFreshVertexcxx . . $ Taxonomy#getFreshVertex(cb64ec330cc81472).(cachedConceptcxx . . $ ReasoningKernel#cachedConcept.);
252 }
253
254 // setup proper cache level
255 cacheLevelcxx . . $ ReasoningKernel#cacheLevel. = csClassifiedcxx . . $ ReasoningKernel#csClassified.;
256 }
257
258 void
259 ReasoningKernelcxx . . $ ReasoningKernel# :: setUpSatCachecxx . . $ ReasoningKernel#setUpSatCache(edf821a2fc5509f9). ( DLTreecxx . . $ DLTree#* query )
260 {
261 // if KB was changed since it was classified,
262 // we should catch it before
263 fpp_assertcxx . . $ `Kernel/fpp_assert.h:46:10`! ( !Ontology.isChanged() );
264
265 // check if the query is already cached
266 if ( checkQueryCachecxx . . $ ReasoningKernel#checkQueryCache(c0588540878f7a89).(query) )
267 { // the level should be the same
268 fpp_assertcxx . . $ `Kernel/fpp_assert.h:46:10`! ( cacheLevel == csSat );
269 // nothing to do
270 deleteTreecxx . . $ deleteTree(c5beffd064a5e5b2).(query);
271 return;
272 }
273
274 // clear currently cached query
275 clearQueryCachecxx . . $ ReasoningKernel#clearQueryCache(49f6e7a06ebc5aa8).();
276
277 // setup concept to be queried
278 setQueryConceptcxx . . $ ReasoningKernel#setQueryConcept(f4bd9ed7cc6f2913).(query);
279
280 // everything is fine -- set up cache now
281 setQueryCachecxx . . $ ReasoningKernel#setQueryCache(edf821a2fc5509f9).(query);
282 cacheLevelcxx . . $ ReasoningKernel#cacheLevel. = csSatcxx . . $ ReasoningKernel#csSat.;
283 }
284
285 void
286 ReasoningKernelcxx . . $ ReasoningKernel# :: setUpCachecxx . . $ ReasoningKernel#setUpCache(59e27aeb12b314b). ( TConceptExprcxx . . $ ReasoningKernel#TConceptExpr#* query, cacheStatuscxx . . $ ReasoningKernel#cacheStatus# level )
287 {
288 // if KB was changed since it was classified,
289 // we should catch it before
290 fpp_assertcxx . . $ `Kernel/fpp_assert.h:46:10`! ( !Ontology.isChanged() );
291
292 // check if the query is already cached
293 if ( checkQueryCachecxx . . $ ReasoningKernel#checkQueryCache(cf84ffcdc9f1d9de).(query) )
294 {
295 fpp_assertcxx . . $ `Kernel/fpp_assert.h:46:10`! ( cacheLevel != csEmpty );
296 // query cached with the same or lower level -- nothing to do
297 if ( level <= cacheLevelcxx . . $ ReasoningKernel#cacheLevel. )
298 return;
299 // the only other option is: cache level is SAT but CLASSIFIED is requested
300 fpp_assertcxx . . $ `Kernel/fpp_assert.h:46:10`! ( level == csClassified );
301 fpp_assertcxx . . $ `Kernel/fpp_assert.h:46:10`! ( cacheLevel == csSat );
302 // classify query and return
303 classifyQuerycxx . . $ ReasoningKernel#classifyQuery(49f6e7a06ebc5aa8).();
304 return;
305 }
306
307 // clear currently cached query
308 clearQueryCachecxx . . $ ReasoningKernel#clearQueryCache(49f6e7a06ebc5aa8).();
309
310 // setup concept to be queried
311 setQueryConceptcxx . . $ ReasoningKernel#setQueryConcept(f4bd9ed7cc6f2913).(TreeDeletercxx . . $ TreeDeleter#(ecxx . . $ ReasoningKernel#e(b64a00ed5e9da28a).(query)));
312
313 // everything is fine -- set up cache now
314 setQueryCachecxx . . $ ReasoningKernel#setQueryCache(796585798ce1461a).(query);
315 cacheLevelcxx . . $ ReasoningKernel#cacheLevel. = csSatcxx . . $ ReasoningKernel#csSat.;
316
317 if ( level == csClassifiedcxx . . $ ReasoningKernel#csClassified. )
318 classifyQuerycxx . . $ ReasoningKernel#classifyQuery(49f6e7a06ebc5aa8).();
319 }
320
321 //-------------------------------------------------
322 // concept subsumption query implementation
323 //-------------------------------------------------
324
325 /// class for exploring concept taxonomy to find super classes
326 class SupConceptActorcxx . . $ SupConceptActor#: public WalkerInterfacecxx . . $ WalkerInterface#
327 {
328 protected:
329 const ClassifiableEntrycxx . . $ ClassifiableEntry#* pecxx . . $ SupConceptActor#pe.;
330 void entrycxx . . $ SupConceptActor#entry(25e3a48069a92e6e). ( const ClassifiableEntrycxx . . $ ClassifiableEntry#* q ) { if ( pecxx . . $ SupConceptActor#pe. == q ) throw stdcxx . . $ std/::exception(); }
331 public:
332 explicit SupConceptActorcxx . . $ SupConceptActor#SupConceptActor(866fbb357e35bef0). ( ClassifiableEntrycxx . . $ ClassifiableEntry#* q ) : pecxx . . $ SupConceptActor#pe.(q) {}
333 bool applycxx . . $ SupConceptActor#apply(9e72d36cb75ed014). ( const TaxonomyVertexcxx . . $ TaxonomyVertex#& v ) override
334 {
335 entrycxx . . $ SupConceptActor#entry(25e3a48069a92e6e).(v.getPrimercxx . . $ TaxonomyVertex#getPrimer(257357278432d96a).());
336 for ( const auto& synonym: v.synonymscxx . . $ TaxonomyVertex#synonyms(c783afb9bc916663).() )
337 entrycxx . . $ SupConceptActor#entry(25e3a48069a92e6e).(synonym);
338 return true;
339 }
340 }; // SupConceptActor
341
342 /// @return true iff C [= D holds
343 bool
344 ReasoningKernelcxx . . $ ReasoningKernel# :: checkSubcxx . . $ ReasoningKernel#checkSub(db5d378ba95a512d). ( TConceptcxx . . $ TConcept#* C, TConceptcxx . . $ TConcept#* D )
345 {
346 // check whether a concept is fresh
347 if ( unlikelycxx . . $ `Kernel/globaldef.h:29:10`!(!isValid(D->pName)) ) // D is fresh
348 {
349 if ( unlikelycxx . . $ `Kernel/globaldef.h:29:10`!(!isValid(C->pName)) ) // C is fresh
350 return C == D; // 2 fresh concepts subsumes one another iff they are the same
351 else // C is known
352 return !getTBoxcxx . . $ ReasoningKernel#getTBox(e1a36bcbc166a7c5).()->isSatisfiablecxx . . $ TBox#isSatisfiable(15d44b555a30180e).(C); // C [= D iff C=\bottom
353 }
354 else // D is known
355 if ( unlikelycxx . . $ `Kernel/globaldef.h:29:10`!(!isValid(C->pName)) ) // C is fresh
356 // C [= D iff D = \top, or ~D = \bottom
357 return !checkSatTreecxx . . $ ReasoningKernel#checkSatTree(38a18fab043f8799).(createSNFNotcxx . . $ createSNFNot(1bf715d485c1268).(getTBoxcxx . . $ ReasoningKernel#getTBox(e1a36bcbc166a7c5).()->getTreecxx . . $ TBox#getTree(8f1a6b264b733ed7).(C)));
358 // here C and D are known (not fresh)
359 // check the obvious ones
360 if ( unlikelycxx . . $ `Kernel/globaldef.h:29:10`!(D->isTop()) || unlikelycxx . . $ `Kernel/globaldef.h:29:10`!(C->isBottom()) )
361 return true;
362 if ( getStatuscxx . . $ ReasoningKernel#getStatus(6b8689a3d707128a).() < kbClassifiedcxx . . $ kbClassified. ) // unclassified => do via SAT test
363 return getTBoxcxx . . $ ReasoningKernel#getTBox(e1a36bcbc166a7c5).()->isSubHoldscxx . . $ TBox#isSubHolds(7e9f35c32394b4f5). ( C, D );
364 // classified => do the taxonomy traversal
365 SupConceptActorcxx . . $ SupConceptActor# actorcxx . . $ SupConceptActor#SupConceptActor(866fbb357e35bef0).(D);
366 Taxonomycxx . . $ Taxonomy#* tax = getCTaxonomycxx . . $ ReasoningKernel#getCTaxonomy(f40506d1380adb7f).();
367 try { tax->getRelativesInfocxx . . $ Taxonomy#getRelativesInfo(e811dd8058b26e1c).</*needCurrent=*/true, /*onlyDirect=*/false, /*upDirection=*/true> ( C->getTaxVertexcxx . . $ ClassifiableEntry#getTaxVertex(16f9ca5fa66f7d36).(), actor ); return false; }
368 catch (...) { tax->clearVisitedcxx . . $ Taxonomy#clearVisited(49f6e7a06ebc5aa8).(); return true; }
369 }
370
371 //-------------------------------------------------
372 // all-disjoint query implementation
373 //-------------------------------------------------
374
375 bool
376 ReasoningKernelcxx . . $ ReasoningKernel# :: isDisjointRolescxx . . $ ReasoningKernel#isDisjointRoles(c9857a73d68e59ba). ( void )
377 {
378 // grab all roles from the arg-list
379 typedef const stdcxx . . $ std/::vectorcxx . . $ std/vector#<const TDLExpressioncxx . . $ TDLExpression#*> TExprVeccxx . . $ ReasoningKernel#isDisjointRoles(c9857a73d68e59ba).TExprVec#;
380 typedef stdcxx . . $ std/::vectorcxx . . $ std/vector#<const TRolecxx . . $ TRole#*> TRoleVeccxx . . $ ReasoningKernel#isDisjointRoles(c9857a73d68e59ba).TRoleVec#;
381 TExprVeccxx . . $ ReasoningKernel#isDisjointRoles(c9857a73d68e59ba).TExprVec# Disj = getExpressionManagercxx . . $ std/vector#vector(a1201200cf0efa42).()->getArgListcxx . . $ TExpressionManager#getArgList(ea12e55bef799de0).();
382 TRoleVeccxx . . $ ReasoningKernel#isDisjointRoles(c9857a73d68e59ba).TRoleVec# Rolescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).;
383 Roles.reservecxx . . $ std/vector#reserve(2c44cd906ae4e829).(Disj.sizecxx . . $ std/vector#size(fe4d2d262d4164a8).());
384 unsigned int nTopRoles = 0;
385
386 for ( auto* arg : Disj )
387 {
388 if ( TORoleExprcxx . . $ ReasoningKernel#TORoleExpr#* ORole = dynamic_cast<TORoleExprcxx . . $ ReasoningKernel#TORoleExpr#*>(arg) )
389 {
390 TRolecxx . . $ TRole#* R = getRolecxx . . $ ReasoningKernel#getRole(ed2e21ac85945398). ( ORole, "Role expression expected in isDisjointRoles()" );
391 if ( R->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).() )
392 continue; // empty role is disjoint with everything
393 if ( R->isTopcxx . . $ TNamedEntry#isTop(50ce9a9e25b4a850).() )
394 ++nTopRoles; // count universal roles
395 else
396 Roles.push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(R);
397 }
398 else if ( TDRoleExprcxx . . $ ReasoningKernel#TDRoleExpr#* DRole = dynamic_cast<TDRoleExprcxx . . $ ReasoningKernel#TDRoleExpr#*>(arg) )
399 {
400 TRolecxx . . $ TRole#* R = getRolecxx . . $ ReasoningKernel#getRole(ed2e21ac85945398). ( DRole, "Role expression expected in isDisjointRoles()" );
401 if ( R->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).() )
402 continue; // empty role is disjoint with everything
403 if ( R->isTopcxx . . $ TNamedEntry#isTop(50ce9a9e25b4a850).() )
404 ++nTopRoles; // count universal roles
405 else
406 Roles.push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(R);
407 }
408 else
409 throw EFaCTPlusPluscxx . . $ EFaCTPlusPlus# ( "Role expression expected in isDisjointRoles()" );
410 }
411
412 // deal with top-roles
413 if ( nTopRoles > 0 )
414 {
415 if ( nTopRoles > 1 || !Roles.emptycxx . . $ std/vector#empty(50ce9a9e25b4a850).() )
416 return false; // universal role is not disjoint with anything but the bottom role
417 else
418 return true;
419 }
420
421 // test pair-wise disjointness
422 TRoleVeccxx . . $ ReasoningKernel#isDisjointRoles(c9857a73d68e59ba).TRoleVec#::const_iteratorcxx . . $ std/vector#const_iterator# q = Rolescxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..begincxx . . $ std/vector#begin(33b10a496a38335b).(), q_end = Rolescxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(ea0f1a22ba5f21a0)..endcxx . . $ std/vector#end(33b10a496a38335b).(), scxx . . $ __gnu_cxx/__normal_iterator#__normal_iterator(49f6e7a06ebc5aa8).;
423 for ( ; q !=cxx . . $ __gnu_cxx/`operator!=`(ef3c5749062e825c). q_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).q )
424 for ( s =cxx . . $ __gnu_cxx/__normal_iterator#`operator=`(e5014011092a4556). q+cxx . . $ __gnu_cxx/__normal_iterator#operator+(d0cb2d2ebd313f38).1; s !=cxx . . $ __gnu_cxx/`operator!=`(ef3c5749062e825c). q_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).s )
425 if ( !getTBoxcxx . . $ ReasoningKernel#getTBox(e1a36bcbc166a7c5).()->isDisjointRolescxx . . $ TBox#isDisjointRoles(ee962dbb2fa027b9).(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).q,*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).s) )
426 return false;
427
428 return true;
429 }
430
431 //-------------------------------------------------
432 // related individuals implementation
433 //-------------------------------------------------
434
435 class RIActorcxx . . $ RIActor#: public WalkerInterfacecxx . . $ WalkerInterface#
436 {
437 protected:
438 ReasoningKernelcxx . . $ ReasoningKernel#::CIVeccxx . . $ ReasoningKernel#CIVec# acccxx . . $ RIActor#acc.;
439
440 /// process single entry in a vertex label
441 bool tryEntrycxx . . $ RIActor#tryEntry(3085a1dc62d30373). ( const ClassifiableEntrycxx . . $ ClassifiableEntry#* p )
442 {
443 // check the applicability
444 if ( p->isSystemcxx . . $ TNamedEntry#isSystem(50ce9a9e25b4a850).() || !static_cast<const TConceptcxx . . $ TConcept#*>(p)->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).() )
445 return false;
446
447 // print the concept
448 acccxx . . $ RIActor#acc..push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(static_cast<const TIndividualcxx . . $ TIndividual#*>(p));
449 return true;
450 }
451
452 public:
453 RIActorcxx . . $ RIActor#RIActor(49f6e7a06ebc5aa8).() = default;
454
455 bool applycxx . . $ RIActor#apply(9e72d36cb75ed014). ( const TaxonomyVertexcxx . . $ TaxonomyVertex#& v ) override
456 {
457 bool ret = tryEntrycxx . . $ RIActor#tryEntry(3085a1dc62d30373).(v.getPrimercxx . . $ TaxonomyVertex#getPrimer(257357278432d96a).());
458
459 for ( const auto& synonym: v.synonymscxx . . $ TaxonomyVertex#synonyms(c783afb9bc916663).() )
460 ret |= tryEntrycxx . . $ RIActor#tryEntry(3085a1dc62d30373).(synonym);
461
462 return ret;
463 }
464 void clearcxx . . $ RIActor#clear(49f6e7a06ebc5aa8). ( void ) { acccxx . . $ RIActor#acc..clearcxx . . $ std/vector#clear(49f6e7a06ebc5aa8).(); }
465 const ReasoningKernelcxx . . $ ReasoningKernel#::CIVeccxx . . $ ReasoningKernel#CIVec#& getAcccxx . . $ RIActor#getAcc(cfd7b7ddaa7ccfb1). ( void ) const { return acccxx . . $ RIActor#acc.; }
466 }; // RIActor
467
468 ReasoningKernelcxx . . $ ReasoningKernel#::CIVeccxx . . $ ReasoningKernel#CIVec#
469 ReasoningKernelcxx . . $ ReasoningKernel# :: buildRelatedCachecxx . . $ ReasoningKernel#buildRelatedCache(9f1620c27b99c66d). ( TIndividualcxx . . $ TIndividual#* I, const TRolecxx . . $ TRole#* R )
470 {
471 #ifdef FPP_DEBUG_PRINT_RELATED_PROGRESS
472 std::cout << "Related for " << I->getName() << " via property " << R->getName() << "\n";
473 #endif
474
475 // for synonyms: use the representative's cache
476 if ( R->isSynonymcxx . . $ ClassifiableEntry#isSynonym(50ce9a9e25b4a850).() )
477 return getRelatedcxx . . $ std/vector#vector(a1201200cf0efa42). ( I, resolveSynonymcxx . . $ resolveSynonym(bd9f52c6ae4be57a).(R) );
478
479 // FIXME!! return an empty set for data roles
480 if ( R->isDataRolecxx . . $ TRole#isDataRole(50ce9a9e25b4a850).() )
481 return CIVeccxx . . $ std/vector#vector(b1ea180184b47f03).();
482
483 // empty role has no fillers
484 if ( R->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).() )
485 return CIVeccxx . . $ std/vector#vector(b1ea180184b47f03).();
486
487 // now fills the query
488 RIActorcxx . . $ RIActor# actorcxx . . $ RIActor#RIActor(49f6e7a06ebc5aa8).;
489 // ask for instances of \exists R^-.{i}
490 TORoleExprcxx . . $ ReasoningKernel#TORoleExpr#* InvR = R->getIdcxx . . $ TNamedEntry#getId(455f465bc33b4cdf).() > 0
491 ? getExpressionManagercxx . . $ ReasoningKernel#getExpressionManager(867f96a8caac8aab).()->Inversecxx . . $ TExpressionManager#Inverse(c6736427cdccb407).(getExpressionManagercxx . . $ ReasoningKernel#getExpressionManager(867f96a8caac8aab).()->ObjectRolecxx . . $ TExpressionManager#ObjectRole(9eb6018165b5acba).(Rcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).()))
492 : getExpressionManagercxx . . $ ReasoningKernel#getExpressionManager(867f96a8caac8aab).()->ObjectRolecxx . . $ TExpressionManager#ObjectRole(9eb6018165b5acba).(Rcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).->inversecxx . . $ TRole#inverse(69f26110a94b259f).()->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).());
493 TConceptExprcxx . . $ ReasoningKernel#TConceptExpr#* query =
494 R->isTopcxx . . $ TNamedEntry#isTop(50ce9a9e25b4a850).() ? getExpressionManagercxx . . $ ReasoningKernel#getExpressionManager(867f96a8caac8aab).()->Topcxx . . $ TExpressionManager#Top(aac0c49b6bdfac38).() : // universal role has all the named individuals as a filler
495 getExpressionManagercxx . . $ ReasoningKernel#getExpressionManager(867f96a8caac8aab).()->Valuecxx . . $ TExpressionManager#Value(69f3b6d87cafa765). ( InvR, getExpressionManagercxx . . $ ReasoningKernel#getExpressionManager(867f96a8caac8aab).()->Individualcxx . . $ TExpressionManager#Individual(fa65f56176e0b266).(Icxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).()) );
496 getInstancescxx . . $ ReasoningKernel#getInstances(bfb43b18efbd3c83). ( query, actor );
497 return actorcxx . . $ std/vector#vector(a1201200cf0efa42)..getAcccxx . . $ RIActor#getAcc(cfd7b7ddaa7ccfb1).();
498 }
499
500 /// @return in Rs all (DATA)-roles R s.t. (I,x):R; add inverses if NEEDI is true
501 void
502 ReasoningKernelcxx . . $ ReasoningKernel# :: getRelatedRolescxx . . $ ReasoningKernel#getRelatedRoles(5b76d9c42e2bbb27). ( const TIndividualExprcxx . . $ ReasoningKernel#TIndividualExpr#* I, NamesVectorcxx . . $ ReasoningKernel#NamesVector#& Rs, bool data, bool needI )
503 {
504 realiseKBcxx . . $ ReasoningKernel#realiseKB(49f6e7a06ebc5aa8).(); // ensure KB is ready to answer the query
505 Rs.clearcxx . . $ std/vector#clear(49f6e7a06ebc5aa8).();
506
507 TIndividualcxx . . $ TIndividual#* i = getIndividualcxx . . $ ReasoningKernel#getIndividual(d410642517b2f838). ( I, "individual name expected in the getRelatedRoles()" );
508 for ( const auto& R: (data ? getDRMcxx . . $ ReasoningKernel#getDRM(94330852db6e789a).() : getORMcxx . . $ ReasoningKernel#getORM(94330852db6e789a).()) )
509 if ( ( R->getIdcxx . . $ TNamedEntry#getId(455f465bc33b4cdf).() > 0 || needI ) && !getRelatedcxx . . $ ReasoningKernel#getRelated(f9d8316e028a611d).(i,R).emptycxx . . $ std/vector#empty(50ce9a9e25b4a850).() )
510 Rs.push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(R);
511 }
512
513 void
514 ReasoningKernelcxx . . $ ReasoningKernel# :: getRoleFillerscxx . . $ ReasoningKernel#getRoleFillers(8ac4f9e00c6e6d). ( const TIndividualExprcxx . . $ ReasoningKernel#TIndividualExpr#* I, const TORoleExprcxx . . $ ReasoningKernel#TORoleExpr#* R, IndividualSetcxx . . $ ReasoningKernel#IndividualSet#& Result )
515 {
516 CIVeccxx . . $ ReasoningKernel#CIVec# vec = getRoleFillerscxx . . $ std/vector#vector(a1201200cf0efa42).( I, R );
517 for ( CIVeccxx . . $ ReasoningKernel#CIVec#::iteratorcxx . . $ std/vector#iterator# p = vec.begincxx . . $ std/vector#begin(33b10a496a38335b).(), p_end = vec.endcxx . . $ std/vector#end(33b10a496a38335b).(); p <cxx . . $ __gnu_cxx/`operator<`(ef3c5749062e825c). p_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).p )
518 Result.push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(const_cast<TIndividualcxx . . $ TIndividual#*>(*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p));
519 }
520 const ReasoningKernelcxx . . $ ReasoningKernel#::CIVeccxx . . $ ReasoningKernel#CIVec#&
521 ReasoningKernelcxx . . $ ReasoningKernel# :: getRoleFillerscxx . . $ ReasoningKernel#getRoleFillers(d32c27b9ce89eb2f). ( const TIndividualExprcxx . . $ ReasoningKernel#TIndividualExpr#* I, const TORoleExprcxx . . $ ReasoningKernel#TORoleExpr#* R)
522 {
523 realiseKBcxx . . $ ReasoningKernel#realiseKB(49f6e7a06ebc5aa8).(); // ensure KB is ready to answer the query
524 return getRelatedcxx . . $ ReasoningKernel#getRelated(f9d8316e028a611d). ( getIndividualcxx . . $ ReasoningKernel#getIndividual(d410642517b2f838). ( I, "Individual name expected in the getRoleFillers()" ),
525 getRolecxx . . $ ReasoningKernel#getRole(ed2e21ac85945398). ( R, "Role expression expected in the getRoleFillers()" ) );
526 }
527
528
529 /// @return true iff R(I,J) holds
530 bool
531 ReasoningKernelcxx . . $ ReasoningKernel# :: isRelatedcxx . . $ ReasoningKernel#isRelated(d77eee90dc196fd7). ( const TIndividualExprcxx . . $ ReasoningKernel#TIndividualExpr#* I, const TORoleExprcxx . . $ ReasoningKernel#TORoleExpr#* R, const TIndividualExprcxx . . $ ReasoningKernel#TIndividualExpr#* J )
532 {
533 realiseKBcxx . . $ ReasoningKernel#realiseKB(49f6e7a06ebc5aa8).(); // ensure KB is ready to answer the query
534 TIndividualcxx . . $ TIndividual#* i = getIndividualcxx . . $ ReasoningKernel#getIndividual(d410642517b2f838). ( I, "Individual name expected in the isRelated()" );
535 TRolecxx . . $ TRole#* r = getRolecxx . . $ ReasoningKernel#getRole(ed2e21ac85945398). ( R, "Role expression expected in the isRelated()" );
536 if ( r->isDataRolecxx . . $ TRole#isDataRole(50ce9a9e25b4a850).() )
537 return false; // FIXME!! not implemented
538
539 TIndividualcxx . . $ TIndividual#* j = getIndividualcxx . . $ ReasoningKernel#getIndividual(d410642517b2f838). ( J, "Individual name expected in the isRelated()" );
540 CIVeccxx . . $ ReasoningKernel#CIVec# vec = getRelatedcxx . . $ std/vector#vector(a1201200cf0efa42). ( i, r );
541 for ( CIVeccxx . . $ ReasoningKernel#CIVec#::iteratorcxx . . $ std/vector#iterator# p = vec.begincxx . . $ std/vector#begin(33b10a496a38335b).(), p_end = vec.endcxx . . $ std/vector#end(33b10a496a38335b).(); p <cxx . . $ __gnu_cxx/`operator<`(ef3c5749062e825c). p_end; ++cxx . . $ __gnu_cxx/__normal_iterator#operator++(93f2e9c3bc4efc49).p )
542 if ( j == (*cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p) )
543 return true;
544
545 return false;
546 }
547
548 /// @return true iff A(I,V) holds
549 bool
550 ReasoningKernelcxx . . $ ReasoningKernel# :: isRelatedcxx . . $ ReasoningKernel#isRelated(5be7e6e2f58f529d). ( const TIndividualExprcxx . . $ ReasoningKernel#TIndividualExpr#* I, const TDRoleExprcxx . . $ ReasoningKernel#TDRoleExpr#* A, const TDataValueExprcxx . . $ ReasoningKernel#TDataValueExpr#* V )
551 {
552 TDLConceptDataValuecxx . . $ TDLConceptDataValue# existscxx . . $ TDLConceptDataValue#TDLConceptDataValue(23daa62466659a4c).(A, V);
553 return isInstancecxx . . $ ReasoningKernel#isInstance(c3232ab85b187851).(I, &exists);
554 }
555
556 TDLConceptExpressioncxx . . $ TDLConceptExpression#* ReasoningKernelcxx . . $ ReasoningKernel#::parseConceptcxx . . $ ReasoningKernel#parseConcept(8612cd067d6f1ae5).(const stdcxx . . $ std/::stringcxx . . $ std/string#& name)
557 {
558 auto* em = getExpressionManagercxx . . $ ReasoningKernel#getExpressionManager(867f96a8caac8aab).();
559
560 if (name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_THINGcxx . . $ `Kernel/RDF_URIs.h:36:9`!)
561 return em->Topcxx . . $ TExpressionManager#Top(aac0c49b6bdfac38).();
562 else if (name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_NOTHINGcxx . . $ `Kernel/RDF_URIs.h:37:9`!)
563 return em->Bottomcxx . . $ TExpressionManager#Bottom(2a1e789bc1a0a42f).();
564 else
565 return em->Conceptcxx . . $ TExpressionManager#Concept(f43767f328f84e3).(name);
566 }
567
568 const TConceptcxx . . $ TConcept#* ReasoningKernelcxx . . $ ReasoningKernel#::getConceptcxx . . $ ReasoningKernel#getConcept(65f8c540f712f165).(TDLIndividualNamecxx . . $ TDLIndividualName#* i_exp, TDLConceptExpressioncxx . . $ TDLConceptExpression#* c_exp)
569 {
570 auto* em = getExpressionManagercxx . . $ ReasoningKernel#getExpressionManager(867f96a8caac8aab).();
571
572 if (strlen(i_exp->getNamecxx . . $ TNamedEntity#getName(a9f41ea0e82d88cf).()) == 0)
573 return nullptr;
574 else if (c_exp == em->Topcxx . . $ TExpressionManager#Top(aac0c49b6bdfac38).())
575 return static_cast<const TConceptcxx . . $ TConcept#*>(getTBoxcxx . . $ ReasoningKernel#getTBox(e1a36bcbc166a7c5).()->getTaxonomycxx . . $ TBox#getTaxonomy(f40506d1380adb7f).()->getTopVertexcxx . . $ Taxonomy#getTopVertex(16f9ca5fa66f7d36).()->getPrimercxx . . $ TaxonomyVertex#getPrimer(257357278432d96a).());
576 else if (c_exp == em->Bottomcxx . . $ TExpressionManager#Bottom(2a1e789bc1a0a42f).())
577 return static_cast<const TConceptcxx . . $ TConcept#*>(getTBoxcxx . . $ ReasoningKernel#getTBox(e1a36bcbc166a7c5).()->getTaxonomycxx . . $ TBox#getTaxonomy(f40506d1380adb7f).()->getBottomVertexcxx . . $ Taxonomy#getBottomVertex(16f9ca5fa66f7d36).()->getPrimercxx . . $ TaxonomyVertex#getPrimer(257357278432d96a).());
578 else if (i_exp->getEntrycxx . . $ TNamedEntity#getEntry(28c03b9fd3c689f8).() != nullptr)
579 return static_cast<const TConceptcxx . . $ TConcept#*>(i_exp->getEntrycxx . . $ TNamedEntity#getEntry(28c03b9fd3c689f8).());
580 else
581 return static_cast<const TConceptcxx . . $ TConcept#*>(static_cast<TDLConceptNamecxx . . $ TDLConceptName#*>(c_exp)->getEntrycxx . . $ TNamedEntity#getEntry(28c03b9fd3c689f8).());
582 }
583
584 const TRolecxx . . $ TRole#* ReasoningKernelcxx . . $ ReasoningKernel#::getRolecxx . . $ ReasoningKernel#getRole(9283c1cb4524c56a).(TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* o_exp, TDLDataRoleExpressioncxx . . $ TDLDataRoleExpression#* d_exp)
585 {
586 auto* em = getExpressionManagercxx . . $ ReasoningKernel#getExpressionManager(867f96a8caac8aab).();
587 auto& orm = getORMcxx . . $ ReasoningKernel#getORM(94330852db6e789a).();
588 auto& drm = getDRMcxx . . $ ReasoningKernel#getDRM(94330852db6e789a).();
589
590
591 if (o_exp == em->ObjectRoleTopcxx . . $ TExpressionManager#ObjectRoleTop(447ac0a82727e308).())
592 {
593 return orm.getTopRolecxx . . $ RoleMaster#getTopRole(6cda9dc08d29302e).();
594 }
595 else if (o_exp == em->ObjectRoleBottomcxx . . $ TExpressionManager#ObjectRoleBottom(447ac0a82727e308).())
596 {
597 return orm.getBotRolecxx . . $ RoleMaster#getBotRole(6cda9dc08d29302e).();
598 }
599 else if (d_exp == em->DataRoleTopcxx . . $ TExpressionManager#DataRoleTop(d4873ea8157b134c).())
600 {
601 return drm.getTopRolecxx . . $ RoleMaster#getTopRole(6cda9dc08d29302e).();
602 }
603 else if (d_exp == em->DataRoleBottomcxx . . $ TExpressionManager#DataRoleBottom(d4873ea8157b134c).())
604 {
605 return drm.getBotRolecxx . . $ RoleMaster#getBotRole(6cda9dc08d29302e).();
606 }
607 else
608 {
609 auto* o_name = static_cast<TDLObjectRoleNamecxx . . $ TDLObjectRoleName#*>(o_exp);
610 auto* d_name = static_cast<TDLDataRoleNamecxx . . $ TDLDataRoleName#*>(d_exp);
611
612 if (strlen(o_name->getNamecxx . . $ TNamedEntity#getName(a9f41ea0e82d88cf).()) == 0 || isSpecialRolecxx . . $ isSpecialRole(7c222eea44a24d43).(o_namecxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).->getNamecxx . . $ TNamedEntity#getName(a9f41ea0e82d88cf).()))
613 return nullptr;
614 else if (o_name->getEntrycxx . . $ TNamedEntity#getEntry(28c03b9fd3c689f8).() != nullptr)
615 return static_cast<TRolecxx . . $ TRole#*>(o_name->getEntrycxx . . $ TNamedEntity#getEntry(28c03b9fd3c689f8).());
616 else
617 return static_cast<TRolecxx . . $ TRole#*>(d_name->getEntrycxx . . $ TNamedEntity#getEntry(28c03b9fd3c689f8).());
618 }
619 }
620
621 TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* ReasoningKernelcxx . . $ ReasoningKernel#::parseObjectRolecxx . . $ ReasoningKernel#parseObjectRole(24366d59580a416c).(const stdcxx . . $ std/::stringcxx . . $ std/string#& name)
622 {
623 auto* em = getExpressionManagercxx . . $ ReasoningKernel#getExpressionManager(867f96a8caac8aab).();
624
625 if (name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_TOP_OBJECT_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:41:9`!)
626 return em->ObjectRoleTopcxx . . $ TExpressionManager#ObjectRoleTop(447ac0a82727e308).();
627 else if (name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_BOTTOM_OBJECT_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:42:9`!)
628 return em->ObjectRoleBottomcxx . . $ TExpressionManager#ObjectRoleBottom(447ac0a82727e308).();
629 else
630 return em->ObjectRolecxx . . $ TExpressionManager#ObjectRole(9eb6018165b5acba).(name);
631 }
632
633 TDLDataRoleExpressioncxx . . $ TDLDataRoleExpression#* ReasoningKernelcxx . . $ ReasoningKernel#::parseDataRolecxx . . $ ReasoningKernel#parseDataRole(290e70135ea6de9f).(const stdcxx . . $ std/::stringcxx . . $ std/string#& name)
634 {
635 auto* em = getExpressionManagercxx . . $ ReasoningKernel#getExpressionManager(867f96a8caac8aab).();
636
637 if (name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_TOP_DATA_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:43:9`!)
638 return em->DataRoleTopcxx . . $ TExpressionManager#DataRoleTop(d4873ea8157b134c).();
639 else if (name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_BOTTOM_DATA_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:44:9`!)
640 return em->DataRoleBottomcxx . . $ TExpressionManager#DataRoleBottom(d4873ea8157b134c).();
641 else
642 return em->DataRolecxx . . $ TExpressionManager#DataRole(850aa2aceb89231f).(name);
643 }
644
645 const char* ReasoningKernelcxx . . $ ReasoningKernel#::getXsdTypecxx . . $ ReasoningKernel#getXsdType(fc71999b27369f84).(const TDataEntrycxx . . $ TDataEntry#* dataValue) const
646 {
647 const char* typeName = dataValue->getTypecxx . . $ TDataEntry#getType(bcfda270e2d2df96).()->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).();
648
649 if (strcmp(typeName, "number") == 0)
650 return TDataTypeManagercxx . . $ TDataTypeManager#::getIntTypeNamecxx . . $ TDataTypeManager#getIntTypeName(33a1f659e94feb42).();
651 else if (strcmp(typeName, "real") == 0)
652 return TDataTypeManagercxx . . $ TDataTypeManager#::getRealTypeNamecxx . . $ TDataTypeManager#getRealTypeName(33a1f659e94feb42).();
653 else if (strcmp(typeName, "bool") == 0)
654 return TDataTypeManagercxx . . $ TDataTypeManager#::getBoolTypeNamecxx . . $ TDataTypeManager#getBoolTypeName(33a1f659e94feb42).();
655 else
656 return "default";
657 }
658
659 void ReasoningKernelcxx . . $ ReasoningKernel#::getTriplescxx . . $ ReasoningKernel#getTriples(5d4179706023b7bd).(const stdcxx . . $ std/::stringcxx . . $ std/string#& q_subj_name, const stdcxx . . $ std/::stringcxx . . $ std/string#& q_role_name, const stdcxx . . $ std/::stringcxx . . $ std/string#& q_obj_name, stdcxx . . $ std/::setcxx . . $ std/set#<stdcxx . . $ std/::vectorcxx . . $ std/vector#<stdcxx . . $ std/::stringcxx . . $ std/string#>>& triples)
660 {
661 TBoxcxx . . $ TBox#* tBox = getTBoxcxx . . $ ReasoningKernel#getTBox(e1a36bcbc166a7c5).();
662 auto* em = getExpressionManagercxx . . $ ReasoningKernel#getExpressionManager(867f96a8caac8aab).();
663
664 TDLIndividualNamecxx . . $ TDLIndividualName#* q_subj_i_exp = em->Individualcxx . . $ TExpressionManager#Individual(fa65f56176e0b266).(q_subj_name);
665 TDLConceptExpressioncxx . . $ TDLConceptExpression#* q_subj_c_exp = parseConceptcxx . . $ ReasoningKernel#parseConcept(8612cd067d6f1ae5).(q_subj_name);
666 TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* q_subj_o_role_exp = parseObjectRolecxx . . $ ReasoningKernel#parseObjectRole(24366d59580a416c).(q_subj_name);
667 TDLDataRoleExpressioncxx . . $ TDLDataRoleExpression#* q_subj_d_role_exp = parseDataRolecxx . . $ ReasoningKernel#parseDataRole(290e70135ea6de9f).(q_subj_name);
668
669 TDLObjectRoleNamecxx . . $ TDLObjectRoleName#* q_o_role_exp = em->ObjectRolecxx . . $ TExpressionManager#ObjectRole(9eb6018165b5acba).(q_role_name);
670 TDLDataRoleNamecxx . . $ TDLDataRoleName#* q_d_role_exp = em->DataRolecxx . . $ TExpressionManager#DataRole(850aa2aceb89231f).(q_role_name);
671
672 TDLIndividualNamecxx . . $ TDLIndividualName#* q_obj_i_exp = em->Individualcxx . . $ TExpressionManager#Individual(fa65f56176e0b266).(q_obj_name);
673 TDLConceptExpressioncxx . . $ TDLConceptExpression#* q_obj_c_exp = parseConceptcxx . . $ ReasoningKernel#parseConcept(8612cd067d6f1ae5).(q_obj_name);
674 TDLObjectRoleExpressioncxx . . $ TDLObjectRoleExpression#* q_obj_o_role_exp = parseObjectRolecxx . . $ ReasoningKernel#parseObjectRole(24366d59580a416c).(q_obj_name);
675 TDLDataRoleExpressioncxx . . $ TDLDataRoleExpression#* q_obj_d_role_exp = parseDataRolecxx . . $ ReasoningKernel#parseDataRole(290e70135ea6de9f).(q_obj_name);
676
677 const TConceptcxx . . $ TConcept#* q_subj = getConceptcxx . . $ ReasoningKernel#getConcept(65f8c540f712f165).(q_subj_i_exp, q_subj_c_exp);
678 const TRolecxx . . $ TRole#* q_subj_role = getRolecxx . . $ ReasoningKernel#getRole(9283c1cb4524c56a).(q_subj_o_role_exp, q_subj_d_role_exp);
679 const TRolecxx . . $ TRole#* q_role = getRolecxx . . $ ReasoningKernel#getRole(9283c1cb4524c56a).(q_o_role_exp, q_d_role_exp);
680 const TConceptcxx . . $ TConcept#* q_obj = getConceptcxx . . $ ReasoningKernel#getConcept(65f8c540f712f165).(q_obj_i_exp, q_obj_c_exp);
681 const TRolecxx . . $ TRole#* q_obj_role = getRolecxx . . $ ReasoningKernel#getRole(9283c1cb4524c56a).(q_obj_o_role_exp, q_obj_d_role_exp);
682
683 // If subject or role is not found in the ontology, return an empty set
684 if ((!q_subj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() && q_subj == nullptr && q_subj_role == nullptr) || (!q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() && !isSpecialRolecxx . . $ isSpecialRole(7c222eea44a24d43).(q_role_name) && q_role == nullptr))
685 return;
686
687 if (q_subj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).())
688 {
689 // Subject is not specified in the query
690
691 // If role and object are specified in the query process special roles separately
692 if (q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`! && q_obj != nullptr)
693 {
694 // All instances of a specific class
695
696 if (!q_obj->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).())
697 {
698 TripleGatherercxx . . $ TripleGatherer# gatherercxx . . $ TripleGatherer#TripleGatherer(dbc16e4b8bce4b59).(&triples, false, RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!, q_obj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), [cxx . . $ std/function#function(a4b4b0c4acad1616).](const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry)
699 {
700 return static_cast<const TConceptcxx . . $ TConcept#*>(entry)->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).();
701 });
702
703 getInstancescxx . . $ ReasoningKernel#getInstances(bfb43b18efbd3c83).(q_obj_c_exp, gatherer);
704 }
705 else
706 {
707 return;
708 }
709 }
710 else if (q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). RDFS_SUBCLASS_OFcxx . . $ `Kernel/RDF_URIs.h:27:9`! && q_obj != nullptr)
711 {
712 // All subclasses of a specific class
713
714 if (!q_obj->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).())
715 {
716 TripleGatherercxx . . $ TripleGatherer# gatherercxx . . $ TripleGatherer#TripleGatherer(dbc16e4b8bce4b59).(&triples, false, RDFS_SUBCLASS_OFcxx . . $ `Kernel/RDF_URIs.h:27:9`!, q_obj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), [cxx . . $ std/function#function(a4b4b0c4acad1616).q_obj](const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry)
717 {
718 const TConceptcxx . . $ TConcept#* concept = static_cast<const TConceptcxx . . $ TConcept#*>(entry);
719 return entry != q_obj && !concept->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).() && !concept->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).();
720 });
721
722 getSubConceptscxx . . $ ReasoningKernel#getSubConcepts(f2bd94c4840cdfac).(q_obj_c_exp, false, gatherer, true);
723 }
724 else
725 {
726 return;
727 }
728 }
729 else if (q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_SAME_AScxx . . $ `Kernel/RDF_URIs.h:33:9`! && q_obj != nullptr)
730 {
731 // All equivalent individuals to a specific individual
732
733 if (q_obj->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).())
734 {
735 TripleGatherercxx . . $ TripleGatherer# gatherercxx . . $ TripleGatherer#TripleGatherer(dbc16e4b8bce4b59).(&triples, false, OWL_SAME_AScxx . . $ `Kernel/RDF_URIs.h:33:9`!, q_obj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), [cxx . . $ std/function#function(a4b4b0c4acad1616).q_obj](const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry)
736 {
737 return entry != q_obj && static_cast<const TConceptcxx . . $ TConcept#*>(entry)->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).();
738 });
739
740 getSameAscxx . . $ ReasoningKernel#getSameAs(12f6e6d8ee406462).(q_obj_i_exp, gatherer);
741 }
742 else
743 {
744 return;
745 }
746 }
747 else if (q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_EQUIVALENT_CLASScxx . . $ `Kernel/RDF_URIs.h:34:9`! && q_obj != nullptr)
748 {
749 // All equivalent classes to a specific class
750
751 if (!q_obj->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).())
752 {
753 TripleGatherercxx . . $ TripleGatherer# gatherercxx . . $ TripleGatherer#TripleGatherer(dbc16e4b8bce4b59).(&triples, false, OWL_EQUIVALENT_CLASScxx . . $ `Kernel/RDF_URIs.h:34:9`!, q_obj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), [cxx . . $ std/function#function(a4b4b0c4acad1616).q_obj](const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry)
754 {
755 return entry != q_obj && !static_cast<const TConceptcxx . . $ TConcept#*>(entry)->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).();
756 });
757
758 getEquivalentConceptscxx . . $ ReasoningKernel#getEquivalentConcepts(bfb43b18efbd3c83).(q_obj_c_exp, gatherer);
759 }
760 else
761 {
762 return;
763 }
764 }
765 /*else if (q_role_name == OWL_DISJOINT_WITH)
766 {
767 // All disjoint classes with a specific class
768
769 if (!q_obj->isSingleton())
770 {
771 TripleGatherer gatherer(&triples, false, OWL_DISJOINT_WITH, q_obj_name.c_str(), [](const ClassifiableEntry* entry)
772 {
773 const TConcept* concept = static_cast<const TConcept*>(entry);
774 return !concept->isSingleton() && !concept->isSystem() && !concept->isBottom();
775 });
776
777 getDisjointConcepts(q_obj_c_exp, gatherer);
778 }
779 else
780 {
781 return;
782 }
783 }*/
784 else if (q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). RDFS_SUBPROPERTY_OFcxx . . $ `Kernel/RDF_URIs.h:28:9`! && q_obj_role != nullptr)
785 {
786 // All subproperties of a specific property
787
788 TripleGatherercxx . . $ TripleGatherer# gatherercxx . . $ TripleGatherer#TripleGatherer(dbc16e4b8bce4b59).(&triples, false, RDFS_SUBPROPERTY_OFcxx . . $ `Kernel/RDF_URIs.h:28:9`!, q_obj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), [cxx . . $ std/function#function(a4b4b0c4acad1616).q_obj_role](const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry)
789 {
790 return entry != q_obj_role && static_cast<const TNamedEntrycxx . . $ TNamedEntry#*>(entry)->getIdcxx . . $ TNamedEntry#getId(455f465bc33b4cdf).() >= 0;
791 });
792
793 if (q_obj_role->isDataRolecxx . . $ TRole#isDataRole(50ce9a9e25b4a850).())
794 getSubRolescxx . . $ ReasoningKernel#getSubRoles(40dbfdfc57014d78).(q_obj_d_role_exp, false, gatherer);
795 else
796 getSubRolescxx . . $ ReasoningKernel#getSubRoles(40dbfdfc57014d78).(q_obj_o_role_exp, false, gatherer);
797 }
798 else if (q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_EQUIVALENT_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:46:9`! && q_obj_role != nullptr)
799 {
800 // All equivalent properties to a specific property
801
802 TripleGatherercxx . . $ TripleGatherer# gatherercxx . . $ TripleGatherer#TripleGatherer(dbc16e4b8bce4b59).(&triples, false, OWL_EQUIVALENT_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:46:9`!, q_obj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), [cxx . . $ std/function#function(a4b4b0c4acad1616).q_obj_role](const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry)
803 {
804 return entry != q_obj_role && static_cast<const TNamedEntrycxx . . $ TNamedEntry#*>(entry)->getIdcxx . . $ TNamedEntry#getId(455f465bc33b4cdf).() >= 0;
805 });
806
807 if (q_obj_role->isDataRolecxx . . $ TRole#isDataRole(50ce9a9e25b4a850).())
808 getEquivalentRolescxx . . $ ReasoningKernel#getEquivalentRoles(16c9744e53489a41).(q_obj_d_role_exp, gatherer);
809 else
810 getEquivalentRolescxx . . $ ReasoningKernel#getEquivalentRoles(16c9744e53489a41).(q_obj_o_role_exp, gatherer);
811 }
812 else if (q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_INVERSE_OFcxx . . $ `Kernel/RDF_URIs.h:45:9`! && q_obj_role != nullptr)
813 {
814 // Inverse property
815
816 if (!q_obj_role->isDataRolecxx . . $ TRole#isDataRole(50ce9a9e25b4a850).())
817 {
818 const auto* inverse_role = q_obj_role->inversecxx . . $ TRole#inverse(69f26110a94b259f).();
819
820 if (inverse_role != nullptr && inverse_role->getIdcxx . . $ TNamedEntry#getId(455f465bc33b4cdf).() >= 0)
821 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, toRdfcxx . . $ toRdf(fb58d2e09a2a1ce6).(inverse_role->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).()), OWL_INVERSE_OFcxx . . $ `Kernel/RDF_URIs.h:45:9`!, q_obj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).());
822 }
823 }
824 else
825 {
826 // Otherwise take the list of all individuals, classes and roles and run the same query for each individual, class or role separately
827
828 for (auto p_concept = tBox->c_begincxx . . $ TBox#c_begin(23ec1c5bda99ac5d).(); p_concept <cxx . . $ __gnu_cxx/`operator<`(ef3c5749062e825c). tBox->c_endcxx . . $ TBox#c_end(23ec1c5bda99ac5d).(); p_concept++cxx . . $ __gnu_cxx/__normal_iterator#operator++(c443b773b1266d5a).)
829 {
830 const TConceptcxx . . $ TConcept#* concept = *cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p_concept;
831
832 if (!concept->isTopcxx . . $ TNamedEntry#isTop(50ce9a9e25b4a850).() && !concept->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).())
833 getTriplescxx . . $ ReasoningKernel#getTriples(5d4179706023b7bd).(conceptcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).(), q_role_name, q_obj_name, triples);
834 }
835
836 for (auto p_ind = tBox->i_begincxx . . $ TBox#i_begin(78b5d4d1a9fb506d).(); p_ind <cxx . . $ __gnu_cxx/`operator<`(ef3c5749062e825c). tBox->i_endcxx . . $ TBox#i_end(78b5d4d1a9fb506d).(); p_ind++cxx . . $ __gnu_cxx/__normal_iterator#operator++(c443b773b1266d5a).)
837 {
838 const TIndividualcxx . . $ TIndividual#* ind = *cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p_ind;
839 getTriplescxx . . $ ReasoningKernel#getTriples(5d4179706023b7bd).(indcxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).(), q_role_name, q_obj_name, triples);
840 }
841
842 const auto& orm = tBox->getORMcxx . . $ TBox#getORM(94330852db6e789a).();
843
844 for (auto p_role = orm.begincxx . . $ RoleMaster#begin(8bd7f667ced242ca).(); p_role <cxx . . $ __gnu_cxx/`operator<`(ef3c5749062e825c). orm.endcxx . . $ RoleMaster#end(8bd7f667ced242ca).(); p_role++cxx . . $ __gnu_cxx/__normal_iterator#operator++(c443b773b1266d5a).)
845 {
846 const TRolecxx . . $ TRole#* role = *cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p_role;
847 getTriplescxx . . $ ReasoningKernel#getTriples(5d4179706023b7bd).(rolecxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).(), q_role_name, q_obj_name, triples);
848 }
849
850 const auto& drm = tBox->getDRMcxx . . $ TBox#getDRM(94330852db6e789a).();
851
852 for (auto p_role = drm.begincxx . . $ RoleMaster#begin(8bd7f667ced242ca).(); p_role <cxx . . $ __gnu_cxx/`operator<`(ef3c5749062e825c). drm.endcxx . . $ RoleMaster#end(8bd7f667ced242ca).(); p_role++cxx . . $ __gnu_cxx/__normal_iterator#operator++(c443b773b1266d5a).)
853 {
854 const TRolecxx . . $ TRole#* role = *cxx . . $ __gnu_cxx/__normal_iterator#`operator*`(c076846f881f3e7e).p_role;
855 getTriplescxx . . $ ReasoningKernel#getTriples(5d4179706023b7bd).(rolecxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).(), q_role_name, q_obj_name, triples);
856 }
857 }
858 }
859 else if (q_subj != nullptr)
860 {
861 // Subject is specified in the query and it is not a role
862
863 if (q_subj->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).())
864 {
865 // Query subject is an individual
866
867 const TIndividualcxx . . $ TIndividual#* q_subj_ind = static_cast<const TIndividualcxx . . $ TIndividual#*>(q_subj);
868
869 NamesVectorcxx . . $ ReasoningKernel#NamesVector# rolescxx . . $ std/vector#vector(49f6e7a06ebc5aa8).;
870
871 // Fill required role list (either with all roles or with a single role from the query)
872 if (q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).())
873 getRelatedRolescxx . . $ ReasoningKernel#getRelatedRoles(5b76d9c42e2bbb27).(q_subj_i_exp, roles, false, false);
874 else if (!isSpecialRolecxx . . $ isSpecialRole(7c222eea44a24d43).(q_role_name) && !q_role->isDataRolecxx . . $ TRole#isDataRole(50ce9a9e25b4a850).())
875 roles.push_backcxx . . $ std/vector#push_back(fe7a8a4d1eddb70).(q_role);
876
877 // If types are needed
878 if (q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!)
879 {
880 if (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).())
881 {
882 // All types
883 TripleGatherercxx . . $ TripleGatherer# gatherercxx . . $ TripleGatherer#TripleGatherer(dbc16e4b8bce4b59).(&triples, true, RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), [cxx . . $ std/function#function(a4b4b0c4acad1616).](const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry)
884 {
885 return !static_cast<const TConceptcxx . . $ TConcept#*>(entry)->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).();
886 });
887
888 getTypescxx . . $ ReasoningKernel#getTypes(da4dca7a00b57945).(q_subj_i_exp, false, gatherer);
889 }
890 else if (q_obj != nullptr && !q_obj->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).())
891 {
892 // One specific type from the query
893 if (isInstancecxx . . $ ReasoningKernel#isInstance(c3232ab85b187851).(q_subj_i_exp, q_obj_c_exp))
894 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!, q_obj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).());
895 }
896 }
897
898 // If synonyms are needed
899 if (q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_SAME_AScxx . . $ `Kernel/RDF_URIs.h:33:9`!)
900 {
901 if (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).())
902 {
903 // All synonyms
904 TripleGatherercxx . . $ TripleGatherer# gatherercxx . . $ TripleGatherer#TripleGatherer(dbc16e4b8bce4b59).(&triples, true, OWL_SAME_AScxx . . $ `Kernel/RDF_URIs.h:33:9`!, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), [cxx . . $ std/function#function(a4b4b0c4acad1616).q_subj](const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry)
905 {
906 return entry != q_subj && static_cast<const TConceptcxx . . $ TConcept#*>(entry)->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).();
907 });
908
909 getSameAscxx . . $ ReasoningKernel#getSameAs(12f6e6d8ee406462).(q_subj_i_exp, gatherer);
910 }
911 else if (q_obj != nullptr && q_obj->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).() && q_obj != q_subj)
912 {
913 // A single synonym to a specific individual from the query
914 if (isSameIndividualscxx . . $ ReasoningKernel#isSameIndividuals(3deb7925192e8b3).(q_subj_i_exp, q_obj_i_exp))
915 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), OWL_SAME_AScxx . . $ `Kernel/RDF_URIs.h:33:9`!, q_obj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).());
916 }
917 }
918
919 // Gather object role values
920 for (const TNamedEntrycxx . . $ TNamedEntry#* named_entry : roles)
921 {
922 const TRolecxx . . $ TRole#* role = static_cast<const TRolecxx . . $ TRole#*>(named_entry);
923
924 const TORoleExprcxx . . $ ReasoningKernel#TORoleExpr#* role_exp = getExpressionManagercxx . . $ ReasoningKernel#getExpressionManager(867f96a8caac8aab).()->ObjectRolecxx . . $ TExpressionManager#ObjectRole(9eb6018165b5acba).(rolecxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).());
925
926 if (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).())
927 {
928 // All values
929 for (const TIndividualcxx . . $ TIndividual#* obj : getRoleFillerscxx . . $ ReasoningKernel#getRoleFillers(d32c27b9ce89eb2f).(q_subj_i_exp, role_exp))
930 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).(), role->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).(), obj->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).());
931 }
932 else if (q_obj != nullptr && q_obj->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).())
933 {
934 // A specific value from the query
935 if (isRelatedcxx . . $ ReasoningKernel#isRelated(d77eee90dc196fd7).(q_subj_i_exp, role_exp, q_obj_i_exp))
936 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).(), role->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).(), q_obj->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).());
937 }
938 }
939
940 // Gather data role values
941 if (q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).())
942 {
943 // All data roles
944 const TDataValueMapcxx . . $ TDataValueMap#* dataValueMap = q_subj_ind->getDataValueMapcxx . . $ TIndividual#getDataValueMap(a0068babc215c19f).();
945
946 for (const auto& pair : dataValueMap->getAllDataValuescxx . . $ TDataValueMap#getAllDataValues(e3451b3d025d0d5b).())
947 {
948 const TRolecxx . . $ TRole#* role = pair.firstcxx . . $ std/pair#first.;
949 const TDataValueMapcxx . . $ TDataValueMap#::DEVeccxx . . $ TDataValueMap#DEVec#& values = pair.secondcxx . . $ std/pair#second.;
950
951 for (const TDataEntrycxx . . $ TDataEntry#* value : values)
952 {
953 if (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || value->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).() ==cxx . . $ std/`operator==`(3a786e8ce7e53c2c). q_obj_name)
954 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).(), role->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).(), value->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).(), getXsdTypecxx . . $ ReasoningKernel#getXsdType(fc71999b27369f84).(value));
955 }
956 }
957 }
958 else if (q_subj_ind->hasDataValueCachecxx . . $ TIndividual#hasDataValueCache(81d69a9c8508a392).(q_role))
959 {
960 // A specific data role from the query
961 for (const TDataEntrycxx . . $ TDataEntry#* value : q_subj_ind->getDataValueCachecxx . . $ TIndividual#getDataValueCache(2670336a96505da4).(q_role))
962 {
963 if (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || value->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).() ==cxx . . $ std/`operator==`(3a786e8ce7e53c2c). q_obj_name)
964 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).(), q_role->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).(), value->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).(), getXsdTypecxx . . $ ReasoningKernel#getXsdType(fc71999b27369f84).(value));
965 }
966 }
967 }
968 else
969 {
970 // Query subject is a class
971
972 if ((q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!) && (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_obj_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_CLASScxx . . $ `Kernel/RDF_URIs.h:32:9`!))
973 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!, OWL_CLASScxx . . $ `Kernel/RDF_URIs.h:32:9`!);
974
975 // If superclasses are needed
976 if (!q_subj->isBottomcxx . . $ TNamedEntry#isBottom(50ce9a9e25b4a850).() && (q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). RDFS_SUBCLASS_OFcxx . . $ `Kernel/RDF_URIs.h:27:9`!))
977 {
978 if (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).())
979 {
980 // All superclasses
981 TripleGatherercxx . . $ TripleGatherer# gatherercxx . . $ TripleGatherer#TripleGatherer(dbc16e4b8bce4b59).(&triples, true, RDFS_SUBCLASS_OFcxx . . $ `Kernel/RDF_URIs.h:27:9`!, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), [cxx . . $ std/function#function(a4b4b0c4acad1616).q_subj](const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry)
982 {
983 return entry != q_subj && !static_cast<const TConceptcxx . . $ TConcept#*>(entry)->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).();
984 });
985
986 getSupConceptscxx . . $ ReasoningKernel#getSupConcepts(f2bd94c4840cdfac).(q_subj_c_exp, false, gatherer, true);
987 }
988 else if (q_obj != nullptr && !q_obj->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).())
989 {
990 // A specific superclass from the query
991 if (q_obj != q_subj && isSubsumedBycxx . . $ ReasoningKernel#isSubsumedBy(5fdff331daaf87aa).(q_subj_c_exp, q_obj_c_exp))
992 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), RDFS_SUBCLASS_OFcxx . . $ `Kernel/RDF_URIs.h:27:9`!, q_obj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).());
993 }
994 }
995
996 // If synonyms are needed
997 if (q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_EQUIVALENT_CLASScxx . . $ `Kernel/RDF_URIs.h:34:9`!)
998 {
999 if (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).())
1000 {
1001 // All synonyms
1002 TripleGatherercxx . . $ TripleGatherer# gatherercxx . . $ TripleGatherer#TripleGatherer(dbc16e4b8bce4b59).(&triples, true, OWL_EQUIVALENT_CLASScxx . . $ `Kernel/RDF_URIs.h:34:9`!, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), [cxx . . $ std/function#function(a4b4b0c4acad1616).q_subj](const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry)
1003 {
1004 return entry != q_subj && !static_cast<const TConceptcxx . . $ TConcept#*>(entry)->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).();
1005 });
1006
1007 getEquivalentConceptscxx . . $ ReasoningKernel#getEquivalentConcepts(bfb43b18efbd3c83).(q_subj_c_exp, gatherer);
1008 }
1009 else if (q_obj != nullptr && !q_obj->isSingletoncxx . . $ TConcept#isSingleton(50ce9a9e25b4a850).() && q_obj != q_subj)
1010 {
1011 // A synonyms to a specific class from the query
1012 if (isEquivalentcxx . . $ ReasoningKernel#isEquivalent(5fdff331daaf87aa).(q_subj_c_exp, q_obj_c_exp))
1013 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), OWL_EQUIVALENT_CLASScxx . . $ `Kernel/RDF_URIs.h:34:9`!, q_obj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).());
1014 }
1015 }
1016
1017 // If disjoints are needed
1018 /*if (q_subj != nullptr && q_role_name.empty() || q_role_name == OWL_DISJOINT_WITH)
1019 {
1020 if (q_obj_name.empty())
1021 {
1022 // All disjoint classes
1023 TripleGatherer gatherer(&triples, true, OWL_DISJOINT_WITH, q_subj_name.c_str(), [](const ClassifiableEntry* entry)
1024 {
1025 const TConcept* concept = static_cast<const TConcept*>(entry);
1026 return !concept->isSingleton() && !concept->isSystem() && !concept->isBottom();
1027 });
1028
1029 getDisjointConcepts(q_subj_c_exp, gatherer);
1030 }
1031 else if (q_obj != nullptr && !q_obj->isSingleton())
1032 {
1033 // A specific disjoint class from the query
1034 if (isDisjoint(q_subj_c_exp, q_obj_c_exp))
1035 pushTriple(triples, q_subj_name.c_str(), OWL_DISJOINT_WITH, q_obj_name.c_str());
1036 }
1037 }*/
1038 }
1039 }
1040 else if (q_subj_role != nullptr)
1041 {
1042 // Subject is specified in the query and it is a role
1043
1044 if (q_subj_role->isDataRolecxx . . $ TRole#isDataRole(50ce9a9e25b4a850).())
1045 {
1046 if (q_subj_name !=cxx . . $ std/`operator!=`(4b17aa87c9f300c6). OWL_TOP_DATA_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:43:9`!)
1047 {
1048 // Data role properties
1049
1050 if (q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!)
1051 {
1052 if (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_obj_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_DATATYPE_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:40:9`!)
1053 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!, OWL_DATATYPE_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:40:9`!);
1054
1055 if (isFunctionalcxx . . $ ReasoningKernel#isFunctional(f368119995a8beee).(q_subj_d_role_exp) && (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_obj_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_FUNCTIONAL_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:47:9`!))
1056 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!, OWL_FUNCTIONAL_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:47:9`!);
1057 }
1058
1059 if (q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). RDFS_DOMAINcxx . . $ `Kernel/RDF_URIs.h:29:9`!)
1060 {
1061 TripleGatherercxx . . $ TripleGatherer# gatherercxx . . $ TripleGatherer#TripleGatherer(dbc16e4b8bce4b59).(&triples, true, RDFS_DOMAINcxx . . $ `Kernel/RDF_URIs.h:29:9`!, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), [cxx . . $ std/function#function(a4b4b0c4acad1616).q_obj_namecxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5)., q_obj](const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry)
1062 {
1063 return !entry->isSystemcxx . . $ TNamedEntry#isSystem(50ce9a9e25b4a850).() && (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || entry == q_obj);
1064 });
1065
1066 getDRoleDomaincxx . . $ ReasoningKernel#getDRoleDomain(3e2b3159debfbd0c).(q_subj_d_role_exp, true, gatherer);
1067 }
1068
1069 if (q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). RDFS_SUBPROPERTY_OFcxx . . $ `Kernel/RDF_URIs.h:28:9`!)
1070 {
1071 if (q_obj_role != nullptr)
1072 {
1073 if (q_obj_role->isDataRolecxx . . $ TRole#isDataRole(50ce9a9e25b4a850).() && isSubRolescxx . . $ ReasoningKernel#isSubRoles(1eccbaba8fe97673).(q_subj_d_role_exp, q_obj_d_role_exp))
1074 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), RDFS_SUBPROPERTY_OFcxx . . $ `Kernel/RDF_URIs.h:28:9`!, q_obj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).());
1075 }
1076 else if (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).())
1077 {
1078 TripleGatherercxx . . $ TripleGatherer# gatherercxx . . $ TripleGatherer#TripleGatherer(dbc16e4b8bce4b59).(&triples, true, RDFS_SUBPROPERTY_OFcxx . . $ `Kernel/RDF_URIs.h:28:9`!, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), [cxx . . $ std/function#function(a4b4b0c4acad1616).q_subj_role](const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry)
1079 {
1080 return entry != q_subj_role;
1081 });
1082
1083 getSupRolescxx . . $ ReasoningKernel#getSupRoles(40dbfdfc57014d78).(q_subj_d_role_exp, false, gatherer);
1084 }
1085 }
1086
1087 if (q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_EQUIVALENT_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:46:9`!)
1088 {
1089 TripleGatherercxx . . $ TripleGatherer# gatherercxx . . $ TripleGatherer#TripleGatherer(dbc16e4b8bce4b59).(&triples, true, OWL_EQUIVALENT_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:46:9`!, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), [cxx . . $ std/function#function(a4b4b0c4acad1616).q_subj_role, q_obj_namecxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5)., q_obj_role](const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry)
1090 {
1091 return entry != q_subj_role && (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || entry == q_obj_role);
1092 });
1093
1094 getEquivalentRolescxx . . $ ReasoningKernel#getEquivalentRoles(16c9744e53489a41).(q_subj_d_role_exp, gatherer);
1095 }
1096 }
1097 }
1098 else if (q_subj_name !=cxx . . $ std/`operator!=`(4b17aa87c9f300c6). OWL_TOP_OBJECT_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:41:9`!)
1099 {
1100 // Object role properties
1101
1102 if (q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!)
1103 {
1104 if (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_obj_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_OBJECT_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:39:9`!)
1105 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!, OWL_OBJECT_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:39:9`!);
1106
1107 if (isFunctionalcxx . . $ ReasoningKernel#isFunctional(8fc77c3492e4f36b).(q_subj_o_role_exp) && (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_obj_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_FUNCTIONAL_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:47:9`!))
1108 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!, OWL_FUNCTIONAL_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:47:9`!);
1109
1110 if (isInverseFunctionalcxx . . $ ReasoningKernel#isInverseFunctional(8fc77c3492e4f36b).(q_subj_o_role_exp) && (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_obj_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_INVERSE_FUNCTIONAL_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:48:9`!))
1111 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!, OWL_INVERSE_FUNCTIONAL_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:48:9`!);
1112
1113 if (isSymmetriccxx . . $ ReasoningKernel#isSymmetric(8fc77c3492e4f36b).(q_subj_o_role_exp) && (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_obj_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_SYMMETRIC_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:49:9`!))
1114 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!, OWL_SYMMETRIC_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:49:9`!);
1115
1116 if (isAsymmetriccxx . . $ ReasoningKernel#isAsymmetric(8fc77c3492e4f36b).(q_subj_o_role_exp) && (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_obj_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_ASYMMETRIC_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:50:9`!))
1117 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!, OWL_ASYMMETRIC_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:50:9`!);
1118
1119 if (isTransitivecxx . . $ ReasoningKernel#isTransitive(8fc77c3492e4f36b).(q_subj_o_role_exp) && (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_obj_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_TRANSITIVE_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:51:9`!))
1120 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!, OWL_TRANSITIVE_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:51:9`!);
1121
1122 if (isReflexivecxx . . $ ReasoningKernel#isReflexive(8fc77c3492e4f36b).(q_subj_o_role_exp) && (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_obj_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_REFLEXIVE_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:52:9`!))
1123 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!, OWL_REFLEXIVE_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:52:9`!);
1124
1125 if (isIrreflexivecxx . . $ ReasoningKernel#isIrreflexive(8fc77c3492e4f36b).(q_subj_o_role_exp) && (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_obj_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_IRREFLEXIVE_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:53:9`!))
1126 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), RDF_TYPEcxx . . $ `Kernel/RDF_URIs.h:25:9`!, OWL_IRREFLEXIVE_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:53:9`!);
1127 }
1128
1129 if (q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). RDFS_DOMAINcxx . . $ `Kernel/RDF_URIs.h:29:9`!)
1130 {
1131 TripleGatherercxx . . $ TripleGatherer# gatherercxx . . $ TripleGatherer#TripleGatherer(dbc16e4b8bce4b59).(&triples, true, RDFS_DOMAINcxx . . $ `Kernel/RDF_URIs.h:29:9`!, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), [cxx . . $ std/function#function(a4b4b0c4acad1616).q_subj, q_obj_namecxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5)., q_obj](const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry)
1132 {
1133 return !entry->isSystemcxx . . $ TNamedEntry#isSystem(50ce9a9e25b4a850).() && (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || entry == q_obj);
1134 });
1135
1136 getORoleDomaincxx . . $ ReasoningKernel#getORoleDomain(493a91f9acb116f8).(q_subj_o_role_exp, true, gatherer);
1137 }
1138
1139 if (q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). RDFS_RANGEcxx . . $ `Kernel/RDF_URIs.h:30:9`!)
1140 {
1141 TripleGatherercxx . . $ TripleGatherer# gatherercxx . . $ TripleGatherer#TripleGatherer(dbc16e4b8bce4b59).(&triples, true, RDFS_RANGEcxx . . $ `Kernel/RDF_URIs.h:30:9`!, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), [cxx . . $ std/function#function(a4b4b0c4acad1616).q_subj, q_obj_namecxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5)., q_obj](const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry)
1142 {
1143 return !entry->isSystemcxx . . $ TNamedEntry#isSystem(50ce9a9e25b4a850).() && (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || entry == q_obj);
1144 });
1145
1146 getRoleRangecxx . . $ ReasoningKernel#getRoleRange(493a91f9acb116f8).(q_subj_o_role_exp, true, gatherer);
1147 }
1148
1149 if (q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). RDFS_SUBPROPERTY_OFcxx . . $ `Kernel/RDF_URIs.h:28:9`!)
1150 {
1151 if (q_obj_role != nullptr)
1152 {
1153 if (!q_obj_role->isDataRolecxx . . $ TRole#isDataRole(50ce9a9e25b4a850).() && isSubRolescxx . . $ ReasoningKernel#isSubRoles(68b0dcd62a26d5fb).(q_subj_o_role_exp, q_obj_o_role_exp))
1154 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), RDFS_SUBPROPERTY_OFcxx . . $ `Kernel/RDF_URIs.h:28:9`!, q_obj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).());
1155 }
1156 else if (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).())
1157 {
1158 TripleGatherercxx . . $ TripleGatherer# gatherercxx . . $ TripleGatherer#TripleGatherer(dbc16e4b8bce4b59).(&triples, true, RDFS_SUBPROPERTY_OFcxx . . $ `Kernel/RDF_URIs.h:28:9`!, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), [cxx . . $ std/function#function(a4b4b0c4acad1616).q_subj_role](const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry)
1159 {
1160 return entry != q_subj_role && static_cast<const TNamedEntrycxx . . $ TNamedEntry#*>(entry)->getIdcxx . . $ TNamedEntry#getId(455f465bc33b4cdf).() >= 0;
1161 });
1162
1163 getSupRolescxx . . $ ReasoningKernel#getSupRoles(40dbfdfc57014d78).(q_subj_o_role_exp, false, gatherer);
1164 }
1165 }
1166
1167 if (q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_EQUIVALENT_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:46:9`!)
1168 {
1169 TripleGatherercxx . . $ TripleGatherer# gatherercxx . . $ TripleGatherer#TripleGatherer(dbc16e4b8bce4b59).(&triples, true, OWL_EQUIVALENT_PROPERTYcxx . . $ `Kernel/RDF_URIs.h:46:9`!, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), [cxx . . $ std/function#function(a4b4b0c4acad1616).q_subj_role, q_obj_namecxx . . $ std/__cxx11/basic_string#basic_string(a47f53d4115f6ce5)., q_obj_role](const ClassifiableEntrycxx . . $ ClassifiableEntry#* entry)
1170 {
1171 return entry != q_subj_role && static_cast<const TNamedEntrycxx . . $ TNamedEntry#*>(entry)->getIdcxx . . $ TNamedEntry#getId(455f465bc33b4cdf).() >= 0 && (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || entry == q_obj_role);
1172 });
1173
1174 getEquivalentRolescxx . . $ ReasoningKernel#getEquivalentRoles(16c9744e53489a41).(q_subj_o_role_exp, gatherer);
1175 }
1176
1177 if (q_role_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_role_name ==cxx . . $ std/`operator==`(4b17aa87c9f300c6). OWL_INVERSE_OFcxx . . $ `Kernel/RDF_URIs.h:45:9`!)
1178 {
1179 const auto* inverse_role = q_subj_role->inversecxx . . $ TRole#inverse(69f26110a94b259f).();
1180
1181 if (inverse_role != nullptr && inverse_role->getIdcxx . . $ TNamedEntry#getId(455f465bc33b4cdf).() >= 0 && (q_obj_name.emptycxx . . $ std/__cxx11/basic_string#empty(50ce9a9e25b4a850).() || q_obj_role == inverse_role))
1182 pushTriplecxx . . $ pushTriple(f4d4fc70533161ad).(triples, q_subj_name.c_strcxx . . $ std/__cxx11/basic_string#c_str(1016ee5406d91ab9).(), OWL_INVERSE_OFcxx . . $ `Kernel/RDF_URIs.h:45:9`!, toRdfcxx . . $ toRdf(fb58d2e09a2a1ce6).(inverse_role->getNamecxx . . $ TNamedEntry#getName(a9f41ea0e82d88cf).()));
1183 }
1184
1185 }
1186 }
1187 }
1188
1189 //----------------------------------------------------------------------------------
1190 // atomic decomposition queries
1191 //----------------------------------------------------------------------------------
1192
1193 /// create new atomic decomposition of the loaded ontology using TYPE. @return size of the AD
1194 size_tcxx . . $ size_t#
1195 ReasoningKernelcxx . . $ ReasoningKernel# :: getAtomicDecompositionSizecxx . . $ ReasoningKernel#getAtomicDecompositionSize(1ecc58f4296d2e19). ( ModuleMethodcxx . . $ ModuleMethod# moduleMethod, ModuleTypecxx . . $ ModuleType# moduleType )
1196 {
1197 // init AD field
1198 if ( unlikelycxx . . $ `Kernel/globaldef.h:29:10`!(AD != nullptr) )
1199 delete ADcxx . . $ ReasoningKernel#AD.;
1200
1201 ADcxx . . $ ReasoningKernel#AD. = new AtomicDecomposercxx . . $ AtomicDecomposer#AtomicDecomposer(5046fcbd60ea34b7).(getModExtractorcxx . . $ ReasoningKernel#getModExtractor(4d297ab93f9ba51d).(moduleMethod)->getModularizercxx . . $ OntologyBasedModularizer#getModularizer(22b3476e6945f8b5).());
1202 return ADcxx . . $ ReasoningKernel#AD.->getAOScxx . . $ AtomicDecomposer#getAOS(54e527a6df0aab25). ( &Ontologycxx . . $ ReasoningKernel#Ontology., moduleType )->sizecxx . . $ AOStructure#size(fe4d2d262d4164a8).();
1203 }
1204 /// get a set of axioms that corresponds to the atom with the id INDEX
1205 const TOntologyAtomcxx . . $ TOntologyAtom#::AxiomSetcxx . . $ TOntologyAtom#AxiomSet#&
1206 ReasoningKernelcxx . . $ ReasoningKernel# :: getAtomAxiomscxx . . $ ReasoningKernel#getAtomAxioms(510971c2db1388b). ( unsigned int index ) const
1207 {
1208 return (*ADcxx . . $ ReasoningKernel#AD.->getAOScxx . . $ AtomicDecomposer#getAOS(6b8dff3b29b7ab14).())[cxx . . $ AOStructure#`operator[]`(9f94d59263fd233).index]->getAtomAxiomscxx . . $ TOntologyAtom#getAtomAxioms(73e4577bb59fbb07).();
1209 }
1210 /// get a set of axioms that corresponds to the module of the atom with the id INDEX
1211 const TOntologyAtomcxx . . $ TOntologyAtom#::AxiomSetcxx . . $ TOntologyAtom#AxiomSet#&
1212 ReasoningKernelcxx . . $ ReasoningKernel# :: getAtomModulecxx . . $ ReasoningKernel#getAtomModule(510971c2db1388b). ( unsigned int index ) const
1213 {
1214 return (*ADcxx . . $ ReasoningKernel#AD.->getAOScxx . . $ AtomicDecomposer#getAOS(6b8dff3b29b7ab14).())[cxx . . $ AOStructure#`operator[]`(9f94d59263fd233).index]->getModulecxx . . $ TOntologyAtom#getModule(73e4577bb59fbb07).();
1215 }
1216 /// get a set of atoms on which atom with index INDEX depends
1217 const TOntologyAtomcxx . . $ TOntologyAtom#::AtomSetcxx . . $ TOntologyAtom#AtomSet#&
1218 ReasoningKernelcxx . . $ ReasoningKernel# :: getAtomDependentscxx . . $ ReasoningKernel#getAtomDependents(60a3854698667129). ( unsigned int index ) const
1219 {
1220 return (*ADcxx . . $ ReasoningKernel#AD.->getAOScxx . . $ AtomicDecomposer#getAOS(6b8dff3b29b7ab14).())[cxx . . $ AOStructure#`operator[]`(9f94d59263fd233).index]->getDepAtomscxx . . $ TOntologyAtom#getDepAtoms(87724da9ee6d316b).();
1221 }
1222
1223 /// get a number of locality checks performed for creating an AD
1224 unsigned long long
1225 ReasoningKernelcxx . . $ ReasoningKernel# :: getLocCheckNumbercxx . . $ ReasoningKernel#getLocCheckNumber(1c5fc1fd41a99ae7). ( void ) const
1226 {
1227 return ADcxx . . $ ReasoningKernel#AD.->getLocCheckNumbercxx . . $ AtomicDecomposer#getLocCheckNumber(1c5fc1fd41a99ae7).();
1228 }
1229
1230 OntologyBasedModularizercxx . . $ OntologyBasedModularizer#*
1231 ReasoningKernelcxx . . $ ReasoningKernel# :: getModExtractorcxx . . $ ReasoningKernel#getModExtractor(4d297ab93f9ba51d). ( ModuleMethodcxx . . $ ModuleMethod# moduleMethod )
1232 {
1233 // check whether we need init
1234 OntologyBasedModularizercxx . . $ OntologyBasedModularizer#*& pMod = getModPointercxx . . $ ReasoningKernel#getModPointer(f1a752d313dbd853).(moduleMethod);
1235 if ( unlikelycxx . . $ `Kernel/globaldef.h:29:10`!(pMod == nullptr) )
1236 pMod = new OntologyBasedModularizercxx . . $ OntologyBasedModularizer#OntologyBasedModularizer(9bfa6fadb4f4470e). ( getOntologycxx . . $ ReasoningKernel#getOntology(df3ff36553523908).(), moduleMethod );
1237 return pMod;
1238 }
1239
1240 /// get a set of axioms that corresponds to the atom with the id INDEX
1241 const AxiomVeccxx . . $ AxiomVec#&
1242 ReasoningKernelcxx . . $ ReasoningKernel# :: getModulecxx . . $ ReasoningKernel#getModule(1d482f158db4a6a1). ( ModuleMethodcxx . . $ ModuleMethod# moduleMethod, ModuleTypecxx . . $ ModuleType# moduleType )
1243 {
1244 // init signature
1245 TSignaturecxx . . $ TSignature# Sig;
1246 // NB: we don't care about locality type here as modularizer will change it
1247 Sig.setLocalitycxx . . $ TSignature#setLocality(b45ddcbc8423892c).(false);
1248 for ( const TDLExpressioncxx . . $ TDLExpression#* expr : getExpressionManagercxx . . $ ReasoningKernel#getExpressionManager(867f96a8caac8aab).()->getArgListcxx . . $ TExpressionManager#getArgList(ea12e55bef799de0).() )
1249 if ( const TNamedEntitycxx . . $ TNamedEntity#* entity = dynamic_cast<const TNamedEntitycxx . . $ TNamedEntity#*>(expr) )
1250 Sig.addcxx . . $ TSignature#add(70f9d3c046cd5911).(entity);
1251 return getModExtractorcxx . . $ ReasoningKernel#getModExtractor(4d297ab93f9ba51d).(moduleMethod)->getModulecxx . . $ OntologyBasedModularizer#getModule(775fbf5dddf430ba). ( Sig, moduleType );
1252 }
1253
1254 /// get a set of axioms that corresponds to the atom with the id INDEX
1255 const AxiomVeccxx . . $ AxiomVec#&
1256 ReasoningKernelcxx . . $ ReasoningKernel# :: getNonLocalcxx . . $ ReasoningKernel#getNonLocal(1d482f158db4a6a1). ( ModuleMethodcxx . . $ ModuleMethod# moduleMethod, ModuleTypecxx . . $ ModuleType# moduleType )
1257 {
1258 // init signature
1259 TSignaturecxx . . $ TSignature# Sig;
1260 Sig.setLocalitycxx . . $ TSignature#setLocality(b45ddcbc8423892c).(moduleType == M_TOPcxx . . $ M_TOP.); // true for TOP, false for BOT/STAR
1261 for ( const TDLExpressioncxx . . $ TDLExpression#* expr : getExpressionManagercxx . . $ ReasoningKernel#getExpressionManager(867f96a8caac8aab).()->getArgListcxx . . $ TExpressionManager#getArgList(ea12e55bef799de0).() )
1262 if ( const TNamedEntitycxx . . $ TNamedEntity#* entity = dynamic_cast<const TNamedEntitycxx . . $ TNamedEntity#*>(expr) )
1263 Sig.addcxx . . $ TSignature#add(70f9d3c046cd5911).(entity);
1264
1265 // TLISPOntologyPrinter lp(std::cout);
1266 // do check
1267 LocalityCheckercxx . . $ LocalityChecker#* LC = getModExtractorcxx . . $ ReasoningKernel#getModExtractor(4d297ab93f9ba51d).(moduleMethod)->getModularizercxx . . $ OntologyBasedModularizer#getModularizer(22b3476e6945f8b5).()->getLocalityCheckercxx . . $ TModularizer#getLocalityChecker(217d0df15fc6e9c).();
1268 LC->setSignatureValuecxx . . $ LocalityChecker#setSignatureValue(7393b46d99f9f765).(Sig);
1269 Resultcxx . . $ ReasoningKernel#Result..clearcxx . . $ std/vector#clear(49f6e7a06ebc5aa8).();
1270 for ( TDLAxiomcxx . . $ TDLAxiom#* axiom : getOntologycxx . . $ ReasoningKernel#getOntology(df3ff36553523908).() )
1271 {
1272 // std::cout << "Checking locality of ";
1273 // axiom->accept(lp);
1274 if ( !LC->localcxx . . $ LocalityChecker#local(c12ce7eacb2f7daa).(axiom) )
1275 {
1276 // std::cout << "AX non-local" << std::endl;
1277 Resultcxx . . $ ReasoningKernel#Result..push_backcxx . . $ std/vector#push_back(77d9f17553126ecb).(axiom);
1278 }
1279 // else
1280 // std::cout << "AX local" << std::endl;
1281 }
1282 return Resultcxx . . $ ReasoningKernel#Result.;
1283 }
1284
1285 //----------------------------------------------------------------------------------
1286 // save/load interface
1287 //----------------------------------------------------------------------------------
1288
1289 /// check whether @return true if a file with reasoner state with a given NAME exists.
1290 bool
1291 ReasoningKernelcxx . . $ ReasoningKernel# :: checkSaveLoadContextcxx . . $ ReasoningKernel#checkSaveLoadContext(13a55b95a0133754). ( const stdcxx . . $ std/::stringcxx . . $ std/string#& name ) const
1292 {
1293 return SaveLoadManagercxx . . $ SaveLoadManager#SaveLoadManager(9c546c94e5fcce4e).(name).existsContentcxx . . $ SaveLoadManager#existsContent(50ce9a9e25b4a850).();
1294 }
1295
1296 /// set a save/load file to a given NAME
1297 bool
1298 ReasoningKernelcxx . . $ ReasoningKernel# :: setSaveLoadContextcxx . . $ ReasoningKernel#setSaveLoadContext(7c222eea44a24d43). ( const stdcxx . . $ std/::stringcxx . . $ std/string#& name )
1299 {
1300 delete pSLManagercxx . . $ ReasoningKernel#pSLManager.;
1301 pSLManagercxx . . $ ReasoningKernel#pSLManager. = new SaveLoadManagercxx . . $ SaveLoadManager#SaveLoadManager(9c546c94e5fcce4e).(name);
1302 return pSLManagercxx . . $ ReasoningKernel#pSLManager.->existsContentcxx . . $ SaveLoadManager#existsContent(50ce9a9e25b4a850).();
1303 }
1304
1305 /// clear a cache for a given name
1306 bool
1307 ReasoningKernelcxx . . $ ReasoningKernel# :: clearSaveLoadContextcxx . . $ ReasoningKernel#clearSaveLoadContext(13a55b95a0133754). ( const stdcxx . . $ std/::stringcxx . . $ std/string#& name ) const
1308 {
1309 if ( checkSaveLoadContextcxx . . $ ReasoningKernel#checkSaveLoadContext(13a55b95a0133754).(name) )
1310 {
1311 SaveLoadManagercxx . . $ SaveLoadManager#SaveLoadManager(9c546c94e5fcce4e).(name).clearContentcxx . . $ SaveLoadManager#clearContent(83f5f38750778ac8).();
1312 return true;
1313 }
1314 return false;
1315 }
1316
1317 //******************************************
1318 //* Initialization
1319 //******************************************
1320
1321 bool ReasoningKernelcxx . . $ ReasoningKernel# :: initOptionscxx . . $ ReasoningKernel#initOptions(c9857a73d68e59ba). ( void )
1322 {
1323 // register all possible options used in FaCT++ Kernel
1324
1325 // options for TBox
1326
1327 // register "dumpQuery" option -- 11-08-04
1328 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1329 "dumpQuery"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1330 "Option 'dumpQuery' dumps sub-TBox relevant to given satisfiability/subsumption query."cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1331 ifOptioncxx . . $ ifOption#::iotBoolcxx . . $ ifOption#iotBool.,
1332 "false"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1333 ) )
1334 return true;
1335
1336 // register "absorptionFlags" option (04/05/2005)
1337 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1338 "absorptionFlags"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1339 "Option 'absorptionFlags' sets up absorption process for general axioms. "cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1340 "It text field of arbitrary length; every symbol means the absorption action: "
1341 "(B)ottom Absorption), (T)op absorption, (E)quivalent concepts replacement, (C)oncept absorption, "
1342 "(N)egated concept absorption, (F)orall expression replacement, Simple (f)orall expression replacement, "
1343 "(R)ole absorption, (S)plit",
1344 ifOptioncxx . . $ ifOption#::iotTextcxx . . $ ifOption#iotText.,
1345 "BTEfCFSR"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1346 ) )
1347 return true;
1348
1349 // register "alwaysPreferEquals" option (26/01/2006)
1350 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1351 "alwaysPreferEquals"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1352 "Option 'alwaysPreferEquals' allows user to enforce usage of C=D definition instead of C[=D "cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1353 "during absorption, even if implication appeared earlier in stream of axioms.",
1354 ifOptioncxx . . $ ifOption#::iotBoolcxx . . $ ifOption#iotBool.,
1355 "true"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1356 ) )
1357 return true;
1358
1359 // register "useSpecialDomains" option (25/10/2011)
1360 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1361 "useSpecialDomains"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1362 "Option 'useSpecialDomains' (development) controls the special processing of R&D for non-simple roles. "cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1363 "Should always be set to true.",
1364 ifOptioncxx . . $ ifOption#::iotBoolcxx . . $ ifOption#iotBool.,
1365 "true"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1366 ) )
1367 return true;
1368
1369 // options for DLDag
1370
1371 // register "orSortSub" option (20/12/2004)
1372 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1373 "orSortSub"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1374 "Option 'orSortSub' define the sorting order of OR vertices in the DAG used in subsumption tests. "cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1375 "Option has form of string 'Mop', where 'M' is a sort field (could be 'D' for depth, 'S' for size, 'F' "
1376 "for frequency, and '0' for no sorting), 'o' is a order field (could be 'a' for ascending and 'd' "
1377 "for descending mode), and 'p' is a preference field (could be 'p' for preferring non-generating "
1378 "rules and 'n' for not doing so).",
1379 ifOptioncxx . . $ ifOption#::iotTextcxx . . $ ifOption#iotText.,
1380 "0"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1381 ) )
1382 return true;
1383
1384 // register "orSortSat" option (20/12/2004)
1385 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1386 "orSortSat"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1387 "Option 'orSortSat' define the sorting order of OR vertices in the DAG used in satisfiability tests "cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1388 "(used mostly in caching). Option has form of string 'Mop', see orSortSub for details.",
1389 ifOptioncxx . . $ ifOption#::iotTextcxx . . $ ifOption#iotText.,
1390 "0"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1391 ) )
1392 return true;
1393
1394 // options for ToDoTable
1395
1396 // register "IAOEFLG" option
1397 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1398 "IAOEFLG"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1399 "Option 'IAOEFLG' define the priorities of different operations in TODO list. Possible values are "cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1400 "7-digit strings with ony possible digit are 0-6. The digits on the places 1, 2, ..., 7 are for "
1401 "priority of Id, And, Or, Exists, Forall, LE and GE operations respectively. The smaller number means "
1402 "the higher priority. All other constructions (TOP, BOTTOM, etc) has priority 0.",
1403 ifOptioncxx . . $ ifOption#::iotTextcxx . . $ ifOption#iotText.,
1404 "1263005"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1405 ) )
1406 return true;
1407
1408 // options for Reasoner
1409
1410 // register "useSemanticBranching" option
1411 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1412 "useSemanticBranching"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1413 "Option 'useSemanticBranching' switch semantic branching on and off. The usage of semantic branching "cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1414 "usually leads to faster reasoning, but sometime could give small overhead.",
1415 ifOptioncxx . . $ ifOption#::iotBoolcxx . . $ ifOption#iotBool.,
1416 "true"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1417 ) )
1418 return true;
1419
1420 // register "useBackjumping" option
1421 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1422 "useBackjumping"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1423 "Option 'useBackjumping' switch backjumping on and off. The usage of backjumping "cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1424 "usually leads to much faster reasoning.",
1425 ifOptioncxx . . $ ifOption#::iotBoolcxx . . $ ifOption#iotBool.,
1426 "true"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1427 ) )
1428 return true;
1429
1430 // register "testTimeout" option -- 21/08/09
1431 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1432 "testTimeout"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1433 "Option 'testTimeout' sets timeout for a single reasoning test in milliseconds."cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1434 ifOptioncxx . . $ ifOption#::iotIntcxx . . $ ifOption#iotInt.,
1435 "0"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1436 ) )
1437 return true;
1438
1439 // options for Blocking
1440
1441 // register "useLazyBlocking" option -- 08-03-04
1442 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1443 "useLazyBlocking"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1444 "Option 'useLazyBlocking' makes checking of blocking status as small as possible. This greatly "cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1445 "increase speed of reasoning.",
1446 ifOptioncxx . . $ ifOption#::iotBoolcxx . . $ ifOption#iotBool.,
1447 "true"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1448 ) )
1449 return true;
1450
1451 // register "useAnywhereBlocking" option (18/08/2008)
1452 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1453 "useAnywhereBlocking"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1454 "Option 'useAnywhereBlocking' allow user to choose between Anywhere and Ancestor blocking."cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1455 ifOptioncxx . . $ ifOption#::iotBoolcxx . . $ ifOption#iotBool.,
1456 "true"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1457 ) )
1458 return true;
1459
1460 // register "skipBeforeBlock" option (28/02/2009)
1461 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1462 "skipBeforeBlock"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1463 "Internal use only. Option 'skipBeforeBlock' allow user to skip given number of nodes before make a block."cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1464 ifOptioncxx . . $ ifOption#::iotIntcxx . . $ ifOption#iotInt.,
1465 "0"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1466 ) )
1467 return true;
1468
1469 // options for Taxonomy
1470
1471 // register "useCompletelyDefined" option
1472 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1473 "useCompletelyDefined"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1474 "Option 'useCompletelyDefined' leads to simpler Taxonomy creation if TBox contains no non-primitive "cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1475 "concepts. Unfortunately, it is quite rare case.",
1476 ifOptioncxx . . $ ifOption#::iotBoolcxx . . $ ifOption#iotBool.,
1477 "true"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1478 ) )
1479 return true;
1480
1481 // options for kernel
1482
1483 // register "checkAD" option (24/02/2012)
1484 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1485 "checkAD"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1486 "Option 'checkAD' forces FaCT++ to create the AD and exit instead of performing classification"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1487 ifOptioncxx . . $ ifOption#::iotBoolcxx . . $ ifOption#iotBool.,
1488 "false"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1489 ) )
1490 return true;
1491
1492 // register "dumpOntology" option (28/03/2013)
1493 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1494 "dumpOntology"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1495 "Option 'dumpOntology' dumps the ontology loaded into the reasoner in a LISP-like format"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1496 ifOptioncxx . . $ ifOption#::iotBoolcxx . . $ ifOption#iotBool.,
1497 "false"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1498 ) )
1499 return true;
1500
1501 // register "useIncrementalReasoning" option (21/06/2013)
1502 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1503 "useIncrementalReasoning"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1504 "Option 'useIncrementalReasoning' (development) allows one to reason efficiently about small changes in the ontology."cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1505 ifOptioncxx . . $ ifOption#::iotBoolcxx . . $ ifOption#iotBool.,
1506 "false"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1507 ) )
1508 return true;
1509
1510 // register "allowUndefinedNames" option (03/11/2013)
1511 if ( KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb). (
1512 "allowUndefinedNames"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1513 "Option 'allowUndefinedNames' describes the policy of undefined names."cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1514 ifOptioncxx . . $ ifOption#::iotBoolcxx . . $ ifOption#iotBool.,
1515 "true"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1516 ) )
1517 return true;
1518
1519 // register "precacheRelated" option -- 16/11/2021
1520 if (KernelOptionscxx . . $ ReasoningKernel#KernelOptions..RegisterOptioncxx . . $ ifOptionSet#RegisterOption(10eeaca43a3c48cb).(
1521 "precacheRelated"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).,
1522 "Option 'precacheRelated' allows filling cache of individual relations during the consistency check, "cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1523 "which allows for much faster (but sometimes incomplete) queries.",
1524 ifOptioncxx . . $ ifOption#::iotBoolcxx . . $ ifOption#iotBool.,
1525 "true"cxx . . $ std/__cxx11/basic_string#basic_string(e36662616dba894d).
1526 ))
1527 return true;
1528
1529 // all was registered OK
1530 return false;
1531 }
1532