RAPP Platform Wiki
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
|
#Methodology
The RAPP Knowrob wrapper ROS node is needed to expose specific services to the other ROS nodes and RPSs (similarly to the MySQL wrapper concept). In our implementation, the pure KnowRob ontology was enhanced after the insertion of extra classes derived from the OpenAAL ontology, as well as others needed to implement the desired RApps.
The services of the RAPP Knowrob wrapper are detailed below.
#ROS Services Each service is analyzed below.
This service was created in order to return the subclasses of a specific ontology class. Apart from the basic functionality, one can perform recursive search in the ontology and not just in the classes’ immediate lower level connections.
Service URL: /rapp/rapp_knowrob_wrapper/subclasses_of
Service type: ```bash
Header header
string ontology_class
string[] results
string error
bool success ```
This service was created in order to return the superclasses of a specific ontology class. Apart from the basic functionality, one can perform recursive search in the ontology and not just in the classes’ immediate higher level connections.
Service URL: /rapp/rapp_knowrob_wrapper/superclasses_of
Service type: ```bash
Header header
string ontology_class
string[] results
string error
bool success ```
This service was created in order to investigate two classes’ semantic relations. Apart from the basic functionality, one can perform recursive search in the ontology and not just in the classes’ immediate higher or lower level connections.
Service URL: /rapp/rapp_knowrob_wrapper/is_subsuperclass_of
Service type: ```bash
Header header
string parent_class
string child_class
bool result
string error
bool success ```
This service was created in order to create an instance related to a specific ontology class. One can also store a file and comments. This service is not public but it is employed from the RIC nodes. Ownership of the new instance is assigned to the provided user which is an instance of the class Person within the ontology. The assignment involves setting an ontology attribute. The username provided in the input is the username of the user in the MySQL database and not the name of the user’s instance in the ontology. The second is also stored within the MySQL database the service acquires it by querying the MySQL database (with the username as input) through the MySQL wrapper. In case no ontology instance name (alias) is defined a new one is created utilizing the Create ontology alias service described below and the Ontology and MySQL database are updated accordingly.
Service URL: /rapp/rapp_knowrob_wrapper/create_instance
Service type: ```bash
Header header
string username
string ontology_class
string file_url
string instance_name
string error
bool success ```
This service was created in order to create an alias for a user within the ontology. A user ontology alias is basically an instance of the class Person that exists within the ontology. The user’s ontology alias is stored within the MySQL database in the respective column of the table User. This service accepts the MySQL username of the user and performs a check by querying the MySQL database in order to identify if an ontology alias has already been defined. If that is the case it simply returns that ontology alias. If not, it creates the ontology alias instance within the ontology, stores this information in the MySQL database and finally it returns the newly created user ontology alias. In the case that a new ontology alias is created both the ontology and the MySQL need to be updated. The service ensures that either both are updated in tandem or in case one fails no modifications take place in the other. This is critical to preserving proper synchronization between the MySQL database and the ontology.
Service URL: /rapp/rapp_knowrob_wrapper/create_ontology_alias
Service type: ```bash
Header header
string ontology_alias
string error
bool success ```
This service allows an ML algorithm to retrieve user-specific information in order to compute and extract personalized data. This service is not exposed via a HOP service, but is employed internally by other RIC nodes. It returns all the ontology instances that are assigned to the ontology alias of the provided user. The ontology alias is acquired again by querying the MySQL database.
Service URL: /rapp/rapp_knowrob_wrapper/user_instances_of_class
Service type: ```bash
Header header
string username
String[] results
string error
bool success ```
Since the KnowRob ontology framework does not provide online storage functionality, the ontology (along with the new information) must be stored in predefined time slots. This way, if a system crash occurs, the stored data won’t be lost but can be retrieved using the Load ontology ROS service. Both of these services have a common representation.
Service URL: /rapp/rapp_knowrob_wrapper/load_ontology
Service URL: /rapp/rapp_knowrob_wrapper/dump_ontology
Service type: ```bash
Header header
string error
bool success ```
This service creates a new cognitive exercise test in the ontology as an instance. This service is not exposed via a HOP service, but is employed internally by the RAPP Cognitive exercise system node. It accepts as input that parameters of the test which include its type, subtype, difficulty, variation and file path and returns the name of the ontology instance created.
Service URL: /rapp/rapp_knowrob_wrapper/create_cognitve_tests
Service type: ```bash
Header header
string test_type
string test_subtype
int32 test_difficulty
int32 test_variation
string test_name
string error
bool success ```
This service returns all cognitive tests of the given type that exist within the ontology. This service is not exposed via a HOP service, but is employed internally by the RAPP Cognitive exercise system node. It accepts as input the test type and returns the names of the tests and their parameters which include their subtypes, file paths, difficulties and variation ids.
Service URL: /rapp/rapp_knowrob_wrapper/cognitive_tests_of_type
Service type: ```bash
Header header
string[] tests
string[] subtype
string[] file_paths
string[] difficulty
string[] variation
string error
bool success ```
This service records the user’s (patient’s) performance on a given test at a given time. Performance is measured as integer value in the 0-100 range. This service is not exposed via a HOP service, but is employed internally by the RAPP Cognitive exercise system node.
Service URL: /rapp/rapp_knowrob_wrapper/record_user_cognitive_tests_performance
Service type: ```bash
Header header
string test
string test_type
string patient_ontology_alias
int32 score
string cognitive_test_performance_entry
string error
bool success ```
This service returns all the tests of the requested type that a specific user (patient) has undertaken along with the scores achieved, the time at which they were performed and the difficulty and variation ids of the tests. This service is not exposed via a HOP service, but is employed internally by the RAPP Cognitive exercise system node.
Service URL: /rapp/rapp_knowrob_wrapper/user_performance_cognitve_tests
Service type: ```bash
Header header
string ontology_alias
string[] tests
string[] scores
string[] difficulty
string[] variation
string[] timestamps
string error
bool success ```
This service will register an image, annotated by the rapp_caffe_wrapper to the ontology.
Service URL: /rapp/rapp_knowrob_wrapper/register_image_object_to_ontology
Service type: ```bash
Header header #the user's ontology alias string user_ontology_alias #the ontology class of the to be registered object string object_ontology_class #the caffe class of the to be registered object string caffe_class #the path to the image representing the object string image_path #timestamp of the time of registration
#the name of the registered object entry string object_entry #possible error string error #trace information string[] trace #true if service call was successful bool success ```
This service will remove the ontology alias of a user from the ontology.
Service URL: /rapp/rapp_knowrob_wrapper/retract_user_ontology_alias
Service type: ```bash
Header header #the user ontology alias to be retracted
#possible error string error #trace information string[] trace #true if service call was successful bool success ```
This service will remove all cognitive test performance records of a user from the ontology.
Service URL: /rapp/rapp_knowrob_wrapper/clear_user_cognitive_tests_performance_records
Service type: ```bash
Header header #the username of the user whose records will be cleared string username #specify clearing the records of this test type onle
#possible error string error #trace information string[] trace #true if service call was successful bool success ```
#Launchers
Launches the rapp_knowrob_wrapper node and can be launched using ``` roslaunch rapp_knowrob_wrapper knowrob_wrapper.launch ```
#HOP services
``` /hop/ontology_subclasses_of ```
```js { query: '' } ```
application/json response.
```javascript { results: [], error: '' } ```
```javascript { results: [ 'http://knowrob.org/kb/knowrob.owl#Oven', 'http://knowrob.org/kb/knowrob.owl#MicrowaveOven', 'http://knowrob.org/kb/knowrob.owl#RegularOven', 'http://knowrob.org/kb/knowrob.owl#ToasterOven'], error: '' } ```
``` /hop/ontology_superclasses_of ```
```js { query: '' } ```
application/json response.
```javascript { results: [], error: '' } ```
``` /hop/ontology_is_subsuperclass_of ```
```js { parent_class: '', child_class: '', recursive: false } ```
application/json response.
```javascript { result: true, error: '' } ```