RAPP Platform API
 All Classes Namespaces Files Functions Variables Typedefs
ontology_example.cpp
Go to the documentation of this file.
3 #include <iostream>
7 int main(int argc, char* argv[])
8 {
9  if (argc > 1)
10  {
11  std::cout << "query sub/super classes of: " << argv[1] << std::endl;
12  std::string query = argv[1];
13  std::string token = "my_token";
14 
15  // Service Controller
17 
18  // Subclass Ontologies callback
19  auto sb_cb = [](std::vector<std::string> classes)
20  {
21  for (const auto & str : classes)
22  std::cout << str << std::endl;
23  };
24 
25  // the caller object
26  auto sub_call = std::make_shared<rapp::cloud::ontology_subclasses_of>(query, false, sb_cb, token);
27 
28  // Superclass Ontologies
29  auto sp_cb = [](std::vector<std::string> classes)
30  {
31  for (const auto & str : classes)
32  std::cout << str << std::endl;
33  };
34 
35  // the caller
36  auto super_call = std::make_shared<rapp::cloud::ontology_superclasses_of>(query, false, sp_cb, token);
37 
38  // Request from service controller to run this job
39  ctrl.run_job(sub_call);
40  ctrl.run_job(super_call);
41  return 0;
42  }
43 }
Main class that controllers RAPP Services.
void run_job(const std::shared_ptr< asio_socket > job)
Run one service job.
int main(int argc, char *argv[])