RAPP Platform  v0.6.0
RAPP Platform is a collection of ROS nodes and back-end processes that aim to deliver ready-to-use generic services to robots
 All Classes Namespaces Files Functions Variables Macros
knowrob_wrapper.h
Go to the documentation of this file.
1 /******************************************************************************
2 Copyright 2015 RAPP
3 
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 
16  Author: Athanassios Kintsakis
17  contact: akintsakis@issel.ee.auth.gr
18 
19 ******************************************************************************/
20 
21 #include <string>
22 #include <iostream>
23 #include <json_prolog/prolog.h>
24 #include <rapp_platform_ros_communications/registerUserOntologyAliasSrv.h>
25 #include <rapp_platform_ros_communications/getUserOntologyAliasSrv.h>
26 #include <rapp_platform_ros_communications/StringArrayMsg.h>
27 #include <rapp_platform_ros_communications/createInstanceSrv.h>
28 #include <rapp_platform_ros_communications/ontologyInstancesOfSrv.h>
29 #include <rapp_platform_ros_communications/ontologyLoadDumpSrv.h>
30 #include <rapp_platform_ros_communications/ontologySubSuperClassesOfSrv.h>
31 #include <rapp_platform_ros_communications/assertRetractAttributeSrv.h>
32 #include <rapp_platform_ros_communications/ontologyIsSubSuperClassOfSrv.h>
33 #include <rapp_platform_ros_communications/returnUserInstancesOfClassSrv.h>
34 #include <rapp_platform_ros_communications/createOntologyAliasSrv.h>
35 #include <rapp_platform_ros_communications/userPerformanceCognitveTestsSrv.h>
36 #include <rapp_platform_ros_communications/createCognitiveExerciseTestSrv.h>
37 #include <rapp_platform_ros_communications/cognitiveTestsOfTypeSrv.h>
38 #include <rapp_platform_ros_communications/recordUserPerformanceCognitiveTestsSrv.h>
39 #include <rapp_platform_ros_communications/clearUserPerformanceCognitveTestsSrv.h>
40 #include <rapp_platform_ros_communications/registerImageObjectToOntologySrv.h>
41 #include <rapp_platform_ros_communications/retractUserOntologyAliasSrv.h>
42 #include <rapp_platform_ros_communications/registerImageObjectToOntologySrv.h>
43 
44 
50 {
51  private:
53  ros::NodeHandle nh_;
54 
56  json_prolog::Prolog pl;
57 
60 
63 
65  //ros::ServiceClient mysql_update_client;
66 
67  public:
68 
72  KnowrobWrapper(ros::NodeHandle nh);
73 
74  void dump_ontology_now();
75 
76  //bool checkIfStringContainsString(std::string a, std::string b);
77  //bool checkIfStringVectorContainsString(std::vector<std::string> vec, std::string a);
78 
84  std::string get_ontology_alias(std::string user_id);
85 
91  std::string create_ontology_alias_for_new_user(std::string user_id);
92 
98  rapp_platform_ros_communications::ontologySubSuperClassesOfSrv::Response subclassesOfQuery(rapp_platform_ros_communications::ontologySubSuperClassesOfSrv::Request req);
99 
105  rapp_platform_ros_communications::ontologySubSuperClassesOfSrv::Response superclassesOfQuery(rapp_platform_ros_communications::ontologySubSuperClassesOfSrv::Request req);
106 
112  rapp_platform_ros_communications::ontologyIsSubSuperClassOfSrv::Response isSubSuperclassOfQuery(rapp_platform_ros_communications::ontologyIsSubSuperClassOfSrv::Request req);
113 
119  rapp_platform_ros_communications::createInstanceSrv::Response createInstanceQuery(rapp_platform_ros_communications::createInstanceSrv::Request req);
120 
126  rapp_platform_ros_communications::ontologyLoadDumpSrv::Response dumpOntologyQuery(rapp_platform_ros_communications::ontologyLoadDumpSrv::Request req);
127 
133  rapp_platform_ros_communications::ontologyLoadDumpSrv::Response loadOntologyQuery(rapp_platform_ros_communications::ontologyLoadDumpSrv::Request req);
134 
140  rapp_platform_ros_communications::assertRetractAttributeSrv::Response assertAttributeValue(rapp_platform_ros_communications::assertRetractAttributeSrv::Request req);
141 
147  rapp_platform_ros_communications::returnUserInstancesOfClassSrv::Response user_instances_of_class(rapp_platform_ros_communications::returnUserInstancesOfClassSrv::Request req);
148 
154  rapp_platform_ros_communications::createOntologyAliasSrv::Response create_ontology_alias(rapp_platform_ros_communications::createOntologyAliasSrv::Request req);
155 
161  rapp_platform_ros_communications::userPerformanceCognitveTestsSrv::Response user_performance_cognitve_tests(rapp_platform_ros_communications::userPerformanceCognitveTestsSrv::Request req);
162 
168  rapp_platform_ros_communications::createCognitiveExerciseTestSrv::Response create_cognitve_tests(rapp_platform_ros_communications::createCognitiveExerciseTestSrv::Request req);
169 
175  rapp_platform_ros_communications::cognitiveTestsOfTypeSrv::Response cognitive_tests_of_type(rapp_platform_ros_communications::cognitiveTestsOfTypeSrv::Request req);
176 
182  rapp_platform_ros_communications::recordUserPerformanceCognitiveTestsSrv::Response record_user_cognitive_tests_performance(rapp_platform_ros_communications::recordUserPerformanceCognitiveTestsSrv::Request req);
183 
189  rapp_platform_ros_communications::clearUserPerformanceCognitveTestsSrv::Response clear_user_cognitive_tests_performance_records(rapp_platform_ros_communications::clearUserPerformanceCognitveTestsSrv::Request req);
190 
196  rapp_platform_ros_communications::registerImageObjectToOntologySrv::Response register_image_object_to_ontology(rapp_platform_ros_communications::registerImageObjectToOntologySrv::Request req);
197 
203  rapp_platform_ros_communications::retractUserOntologyAliasSrv::Response retract_user_ontology_alias(rapp_platform_ros_communications::retractUserOntologyAliasSrv::Request req);
204 
205 
206 
207 
208 };
std::string get_ontology_alias(std::string user_id)
Returns the ontology alias of the user.
rapp_platform_ros_communications::createInstanceSrv::Response createInstanceQuery(rapp_platform_ros_communications::createInstanceSrv::Request req)
Implements the createInstance ROS service.
rapp_platform_ros_communications::returnUserInstancesOfClassSrv::Response user_instances_of_class(rapp_platform_ros_communications::returnUserInstancesOfClassSrv::Request req)
Implements the returnUserInstancesOfClass ROS service.
rapp_platform_ros_communications::assertRetractAttributeSrv::Response assertAttributeValue(rapp_platform_ros_communications::assertRetractAttributeSrv::Request req)
Implements the assertRetractAttribute ROS service.
rapp_platform_ros_communications::createCognitiveExerciseTestSrv::Response create_cognitve_tests(rapp_platform_ros_communications::createCognitiveExerciseTestSrv::Request req)
Implements the create_cognitve_tests ROS service.
rapp_platform_ros_communications::ontologyLoadDumpSrv::Response loadOntologyQuery(rapp_platform_ros_communications::ontologyLoadDumpSrv::Request req)
Implements the loadOntology ROS service.
rapp_platform_ros_communications::recordUserPerformanceCognitiveTestsSrv::Response record_user_cognitive_tests_performance(rapp_platform_ros_communications::recordUserPerformanceCognitiveTestsSrv::Request req)
Implements the record_user_cognitive_tests_performance ROS service.
rapp_platform_ros_communications::registerImageObjectToOntologySrv::Response register_image_object_to_ontology(rapp_platform_ros_communications::registerImageObjectToOntologySrv::Request req)
Implements the register_image_object_to_ontology ROS service.
KnowrobWrapper(ros::NodeHandle nh)
Default constructor.
rapp_platform_ros_communications::createOntologyAliasSrv::Response create_ontology_alias(rapp_platform_ros_communications::createOntologyAliasSrv::Request req)
Implements the create_ontology_alias ROS service.
ros::ServiceClient mysql_get_user_ontology_alias_client
rapp_platform_ros_communications::retractUserOntologyAliasSrv::Response retract_user_ontology_alias(rapp_platform_ros_communications::retractUserOntologyAliasSrv::Request req)
Implements the retract_user_ontology_alias ROS service.
json_prolog::Prolog pl
rapp_platform_ros_communications::clearUserPerformanceCognitveTestsSrv::Response clear_user_cognitive_tests_performance_records(rapp_platform_ros_communications::clearUserPerformanceCognitveTestsSrv::Request req)
Implements the clear_user_cognitive_tests_performance_records ROS service.
rapp_platform_ros_communications::ontologySubSuperClassesOfSrv::Response subclassesOfQuery(rapp_platform_ros_communications::ontologySubSuperClassesOfSrv::Request req)
Implements the subclassesOf ROS service.
rapp_platform_ros_communications::ontologySubSuperClassesOfSrv::Response superclassesOfQuery(rapp_platform_ros_communications::ontologySubSuperClassesOfSrv::Request req)
Implements the superclassesOf ROS service.
void dump_ontology_now()
Dumps the ontology to default path.
ros::ServiceClient mysql_register_user_ontology_alias_client
rapp_platform_ros_communications::ontologyIsSubSuperClassOfSrv::Response isSubSuperclassOfQuery(rapp_platform_ros_communications::ontologyIsSubSuperClassOfSrv::Request req)
Implements the isSubSuperclass ROS service.
rapp_platform_ros_communications::userPerformanceCognitveTestsSrv::Response user_performance_cognitve_tests(rapp_platform_ros_communications::userPerformanceCognitveTestsSrv::Request req)
Implements the user_performance_cognitve_tests ROS service.
ros::NodeHandle nh_
rapp_platform_ros_communications::ontologyLoadDumpSrv::Response dumpOntologyQuery(rapp_platform_ros_communications::ontologyLoadDumpSrv::Request req)
Implements the dumpOntology ROS service.
Class KnowrobWrapperCommunications contains all the necessary knowrob wrapper functions.
rapp_platform_ros_communications::cognitiveTestsOfTypeSrv::Response cognitive_tests_of_type(rapp_platform_ros_communications::cognitiveTestsOfTypeSrv::Request req)
Implements the cognitive_tests_of_type ROS service.
std::string create_ontology_alias_for_new_user(std::string user_id)
Creates a new ontology alias for a user.