/// init c'tor KnowledgeExplorer :: KnowledgeExplorer ( const TBox* box, TExpressionManager* pEM ) : D2I ( box->getDag(), pEM ) { // init all concepts for ( TBox::c_const_iterator c = box->c_begin(), c_end = box->c_end(); c != c_end; ++c ) addE ( Cs, *c ); // init all individuals for ( TBox::i_const_iterator i = box->i_begin(), i_end = box->i_end(); i != i_end; ++i ) addE ( Is, *i ); RoleMaster::const_iterator r, r_end; // init all object roles for ( const auto& R: box->getORM() ) { addE ( ORs, R ); for ( const auto& sup: R->ancestors() ) ORs.add ( R, sup ); } // init all data roles for ( const auto& R: box->getDRM() ) { addE ( DRs, R ); for ( const auto& sup: R->ancestors() ) DRs.add ( R, sup ); } }
/// init c'tor KnowledgeExplorer :: KnowledgeExplorer ( const TBox* box, TExpressionManager* pEM ) : D2I ( box->getDag(), pEM ) { // init all concepts for ( TBox::c_const_iterator c = box->c_begin(), c_end = box->c_end(); c != c_end; ++c ) addE ( Cs, *c ); // init all individuals for ( TBox::i_const_iterator i = box->i_begin(), i_end = box->i_end(); i != i_end; ++i ) addE ( Is, *i ); RoleMaster::const_iterator r, r_end; // init all object roles for ( r = box->getORM()->begin(), r_end = box->getORM()->end(); r != r_end; ++r ) { TRole* R = *r; addE ( ORs, R ); for ( TRole::const_iterator p = R->begin_anc(), p_end = R->end_anc(); p != p_end; ++p ) ORs.add ( R, *p ); } // init all data roles for ( r = box->getDRM()->begin(), r_end = box->getDRM()->end(); r != r_end; ++r ) { TRole* R = *r; addE ( DRs, R ); for ( TRole::const_iterator p = R->begin_anc(), p_end = R->end_anc(); p != p_end; ++p ) DRs.add ( R, *p ); } }
int main(int argc, const char * argv[]) { Graph<int, int> g; for (int i = 1; i < 10 ; i++) { g.addVertex(i); } addE(6, 8, g, 5); addE(2, 3, g, 5); addE(5, 9, g, 2); addE(1, 4, g, 10); addE(4, 7, g, 5); addE(2, 1, g, 6); addE(2, 5, g, 10); addE(5, 4, g, 9); addE(6, 9, g, 1); addE(8, 7, g, 4); FW(g); return 0; }