ActionClient Class

The ActionClient class provides a common ROS service abstraction for ontologenius action service. More...

Ros1 Package: ontologenius
Ros2 Package: ontopy
Inherits: ClientBase

Methods

__init__(self, name)
bool close(self)
bool save(self, path)
bool export(self, path)
bool setLang(self, lang)
str getLang(self)
bool add(self, uri)
bool fadd(self, file)
bool reset(self)
bool clear(self)

Reimplemented Methods

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.

Methods Documentation

__init__(self, name)

Constructs an action client.

Can be used in a multi-ontology mode by specifying the name of the ontology name(str). For classic use, name(str) should be defined as ''.

close(self)

Link 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.

save(self, path)

Saves the current ontology in the absolute path(str) path. The path(str) parameter must be of the form: my/path/to/ontology.owl

Returns False if the service call fails.

export(self, path)

Exports the current modification tree in the absolute path(str) path. The path(str) 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.

setLang(self, lang)

Sets the language of work lang(str).

Returns False if the service call fails.

getLang(self)

Return the working language (str).

add(self, uri)

Load an ontology file (.owl or .ttl) stored at uri(str) 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.

fadd(self, file)

Load an ontology file (.owl or .ttl) stored at file(str) from 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.

reset(self)

Unload all the knowledge previously loaded or learned and reload default files.

Returns False if the service call fails.

clear(self)

Unload all the knowledge previously loaded or learned.

Returns False if the service call fails.