ActionClient Class
The ActionClient class provides a common ROS service abstraction for ontologenius action service. More...
Header: | #include "ontologenius/clients/ActionClient.h" |
Inherits: | ClientBase |
Namespace: | onto |
Public Functions
ActionClient(rconst std::string& name) | |
bool | close() |
bool | save(const std::string& path) |
bool | exportToXml(const std::string& path) |
bool | setLang(const std::string& lang) |
std::string | getLang() |
bool | add(const std::string& uri) |
bool | fadd(const std::string& file) |
bool | reset() |
bool | clear() |
Reimplemented Public Functions
- 2 public functions inherited from ClientBase
Detailed Description
The ActionClient class provides an abstraction ontologenius action ROS services.
This class is based on ClientBase and so ensure a persistent connection with the service based on. The persistent connection ensures a minimal response time. A reconnection logic is implemented in the event that the persistent connection fails.
Public Function Documentation
ActionClient::ActionClient(const std::string& name)
Constructs an action client.
Can be used in a multi-ontology mode by specifying the name of the ontology name. For classic use, name should be defined as "".
bool ActionClient::close()
Links all the concepts loaded from files and the Internet. Before closing an ontology, exploration requests are not allowed.
Returns false ontology closure fails or if the service call fails. Use getErrorCode method to get the origin.
bool ActionClient::save(const std::string& path)
Saves the current ontology in the absolute path path. The path parameter must be of the form: my/path/to/ontology.owl
Returns false if the service call fails.
bool ActionClient::exportToXml(const std::string& path)
Exports the current modification tree in the absolute path path. The path parameter must be of the form: my/path/to/file.xml
This function has no effect on non copied ontologies.
Returns false if the service call fails.
bool ActionClient::setLang(const std::string& lang)
Sets the language of work lang.
Returns false if the service call fails.
std::string ActionClient::getLang()
Returns the working language.
bool ActionClient::add(const std::string& uri)
Loads an ontology file (.owl or .ttl) stored at uri from the internet. The Close function should be called after all the desired files have been loaded.
The owl files can use the import attribute to import additional files. Imported files can be Github URL, Gitlab URL, raw URL or local path. In all cases, Ontologenius will try to identify a ROS package in the paths and will use your local package if it exists.
Returns false if the service call fails.
bool ActionClient::fadd(const std::string& file)
Loads an ontology file (.owl or .tll) stored at file from the your local computer. The Close function should be called after all the desired files have been loaded.
The owl files can use the import attribute to import additional files. Imported files can be Github URL, Gitlab URL, raw URL or local path. In all cases, Ontologenius will try to identify a ROS package in the paths and will use your local package if it exists.
Returns false if the service call fails.
bool ActionClient::reset()
Unloads all the knowledge previously loaded or learned and reload default files.
Returns false if the service call fails.
bool ActionClient::clear()
Unloads all the knowledge previously loaded or learned.
Returns false if the service call fails.