FeederPublisher Class

The FeederPublisher class provides an abstraction for ontologenius feeder topic. More...

Ros1 Package: ontologenius
Ros2 Package: ontopy

Methods

__init__(self, name)
addObjectProperty(self, concept_from, property, concept_on, stamp = None)
addDataProperty(self, concept_from, concept_property, type, data, stamp = None)
addInheritage(self, child, parent, stamp = None)
addLanguage(self, concept_from, lang, name, stamp = None)
addConcept(self, concept_from, stamp = None)
removeProperty(self, concept_from, property, stamp = None)
removeObjectProperty(self, concept_from, property, concept_on, stamp = None)
removeDataProperty(self, concept_from, property, type, data, stamp = None)
removeInheritage(self, concept_from, concept_on, stamp = None)
removeLanguage(self, concept_from, lang, name, stamp = None)
removeConcept(self, concept_from, stamp = None)
int getNumSubscribers(self)
waitConnected(self)
bool waitUpdate(self, timeout = 100000000)
str commitAuto(self, timeout = 100000000)
bool commit(self, commit_name, timeout = 100000000)
bool checkout(self, commit_name, timeout = 100000000)
registerNotificationCallback(self, callback)

Detailed Description

The FeederPublisher class provides an abstraction ontologenius feeder(insert) ROS topic.

Working in a closed world can be interesting, but with ontologenius, you can also choose to work in an open world by adding and modifying the agent's knowledge base during its operation. The feeder publisher is used to insert and delete knowledge dynamically. The feeding process is asynchronous and therefore does not guarantee any response time. It still provides functions to synchronize if you have applications where you have to query the ontology right after having modified it.

All modifications can be time-stamped for advanced uses using the republication mechanism.

Methods Documentation

__init__(self, name)

Constructs a FeederPublisher.

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

addObjectProperty(self, concept_from, property, concept_on, stamp = None)

Adds the fact that concept_from(str) is linked with concept_on(str) by the property property(str).

At least concept_from or concept_on must be already known to the system. If one of them is unknown, it will be automatically created. The property can be unknown before calling this function.

If the time stamp stamp (rostime) is not defined, the function takes the current ROS time as the time stamp.

addDataProperty(self, concept_from, concept_property, type, data, stamp = None)

Adds the fact that concept_from(str) is linked to the data data(str) of type type(str) by the property property(str).

concept_from must be already known to the system. The property can be unknown before calling this function.

If the time stamp stamp (rostime) is not defined, the function takes the current ROS time as the time stamp.

addInheritage(self, child, parent, stamp = None)

Adds the inheratage : child(str) is a parent(str). child and parent could by a class, an individual or a property.

At least child or parent must be already known to the system. If one of them is unknown, it will be automatically created.

If the time stamp stamp (rostime) is not defined, the function takes the current ROS time as the time stamp.

addLanguage(self, concept_from, lang, name, stamp = None)

Adds the label name(str) in the language lang(str) the class, individual, or property concept_from(str).

concept_from must be already known to the system.

If the time stamp stamp (rostime) is not defined, the function takes the current ROS time as the time stamp.

addConcept(self, concept_from, stamp = None)

Adds the class or individual concept_from(str).

If the time stamp stamp (rostime) is not defined, the function takes the current ROS time as the time stamp.

removeProperty(self, concept_from, property, stamp = None)

Removes the fact that concept_from(str) is linked to any object by the property property(str).

After this action, knowledge of the property is not removed.

If the time stamp stamp (rostime) is not defined, the function takes the current ROS time as the time stamp.

removeObjectProperty(self, concept_from, property, concept_on, stamp = None)

Removes the fact that concept_from(str) is linked with concept_on(str) by the property property(str).

After this action, knowledge of the property is not removed.

If the time stamp stamp (rostime) is not defined, the function takes the current ROS time as the time stamp.

removeDataProperty(self, concept_from, property, type, data, stamp = None)

Removes the fact that concept_from(str) is linked to the data data(str) of type type(str) by the property property(str).

After this action, knowledge of the property is not removed.

If the time stamp stamp (rostime) is not defined, the function takes the current ROS time as the time stamp.

removeInheritage(self, concept_from, concept_on, stamp = None)

Removes the inheratage : concept_from(str) is a concept_on(str). concept_from and concept_on could by a class, an individual or a property.

If the time stamp stamp (rostime) is not defined, the function takes the current ROS time as the time stamp.

removeLanguage(self, concept_from, lang, name, stamp = None)

Removes the label name(str) in the language lang(str) the class, individual, or property concept_from(str).

If the time stamp stamp (rostime) is not defined, the function takes the current ROS time as the time stamp.

removeConcept(self, concept_from, stamp = None)

Removes the class or individual concept_from(str).

All inheritance, properties, and labels applied to concept_from are also removed.

If the time stamp stamp (rostime) is not defined, the function takes the current ROS time as the time stamp.

getNumSubscribers(self)

Returns the number of subscribers (int) that are currently connected to the internal ROS publisher.

waitConnected(self)

Blocks while no subscribers are currently connected to the internal ROS publisher.

waitUpdate(self, timeout = 100000000)

Waits until all changes have been applied.

The default parameter timeout(int) is the expiration time in milliseconds. The default value is of 100 seconds.

Returns False if the function returns on a timeout.

commitAuto(self, timeout = 100000000)

Saves all the modifications from the previous commit and waits until all changes have been applied.

The default parameter timeout(int) is the expiration time in milliseconds. The default value is of 100 seconds.

Returns the commit id (str) and an empty string if the function returns on a timeout.

This function can only be used on a copied ontology.

commit(self, commit_name, timeout = 100000000)

Saves all the modifications from the previous commit with a specific id commit_name (str) and waits until all changes have been applied.

The default parameter timeout(int) is the expiration time in milliseconds. The default value is of 100 seconds.

Returns False if the function returns on a timeout.

This function can only be used on a copied ontology.

checkout(self, commit_name, timeout = 100000000)

Apply the necessary changes to return to the specified commit_name (str) and waits until all changes have been applied.

The default parameter timeout(int) is the expiration time in milliseconds. The default value is of 100 seconds.

Returns False if the function returns on a timeout.

This function can only be used on a copied ontology.

registerNotificationCallback(self, callback)

Register a callback function to get notifications from the reasoners.

The parameter callback is the callback function taking a string.