ManagerClient Class
The ManagerClient class provides an abstraction for ontologenius manage service. More...
Ros1 Package: | ontologenius |
Ros2 Package: | ontopy |
Inherits: | ClientBase |
Inherited By: | OntologiesManipulator |
Methods
__init__(self) | |
str[] | list(self) |
bool | add(self, name) |
bool | copy(self, dest_name, src_name) |
bool | delete(self, name) |
str[] | getDifference(self, onto_1, onto_2, concept) |
bool | hasRoot(self) |
str | getRootName(self) |
Reimplemented Methods
- 2 methods inherited from ClientBase
Detailed Description
The ManagerClient class provides an abstraction ontologenius manage ROS services.
The manager client is used to manage ontology instances in multi-ontology usage. This makes it possible to start new ontologies or to stop old ones, but also to study the differences of knowledge between several instances. With the manager client, it is easy to develop software using theory of mind.
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)
Constructs a manager client.
Can only be used in a multi-ontology mode.
list(self)
Returns the name of the instantiated ontologies (str[]).
add(self, name)
Create an ontology instance named name(str).
Returns False if the service call fails.
copy(self, dest_name, src_name)
Create a copy of the ontology instance named src_name(str) with the name dest_name(str).
Returns False if the service call fails or if the copy fails.
delete(self, name)
Delete the instance of the ontology named name(str)
Returns False if the service call fails.
getDifference(self, onto_1, onto_2, concept)
Returns the difference of knowledge between onto_1(str) and onto_2(str) regarding the concept (class or individual) concept(str).
The elements of the returned vector are formated as : [+]concept_from|property|concept_on OR [-]concept_from|property|concept_on. An element is positive if it is present in onto_1 and not in onto_2 and negative in reverse.
The difference in inheritance knowledge between concepts is returned with the property isA.
hasRoot(self)
Tests if a root has been setted.
getRootName(self)
Gets the name (str) of the root instance if one has been defined.