Guillaume Sarthou : Knowledge representation and exploitation for interactive and cognitive robots.
+
+
+
+
+ Guillaume Sarthou : Knowledge representation and exploitation for interactive and cognitive robots.
Diss. Université Paul Sabatier, France, 2021.
2019
-
Guillaume Sarthou, Aurélie Clodic and Rachid Alami. Ontologenius : A long-term semantic memory for robotic agents.
+
+
+
+
+ Guillaume Sarthou, Aurélie Clodic and Rachid Alami. Ontologenius : A long-term semantic memory for robotic agents.
In International Conference on Robot & Human Interactive Communication (RO-MAN). New Delhi, India, 2019.
Related Publications
@@ -103,18 +111,34 @@
Related Publications
2021
-
Guillaume Sarthou, Guilhem Buisan, CLODIC, Aurélie Clodic, Rachid Alami : Extending Referring Expression Generation through shared knowledge about
+
+
+
+
+ Guillaume Sarthou, Guilhem Buisan, CLODIC, Aurélie Clodic, Rachid Alami : Extending Referring Expression Generation through shared knowledge about
past Human-Robot collaborative activity. In : IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS). 2021.
-
Guillaume Sarthou, Amandine Mayima, Guilhem Buisan, Kathleen Belhassein, Aurélie Clodic : The Director Task: a Psychology-Inspired Task to Assess Cognitive and Interactive Robot Architectures.
+
+
+
+
+ Guillaume Sarthou, Amandine Mayima, Guilhem Buisan, Kathleen Belhassein, Aurélie Clodic : The Director Task: a Psychology-Inspired Task to Assess Cognitive and Interactive Robot Architectures.
In International Conference on Robot & Human Interactive Communication (RO-MAN). 2021.
2020
-
Guilhem Buisan, Guillaume Sarthou, Arthur Bit-Monnot, Aurélie Clodic, Rachid Alami : Efficient, Situated and Ontology based Referring Expression Generation for Human-Robot collaboration.
+
+
+
+
+ Guilhem Buisan, Guillaume Sarthou, Arthur Bit-Monnot, Aurélie Clodic, Rachid Alami : Efficient, Situated and Ontology based Referring Expression Generation for Human-Robot collaboration.
In International Conference on Robot & Human Interactive Communication (RO-MAN). Naples, Italy, 2020.
-
Guilhem Buisan, Guillaume Sarthou, Rachid Alami : Human Aware Task Planning Using Verbal Communication Feasibility and Costs
+
+
+
+
+ Guilhem Buisan, Guillaume Sarthou, Rachid Alami : Human Aware Task Planning Using Verbal Communication Feasibility and Costs
In International Conference on Social Robotics (ICSR). Golden, Colorado, 2020.
diff --git a/docs/SetUp.html b/docs/SetUp.html
index 679ffd56..001f0990 100644
--- a/docs/SetUp.html
+++ b/docs/SetUp.html
@@ -1,7 +1,7 @@
- Set up | Ontologenius 0.2.12
+ Set up | Ontologenius 0.3.0
@@ -93,20 +93,20 @@
Set Up Your Environnement
The package.xml in format 2 should look like this:
The ClassIndexClient class provides an abstraction of ontologenius classes ROS service.
+
The ontologenius classes service allows the exploration of classes contained by ontologenius core using indexes.
+
This class is based on ClientBaseIndex and so ensure a persistent connection with ontologenius/class_index service.
+ The persistent connection ensures a minimal response time.
+ A reconnection logic is implemented in the event that the persistent connection fails.
+
At the difference of the usual ClassClient class, this one provides access to the interface based on indexes (integers) for better performances.
Gives all classes below the one given in the parameter: index.
+
The optional depth parameter can be set to limit tree propagation to a specific value. The default value -1 represents no propagation limitation.
+
The optional selector parameter can be set to only get results inheriting from the selector class. The default value 0 represents no restriction on the result.
Gives all the classes pointed by the property property and applied to the class index.
+
The optional selector parameter can be set to only get results inheriting from the selector class. The default value 0 represents no restriction on the result.
Gives all the classes having the given property property and pointing to the class index.
+
The optional selector parameter can be set to only get results inheriting from the selector class. The default value 0 represents no restriction on the result.
+
+
std::vector<int64_t> ClassIndexClient::getWith(int64_tclass_from, int64_tclass_to, int64_tselector = 0, int depth = -1)
+
Gives all the properties linking the two classes class_from and class_to.
+
The optional selector parameter can be set to only get results inheriting from the selector property. The default value 0 represents no restriction on the result.
+
The optional depth parameter can be set to limit tree propagation to a specific value. The default value -1 represents no propagation limitation.
Gives all the properties for which the class index is part of the domain.
+
The optional selector parameter can be set to only get results inheriting from the selector property. The default value 0 represents no restriction on the result.
+
The optional depth parameter can be set to limit tree propagation of the class to a specific value. The default value -1 represents no propagation limitation.
Gives all the properties for which the class index is part of the range.
+
The optional selector parameter can be set to only get results inheriting from the selector property. The default value 0 represents no restriction on the result.
+
The optional depth parameter can be set to limit tree propagation of the class to a specific value. The default value -1 represents no propagation limitation.
The ClientBaseIndex class provides an abstraction for any ROS services based on indexes.
+
This class 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.
The ConversionClient class provides an abstraction to the ontologenius conversion ROS services to pass from identifiers to indexes and inverse.
+
This class ensures 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
+
+
ConversionClient::ConversionClient(ros::NodeHandle* n, const std::string& name)
+
Constructs an conversion client with a pointer to a NodeHandle n.
+
Can be used in a multi-ontology mode by specifying the name of the ontology name. For classic use, name should be defined as "".
+
+
void ConversionClient::verbose(boolverbose)
+
If verbose is set to true, the clients will post messages about the failure to call the services and about their restoration.
Converts a vector of indexes representing individuals to identifiers.
+
Returns a vector of identifiers whose order matches the original indexes order. Unknown concepts (or from wrong types) will be return as empty strings.
Converts a vector of indexes representing classes to identifiers.
+
Returns a vector of identifiers whose order matches the original indexes order. Unknown concepts (or from wrong types) will be return as empty strings.
Converts a vector of indexes representing data properties to identifiers.
+
Returns a vector of identifiers whose order matches the original indexes order. Unknown concepts (or from wrong types) will be return as empty strings.
Converts a vector of indexes representing object properties to identifiers.
+
Returns a vector of identifiers whose order matches the original indexes order. Unknown concepts (or from wrong types) will be return as empty strings.
Converts a vector of indexes representing literals to identifiers.
+
Returns a vector of identifiers whose order matches the original indexes order. Unknown concepts (or from wrong types) will be return as empty strings.
The DataPropertyIndexClient class provides an abstraction of ontologenius data properties ROS service.
+
The ontologenius data properties service allows the exploration of data properties contained by ontologenius core using indexes.
+
This class is based on ClientBaseIndex and so ensure a persistent connection with ontologenius/data_property_index service.
+ The persistent connection ensures a minimal response time.
+ A reconnection logic is implemented in the event that the persistent connection fails.
+
At the difference of the usual DataPropertyClient class, this one provides access to the interface based on indexes (integers) for better performances.
The IndividualIndexClient class provides an abstraction of ontologenius individuals ROS service.
+
The ontologenius individuals' service allows the exploration of individuals contained by ontologenius core using indexes
+
This class is based on ClientBaseIndex and so ensure a persistent connection with ontologenius/individual service.
+ The persistent connection ensures a minimal response time. A reconnection logic is implemented in the event that the persistent connection fails.
+
At the difference of the usual IndividualClient class, this one provides access to the interface based on indexes (integers) for better performances.
Gives all the individuals pointed by the property property and applied to the individual index.
+
The optional selector parameter can be set to only get results inheriting from the selector class. The default value "" represents no restriction on the result.
Gives all the individuals having the given property property and pointing to the individual index.
+
The optional selector parameter can be set to only get results inheriting from the selector class. The default value "" represents no restriction on the result.
Gives all the properties linking the individual index_from to the individual index_to.
+
The optional selector parameter can be set to only get results inheriting from the selector property. The default value "" represents no restriction on the result.
+
The optional depth parameter can be set to limit tree propagation to a specific value. The default value -1 represents no propagation limitation.
Gives all the properties for which the individual index is part of the domain.
+
The optional selector parameter can be set to only get results inheriting from the selector property. The default value "" represents no restriction on the result.
+
The optional depth parameter can be set to limit tree propagation of the individual to a specific value. The default value -1 represents no propagation limitation.
Gives all the properties for which the individual index is part of the range.
+
The optional selector parameter can be set to only get results inheriting from the selector property. The default value "" represents no restriction on the result.
+
The optional depth parameter can be set to limit tree propagation of the individual to a specific value. The default value -1 represents no propagation limitation.
The ObjectPropertyIndexClient class provides an abstraction of ontologenius object properties ROS service.
+
The ontologenius object properties service allows the exploration of object properties contained by ontologenius core.
+
This class is based on ClientBaseIndex and so ensure a persistent connection with ontologenius/object_property service.
+ The persistent connection ensures a minimal response time. A reconnection logic is implemented in the event that the persistent connection fails.
+
At the difference of the usual ObjectPropertyClient class, this one provides access to the interface based on indexes (integers) for better performances.
Creates a new instance of ontologyManipulator identified by the name dest_name that manipulates a copy of the ontology handled by the ontologyManipulator src_name.
+
Creates a new instance of ontologyManipulator and OntologyIndexManipulator identified by the name dest_name that manipulates a copy of the ontology handled by the ontologyManipulator src_name.
Returns false if the copy fails. Returns true even if the instance already exists.
The OntologyIndexClient class provides an abstraction common to all ontologenius exploration ROS services.
+
The OntologyIndexClient implements the functions common to every ontologenius exploration based on indexes.
+
This class is based on ClientBaseIndex 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.
+
At the difference of the usual OntologyClient class, this one provides access to the interfaces based on indexes (integers) for better performances.
Gives all concepts below the one given in the parameter: index.
+
The optional depth parameter can be set to limit tree propagation to a specific value. The default value -1 represents no propagation limitation.
+
The optional selector parameter can be set to only get results inheriting from the selector concept. The default value "" represents no restriction on the result.
Returns true if the concept index is or inherits of the concept base_class. This function corresponds to checking if class_base is part of the result of the function getUp applies to the concept index
The default take_id argument can be set to false if you do not want to consider the concept identifier as a possible default name.
+
The optional selector parameter can be set to only get results inheriting from the selector concept. The default value "" represents no restriction on the result.
+
The result of this function depends on the setting of the working language.
Gives all the concepts having for label a subset of name.
+
The default take_id argument can be set to false if you do not want to consider the concept identifier as a possible default name.
+
The optional selector parameter can be set to only get results inheriting from the selector concept. The default value "" represents no restriction on the result.
+
The result of this function depends on the setting of the working language.
Gives all concepts with a label matching the regular expression regex.
+
The default take_id argument can be set to false if you do not want to consider the concept identifier as a possible default name.
+
The optional selector parameter can be set to only get results inheriting from the selector concept. The default value "" represents no restriction on the result.
+
The result of this function depends on the setting of the working language.
Gives all the names of concepts with the lowest edit distance with parameter name.
+
The default take_id argument can be set to false if you do not want to consider the concept identifier as a possible default name.
+
The optional selector parameter can be set to only get results inheriting from the selector concept. The default value "" represents no restriction on the result.
+
The result of this function depends on the setting of the working language and does not correspond to the concept identifiers but to other labels known by ontologenius.
+
The minimum editing distance can be set with the threshold parameter. This value corresponds to the number of changes to be made to pass from one word to another divided by the length of the comparison word.
+
+
bool OntologyIndexClient::exist(int64_tindex)
+
Returns true if the concept name exists in the subpart of the ontology managed by the client (i.e. class, individuals, object properties, data properties).
+
+
+
Muted labels
+
Ontologenius introduces the concept of muted label. They are written <onto:label> in an OWL file.
+
A muted label will be useful for adding labels with errors. These labels will allow you to find a concept with an error but will make sure you never use it in output (using getName).
The OntologyManipulatorIndex class is just an object to access all API ROS abstraction classes so that you can query and manage ontologenius.
+
At the difference of the usual OntologyManipulator class, this one provides access to the interfaces based on indexes (integers) for better performances.
Gives the total number of service calls from all ROS clients instances since the last reset.
+
+
OntologyManipulatorIndex::resetNb()
+
Reset Call Counter for all instances of ROS clients.
+
+
bool OntologyManipulatorIndex::close()
+
Same as the ActionClient closing function. Link all the concepts loaded from files and the Internet. Before closing an ontology, exploration requests are not allowed.
+
Returns false if the service call fails.
+
+
OntologyManipulatorIndex::verbose(bool verbose)
+
If verbose is set to true, the clients will post messages about the failure to call the services and about their restoration.
As explained above, the ontology manipulator contains several objects to abstract ROS services.
The set of services work in a connected mode which allows to greatly save in execution time but
@@ -267,7 +277,7 @@
Setting up the program
ros::init(argc, argv, "intruder");
ros::NodeHandle n;
-
OntologyManipulator onto;
+
onto::OntologyManipulator onto;
onto_ = &onto;
onto.close();
@@ -310,7 +320,7 @@
Setting up the program
Initialize ROS and Create a handle to this process' node.
-
OntologyManipulator onto;
+
onto::OntologyManipulator onto;
onto_ = &onto;
We finally come back to using ontologenius! We create here our first manipulator ontology,
diff --git a/docs/cpp_Tutorials/tutorial2/FindOurWay.html b/docs/cpp_Tutorials/tutorial2/FindOurWay.html
index c9bb4d09..c60f8fd8 100644
--- a/docs/cpp_Tutorials/tutorial2/FindOurWay.html
+++ b/docs/cpp_Tutorials/tutorial2/FindOurWay.html
@@ -97,6 +97,16 @@
This is the last tutorial! Implementing algorithms, we all know that scaling is important and that performances can become a bottleneck when trying to do so.
+ Furthermore, using an external knowledge base and thus passing by a communication layer, the amount of data to transfer can be an issue.
+ In such a way, the use of strings to interact with Ontologenius is not the more suitable one to have the best performances possible...
+ This is why Ontologenius proposes an interface based on indexes as integers!
+ More than reducing the amount of data to transfer, that provides a significative gain in Ontologenius internal algorithms and allows you to do the same on your side.
+
+
+
The mini-project that we will do will be the adaptation of the second tutorial algorithm, by using indexes..
+
+
+
+
The ontology manipulator
+
+
Until now, we have used an OntologyManipulator to access the different methods to explore the ontology, but using concept's identifiers (strings).
+
+
To access the index version of the API, we will now use an OntologyManipulatorIndex.
+ If it seems to be the exact same one as the original one, this is normal. Indeed, the interface is the same (same members' name and same functions' name) but all the exploration queries use indexes instead of identifiers, meaning integers instead of strings.
+ All related classes, based on index use, can be found at the bottom of the left sidebar.
+
+
+
Working in multi instances mode, you steal have to use an OntologiesManipulator and insteed of using the get method to extract an OntologyManipulator, you can use the getIndex method to extract an OntologyManipulatorIndex.
+
+
Passing from indentifiers to indexes
+
+
Before moving ahead, one should ask itself "But how can I know the index of a concept?", and this is an excellent question...
+
+
Indexes are attributed by Ontologenius to any concepts. It is a kind of internal identifier used by Ontologenius to ease the concepts manipulation.
+ In such a way, from one run to another, we cannot ensure that a given concept will have the same index...
+ It is thus important to first query Ontologenius for the indexes.
+
+
+
The actual only difference between an OntologiesManipulator and an OntologyManipulatorIndex, is the presence of a "conversion" member.
+ The conversion member is an instance of a ConversionClient which allows
+ you to pass from identifiers to indexes and inverse.
+
+
+
To better understand, let's take an easy example. Compile the folowing code and run in while launching Ontologenius with the launch file of the second tutorial.
In this example we have asked for the index of the "path" concept, then we have queried all the individuals of this type, but using the index, and finally,
+ we have converted the result into identifiers to display it to the user! Easy!
+
+
Literals and names
+
+
In index-based use, two special cases hold: the literals and the names in natural language.
+
+
First of all, the names in natural language do not use indexes and should thus be used with strings as usual.
+
+
At the difference, the literals used with data properties have indexes associated with them.
+ However, these indexes are negative! This specificity can be useful to easily discriminate literals to usual concepts.
+
+
+
Nevertheless, if concepts have positive indexes and literals have negative ones, what about zero?
+ It holds as an empty string as used in the identifier-based queries, meaning no answer.
+
+
+
Time to code!
+
+
It is now your turn to code. Take the final version of tutorial 2 and modify it to use indexes. A solution is provided on the next page of the tutorial.
+
+
While coding keep in mind that conversion between identifiers and indexes should be kept as the interface with your algorithm (initialisation and result display) and should be avoided in it.
+
+
In cpp use, to gain in flexibility do not hesitate to use templates or typedef to easily pass from strings to indexes.
Here is a possible solution with use of templates.
+ You can note that we have queried the index of the property "isAlong" only once at the initialisation to avoid to recompute static information.
+ In a more usual way using classes, you could create a map with all the "static" indexes.
+
+
+
+
+
diff --git a/docs/images/ontologenius.ico b/docs/images/ontologenius.ico
index 007c3924..d91aeea2 100644
Binary files a/docs/images/ontologenius.ico and b/docs/images/ontologenius.ico differ
diff --git a/docs/images/ontologenius.png b/docs/images/ontologenius.png
index cf460a70..0fa5ae83 100644
Binary files a/docs/images/ontologenius.png and b/docs/images/ontologenius.png differ
diff --git a/docs/img/logo/ontologenius.svg b/docs/images/ontologenius.svg
similarity index 99%
rename from docs/img/logo/ontologenius.svg
rename to docs/images/ontologenius.svg
index 17d4c905..5abac3a0 100644
--- a/docs/img/logo/ontologenius.svg
+++ b/docs/images/ontologenius.svg
@@ -14,7 +14,7 @@
viewBox="0 0 210 297"
version="1.1"
id="svg8"
- inkscape:version="0.92.3 (2405546, 2018-03-11)"
+ inkscape:version="0.92.5 (2060ec1f9f, 2020-04-08)"
sodipodi:docname="ontologenius.svg">
@@ -25,16 +25,16 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="0.9899495"
- inkscape:cx="-256.02781"
- inkscape:cy="631.60755"
+ inkscape:zoom="0.49497475"
+ inkscape:cx="-154.81619"
+ inkscape:cy="619.48016"
inkscape:document-units="mm"
inkscape:current-layer="g890"
showgrid="false"
- inkscape:window-width="1853"
- inkscape:window-height="1025"
- inkscape:window-x="67"
- inkscape:window-y="27"
+ inkscape:window-width="1848"
+ inkscape:window-height="1129"
+ inkscape:window-x="72"
+ inkscape:window-y="994"
inkscape:window-maximized="1"
showguides="false" />
image/svg+xml
-
+
diff --git a/docs/images/pdf_icon.png b/docs/images/pdf_icon.png
new file mode 100644
index 00000000..d5dc409b
Binary files /dev/null and b/docs/images/pdf_icon.png differ
diff --git a/docs/images/tutorial/forest.jpg b/docs/images/tutorial/forest.jpg
new file mode 100644
index 00000000..402aa8cf
Binary files /dev/null and b/docs/images/tutorial/forest.jpg differ
diff --git a/docs/img/architecture/Graphs.png b/docs/img/architecture/Graphs.png
deleted file mode 100644
index 19838659..00000000
Binary files a/docs/img/architecture/Graphs.png and /dev/null differ
diff --git a/docs/img/architecture/architecture.md b/docs/img/architecture/architecture.md
deleted file mode 100644
index b344ec22..00000000
--- a/docs/img/architecture/architecture.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# ontologenius architecture
-
-In the source and include folder, you will find several folders each containing part of the project. This architecture file is intended to make you understand the overall architecture of the project by presenting the various sub-architecture.
-
-## ontoGraphs
-
-**ontoGraphs** aims to contain all ontology words (individuals, classes and properties) and to provide quick access to each data and the relationships between all data. In addition, it can analyze the validity of the global ontology and read the OWL files to fill the ontology data structure.
-
-
diff --git a/docs/img/classes_accessors.png b/docs/img/classes_accessors.png
deleted file mode 100644
index 83187a5f..00000000
Binary files a/docs/img/classes_accessors.png and /dev/null differ
diff --git a/docs/img/individuals_accessors.png b/docs/img/individuals_accessors.png
deleted file mode 100644
index f7b04090..00000000
Binary files a/docs/img/individuals_accessors.png and /dev/null differ
diff --git a/docs/img/logo/ontologenius.ico b/docs/img/logo/ontologenius.ico
deleted file mode 100644
index 007c3924..00000000
Binary files a/docs/img/logo/ontologenius.ico and /dev/null differ
diff --git a/docs/img/logo/ontologenius.png b/docs/img/logo/ontologenius.png
deleted file mode 100644
index 6c35f5f3..00000000
Binary files a/docs/img/logo/ontologenius.png and /dev/null differ
diff --git a/docs/img/ontoloGUI.png b/docs/img/ontoloGUI.png
deleted file mode 100644
index 554eb412..00000000
Binary files a/docs/img/ontoloGUI.png and /dev/null differ
diff --git a/docs/index.html b/docs/index.html
index 011ec3a1..3911a4ef 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -1,7 +1,7 @@
- Ontologenius 0.2.12
+ Ontologenius 0.3.0
@@ -101,7 +101,7 @@
An easy way to use ontologies for artificial agent applications.
A smart way to organize the knowledge of your agent.
-
A fast way to interrogate your agent knowledge.
+
A fast way to explore your agent knowledge.
A natural way to evolve the knowledge of your agents.
@@ -138,9 +138,9 @@
A natural way to evolve the knowledge of your agents.
-
About ontologenius
-
Ontologenius is a research project aimed at providing that which can be seen as a semantic memory
- for artificial agents. Focusing only on this task, ontologenius is currently a robust and efficient
+
About Ontologenius
+
Ontologenius is a research project aimed at providing what can be seen as a semantic memory
+ for artificial agents. Focusing only on this task, Ontologenius is currently a robust and efficient
open-source software that can be deployed in many applications.
Provided with some algorithms of first-order logic inference, it is still possible to make it evolve
@@ -156,6 +156,23 @@
About ontologenius
What's New
+
+
+
Ontologenius 0.3.0 !
+
+
+ Here is a great step, Ontologenius comes in its third major release!
+
+
+ A lot of efforts have been done to enhance Ontologenius performances with a new interface based on indexes (integers),
+ allowing better internal performances but also letting you the opportunity to seep-up your own algorithms.
+ More than this new interface, a lot of engineering has been done to optimize all internal structures and algorithms
+ to improve ontologies loading, low-level queries, as well as SPARQL queries.
+
+
+
+
+
Automatic imports
@@ -195,7 +212,7 @@
Turtle ontology
Ontologenius python API
-
After a long time, ontologenius now provides a full python API. Here you will find its
+
After a long time, Ontologenius now provides a full python API. Here you will find its
documentation and five tutorials to learn how to use it.
@@ -205,8 +222,8 @@
Ontologenius python API
Ontology copy and reasoners configuration
-
More than creating multiple instances ontologenius, you can now copy an instance that then becomes independent.
- This new feature makes it easy to use ontologenius for planning applications.
+
More than creating multiple instances of Ontologenius, you can now copy an instance that then becomes independent.
+ This new feature makes it easy to use Ontologenius for planning applications.
You can now configure the reasoners you want to use and change their parameters via a YAML file. Create your own
configuration for your specific application in few minutes!
@@ -218,11 +235,11 @@
Ontology copy and reasoners configuration
C++ API is now available
-
As part of a recent effort to facilitate the use of ontologenius, we are now developing a C ++ API
+
As part of a recent effort to facilitate the use of Ontologenius, we are now developing a C ++ API
covering the majority of features. The complete documentation of this API is now available online.
To take better control of this new API five tutorials have been developed. They make it possible to
- discover the API as well as the basic ontologenius functionalities through min-projects.
+ discover the API as well as the basic Ontologenius functionalities through min-projects.
The ClassIndexClient class provides an abstraction of ontologenius classes ROS service.
+
The ontologenius classes service allows the exploration of classes contained by ontologenius core based on integer.
+
This class is based on ClientIndexBase and so ensure a persistent connection with ontologenius/class_index service.
+ The persistent connection ensures a minimal response time. A reconnection logic is implemented in the event that the persistent connection fails.
+
At the difference of the usual ClassClient class, this one provides access to the interface based on indexes (integers) for better performances.
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 ''.
+
+
getDown(self, index, depth = -1)
+
Gives all classes (integer[]) below the one given in the parameter: index(interger).
+
The optional depth(int) parameter can be set to limit tree propagation to a specific value. The default value -1 represents no propagation limitation.
+
+
getDisjoint(self, index)
+
Gives all the disjoint classes (integer[]) of the one given in the parameter: index(interger).
+
+
getOn(self, index, property, selector = 0)
+
Gives all the classes (integer[]) pointed by the property property(interger) and applied to the class index(interger).
+
The optional selector(integer) parameter can be set to only get results inheriting from the selector(integer) class. The default value 0 represents no restriction on the result.
+
+
getFrom(self, property, index, selector = 0)
+
Gives all the classes (integer[]) having the given property property(interger) and pointing to the class index(interger).
+
The optional selector(integer) parameter can be set to only get results inheriting from the selector(integer) class. The default value 0 represents no restriction on the result.
Gives all the properties (integer[]) linking the two classes class_from(interger) and class_to(interger).
+
The optional selector(integer) parameter can be set to only get results inheriting from the selector(integer) property. The default value 0 represents no restriction on the result.
+
The optional depth(int) parameter can be set to limit tree propagation to a specific value. The default value -1 represents no propagation limitation.
+
+
getRelatedFrom(self, property)
+
Gives all the classes (integer[]) possessing the property property(interger).
+
+
getRelatedOn(self, property)
+
Gives all the classes (integer[]) pointed to by the property property(interger).
+
+
getRelatedWith(self, index)
+
Gives all the classes (integer[]) having a property pointing to the class index(interger).
Gives all the properties (integer[]) for which the class index(interger) is part of the domain.
+
The optional selector(integer) parameter can be set to only get results inheriting from the selector(integer) property. The default value 0 represents no restriction on the result.
+
The optional depth(int) parameter can be set to limit tree propagation of the class to a specific value. The default value -1 represents no propagation limitation.
+
+
getRangeOf(self, index, selector = 0, depth = -1)
+
Gives all the properties (integer[]) for which the class index(interger) is part of the range.
+
The optional selector(integer) parameter can be set to only get results inheriting from the selector(integer) property. The default value 0 represents no restriction on the result.
+
The optional depth(int) parameter can be set to limit tree propagation of the class to a specific value. The default value -1 represents no propagation limitation.
The ClientBaseIndex class provides an abstraction for any ROS services.
+
This class ensures 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.
+
At the difference of the usual ClientBase class, this one provides access to the interface based on indexes (integers) for better performances.
Constructs a ROS client linked to the service name(str).
+
+
nb(self)
+
Gives the total number (integer) of service calls from all ClientBaseIndex instances since the last reset.
+
+
resetNb(self)
+
Reset Call Counter for all instances of ClientBaseIndex.
+
+
setVerbose(self, verbose)
+
If verbose(bool) is set to True, the clients will post messages about the failure to call the services and about their restoration.
+
+
call(self, action, param)
+
Call the service set up in the constructor of ClientBaseIndex with the request defined with action(str) and param(str) and returns all the results (str[]).
+
If the service call fails, the function returns None
+
+
callIndexes(self, action, param)
+
Call the service set up in the constructor of ClientBaseIndex with the request defined with action(str) and param(str) and returns all the results (integer[]).
+
If the service call fails, the function returns None
+
+
callStr(self, action, param)
+
Call the service set up in the constructor of ClientBaseIndex with the request defined with action(str) and param(str) and returns all the first result (str).
+
If the service call fails, the function returns None
+
+
callIndex(self, action, param)
+
Call the service set up in the constructor of ClientBaseIndex with the request defined with action(str) and param(str) and returns all the first result (integer).
+
If the service call fails, the function returns None
+
+
callNR(self, action, param)
+
Call the service set up in the constructor of ClientBaseIndex with the request defined with action(str) and param(str).
+
If the service call fails, the function returns False
+
+
callBool(self, action, param)
+
Call the service set up in the constructor of ClientBaseIndex with the request defined with action(str) and param(str).
+
Returns False if the service call fails or the result code of the service is different from SUCCESS.
The ConversionClient class provides an abstraction to the ontologenius conversion ROS services to pass from identifiers to indexes and inverse.
+
This class ensures 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 a ROS client linked to the service /ontologenius/conversion.
+
Can be used in a multi-ontology mode by specifying the name of the ontology name. For classic use, name should be defined as "".
+
+
setVerbose(self, verbose)
+
If verbose(bool) is set to True, the clients will post messages about the failure to call the services and about their restoration.
+
+
individualsIndexes2Ids(self, indexes)
+
Converts an array of indexes(int[]) representing individuals to identifiers.
+
Returns an array of identifiers (str[]) whose order matches the original indexes order. Unknown concepts (or from wrong types) will be return as empty strings.
+
+
classesIndexes2Ids(self, indexes)
+
Converts an array of indexes(int[]) representing classes to identifiers.
+
Returns an array of identifiers (str[]) whose order matches the original indexes order. Unknown concepts (or from wrong types) will be return as empty strings.
+
+
dataPropertiesIndexes2Ids(self, indexes)
+
Converts an array of indexes(int[]) representing data properties to identifiers.
+
Returns an array of identifiers (str[]) whose order matches the original indexes order. Unknown concepts (or from wrong types) will be return as empty strings.
+
+
objectPropertiesIndexes2Ids(self, indexes)
+
Converts an array of indexes(int[]) representing object properties to identifiers.
+
Returns an array of identifiers (str[]) whose order matches the original indexes order. Unknown concepts (or from wrong types) will be return as empty strings.
+
+
literalsIndexes2Ids(self, indexes)
+
Converts an array of indexes(int[]) representing literals to identifiers.
+
Returns an array of identifiers (str[]) whose order matches the original indexes order. Unknown concepts (or from wrong types) will be return as empty strings.
+
+
individualsIndex2Id(self, index)
+
Converts an index(int) representing an individual to its identifier.
+
Returns a single identifier (str). Unknown concept (or from wrong types) will be return as an empty string.
+
+
classesIndex2Id(self, index)
+
Converts an index(int) representing a class to its identifier.
+
Returns a single identifier (str). Unknown concept (or from wrong types) will be return as an empty string.
+
+
dataPropertiesIndex2Id(self, index)
+
Converts an index(int) representing a data property to its identifier.
+
Returns a single identifier (str). Unknown concept (or from wrong types) will be return as an empty string.
+
+
objectPropertiesIndex2Id(self, index)
+
Converts an index(int) representing an object property to its identifier.
+
Returns a single identifier (str). Unknown concept (or from wrong types) will be return as an empty string.
+
+
literalsIndex2Id(self, index)
+
Converts an index(int) representing a literal to its identifier.
+
Returns a single identifier (str). Unknown concept (or from wrong types) will be return as an empty string.
+
+
individualsIds2Indexes(self, ids)
+
Converts an array of ids(str[]) representing individuals to indexes.
+
Returns an array of indexes (int[]) whose order matches the original identifiers order. Unknown concepts (or from wrong types) will be return as index 0.
+
+
classesIds2Indexes(self, ids)
+
Converts an array of ids(str[]) representing classes to indexes.
+
Returns an array of indexes (int[]) whose order matches the original identifiers order. Unknown concepts (or from wrong types) will be return as index 0.
+
+
dataPropertiesIds2Indexes(self, ids)
+
Converts an array of ids(str[]) representing data properties to indexes.
+
Returns an array of indexes (int[]) whose order matches the original identifiers order. Unknown concepts (or from wrong types) will be return as index 0.
+
+
objectPropertiesIds2Indexes(self, ids)
+
Converts an array of ids(str[]) representing object properties to indexes.
+
Returns an array of indexes (int[]) whose order matches the original identifiers order. Unknown concepts (or from wrong types) will be return as index 0.
+
+
literalsIds2Indexes(self, ids)
+
Converts an array of ids(str[]) representing literals to indexes.
+
Returns an array of indexes (int[]) whose order matches the original identifiers order. Unknown concepts (or from wrong types) will be return as index 0.
+
+
individualsId2Index(self, id)
+
Converts an id(str) representing an individual to its index.
+
Returns a single index (int). Unknown concept (or from wrong types) will be return as index 0.
+
+
classesId2Index(self, id)
+
Converts an id(str) representing a class to its index.
+
Returns a single index (int). Unknown concept (or from wrong types) will be return as index 0.
+
+
dataPropertiesId2Index(self, id)
+
Converts an id(str) representing a data property to its index.
+
Returns a single index (int). Unknown concept (or from wrong types) will be return as index 0.
+
+
objectPropertiesId2Index(self, id)
+
Converts an id(str) representing an object property to its index.
+
Returns a single index (int). Unknown concept (or from wrong types) will be return as index 0.
+
+
literalsId2Index(self, id)
+
Converts an id(str) representing a literal to its index.
+
Returns a single index (int). Unknown concept (or from wrong types) will be return as index 0.
The DataPropertyIndexClient class provides an abstraction of ontologenius data properties ROS service.
+
The ontologenius data properties service allows the exploration of data properties contained by ontologenius core.
+
This class is based on ClientBaseIndex and so ensure a persistent connection with ontologenius/data_property_index service.
+ The persistent connection ensures a minimal response time. A reconnection logic is implemented in the event that the persistent connection fails.
+
At the difference of the usual DataPropertyClient class, this one provides access to the interface based on indexes (integers) for better performances.
The IndividualIndexClient class provides an abstraction of ontologenius individuals ROS service.
+
The ontologenius individuals' service allows the exploration of individuals contained by ontologenius core based on indexes.
+
This class is based on ClientBaseIndex and so ensure a persistent connection with ontologenius/individual_index service.
+ The persistent connection ensures a minimal response time. A reconnection logic is implemented in the event that the persistent connection fails.
+
At the difference of the usual IndividualClient class, this one provides access to the interface based on indexes (integers) for better performances.
Can be used in a multi-ontology mode by specifying the name of the ontology name(str). For classic use, name should be defined as ''.
+
+
getType(self, index)
+
Gives all the individuals (integer[]) of the type of the given class index(integer).
+
+
getSame(self, index)
+
Gives all the individuals (integer[]) that are defined as being identical to the individual index(integer).
+
+
getDistincts(self, index)
+
Gives all the defined individuals (integer[]) as being distinct from the individual index(integer).
+
+
getOn(self, index, property, selector = 0)
+
Gives all the individuals (integer[]) pointed by the property property(integer) and applied to the individual index(integer).
+
The optional selector(integer) parameter can be set to only get results inheriting from the selector class. The default value 0 represents no restriction on the result.
+
+
getFrom(self, property, index, selector = 0)
+
Gives all the individuals (integer[]) having the given property property(integer) and pointing to the individual index(integer).
+
The optional selector(integer) parameter can be set to only get results inheriting from the selector class. The default value 0 represents no restriction on the result.
Gives all the properties (integer[]) linking the individual indiv_from(integer) to the individual indiv_to(integer).
+
The optional selector(integer) parameter can be set to only get results inheriting from the selector property. The default value 0 represents no restriction on the result.
+
The optional depth(int) parameter can be set to limit tree propagation to a specific value. The default value -1 represents no propagation limitation.
+
+
getRelatedFrom(self, property)
+
Gives all the individuals (integer[]) possessing the property property(integer).
+
+
getRelatedOn(self, property)
+
Gives all the individuals (integer[]) pointed to by the property property(integer).
+
+
getRelatedWith(self, index)
+
Gives all the individuals (integer[]) having a property pointing to the individual index(integer).
+
+
getRelationFrom(self, index, depth = -1)
+
Gives all the properties (integer[]) applied to the individual index(integer).
+
The optional depth(int) parameter can be set to limit tree propagation to a specific value. The default value -1 represents no propagation limitation.
+
+
getRelationOn(self, index, depth = -1)
+
Gives all the properties (integer[]) going to the individual index(integer).
+
The optional depth(int) parameter can be set to limit tree propagation to a specific value. The default value -1 represents no propagation limitation.
+
+
getRelationWith(self, index)
+
Gives all the individuals (integer[]) pointed by a property applied to the individual index(integer).
Gives all the properties (integer[]) for which the individual index(integer) is part of the domain.
+
The optional selector(integer) parameter can be set to only get results inheriting from the selector property. The default value 0 represents no restriction on the result.
+
The optional depth(int) parameter can be set to limit tree propagation of the individual to a specific value. The default value -1 represents no propagation limitation.
+
+
getRangeOf(self, index, selector = 0, depth = -1)
+
Gives all the properties (integer[]) for which the individual index(integer) is part of the range.
+
The optional selector(integer) parameter can be set to only get results inheriting from the selector property. The default value 0 represents no restriction on the result.
+
The optional depth(int) parameter can be set to limit tree propagation of the individual to a specific value. The default value -1 represents no propagation limitation.
The ObjectPropertyIndexClient class provides an abstraction of ontologenius object properties ROS service.
+
The ontologenius object properties service allows the exploration of object properties contained by ontologenius core based on indexes.
+
This class is based on ClientIndexBase and so ensure a persistent connection with ontologenius/object_property_index service.
+ The persistent connection ensures a minimal response time. A reconnection logic is implemented in the event that the persistent connection fails.
+
At the difference of the usual ObjectPropertyClient class, this one provides access to the interface based on indexes (integers) for better performances.
Can be used in a multi-ontology mode by specifying the name of the ontology name(str). For classic use, name should be defined as ''.
+
+
getDown(self, index, depth = -1)
+
Gives all properties (integer[]) below the one given in the parameter: index(integer).
+
The optional depth(integer) parameter can be set to limit tree propagation to a specific value. The default value -1 represents no propagation limitation.
+
+
getDisjoint(self, index)
+
Gives all the disjoint properties (integer[]) of the property index(integer).
+
+
getDomain(self, index)
+
Gives all the domain classes (integer[]) of the property index(integer).
+
+
getRange(self, index)
+
Gives all the ranges classes (integer[]) of the property index(integer).
+
+
getInverse(self, index)
+
Gives all the inverses properties (integer[]) of the property index(integer).
Returns None if no OntologyManipulatorIndex instance is named name.
+
add(self, name)
-
Creates a new instance of ontologyManipulator identified by the name name(str).
+
Creates a new instance of OntologyManipulator and OntologyManipulatorIndex identified by the name name(str).
Returns False if the creation fails. Returns True even if the instance already exists.
copy(self, dest_name, src_name)
-
Creates a new instance of ontologyManipulator identified by the name dest_name(str) that manipulates a copy of the ontology handled by the ontologyManipulator src_name(str).
+
Creates a new instance of OntologyManipulator and OntologyManipulatorIndex identified by the name dest_name(str) that manipulates a copy of the ontology handled by the OntologyManipulator and OntologyManipulatorIndex src_name(str).
Returns False if the copy fails. Returns True even if the instance already exists.
delete(self, name)
-
Deletes the instance of ontologyManipulator identified by the name name(str).
+
Deletes the instance of OntologyManipulator and OntologyManipulatorIndex identified by the name name(str).
Returns False deletion fails. Returns True even if the instance does not exist.
The OntologyIndexClient class provides an abstraction common to all ontologenius exploration ROS services.
+
The OntologyIndexClient implements the functions common to every ontologenius exploration based on indexes.
+
This class is based on ClientBaseIndex 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.
+
At the difference of the usual OntologyClient class, this one provides access to the interface based on indexes (integers) for better performances.
Constructs an ontology client linked to the service ontologenius/name(str).
+
+
getUp(self, index, depth = -1, selector = 0)
+
Gives all concepts below the one given in the parameter: index(integer).
+
The optional depth(int) parameter can be set to limit tree propagation to a specific value. The default value -1 represents no propagation limitation.
+
The optional selector(integer) parameter can be set to only get results inheriting from the selector(integer) concept. The default value 0 represents no restriction on the result.
+
+
isA(self, index, base_class)
+
Returns true if the concept index(integer) is or inherits of the concept base_class(integer). This function corresponds to checking if class_base is part of the result of the function getUp applies to the concept index.
+
+
getName(self, index, take_id = True)
+
Gives one of the label (str) of the concept index(integer) that is not muted.
+
The default take_id(bool) argument can be set to False if you do not want to consider the concept identifier as a possible default name.
+
The result of this function depends on the setting of the working language.
+
+
getNames(self, index, take_id = True)
+
Gives all the labels (str[]) of the concept index(integer) excepted the muted ones.
+
The default take_id(bool) argument can be set to False if you do not want to consider the concept identifier as a possible default name.
+
The result of this function depends on the setting of the working language.
+
+
getEveryNames(self, index, take_id = True)
+
Gives all the labels (str[]) of the concept index(integer) even the muted ones.
+
The default take_id(bool) argument can be set to False if you do not want to consider the concept identifier as a possible default name.
+
The result of this function depends on the setting of the working language.
+
+
find(self, name, take_id = True, selector = 0)
+
Gives all the concepts (integer[]) having for label name(str).
+
The default take_id(bool) argument can be set to False if you do not want to consider the concept identifier as a possible default name.
+
The optional selector(integer) parameter can be set to only get results inheriting from the selector(integer) concept. The default value 0 represents no restriction on the result.
+
The result of this function depends on the setting of the working language.
+
+
findSub(self, name, take_id = True, selector = 0)
+
Gives all the concepts (integer[]) having for label a subset of name(str).
+
The default take_id(bool) argument can be set to false if you do not want to consider the concept identifier as a possible default name.
+
The optional selector(integer) parameter can be set to only get results inheriting from the selector(integer) concept. The default value 0 represents no restriction on the result.
+
The result of this function depends on the setting of the working language.
Give all concepts (integer[]) with a label matching the regular expression regex(str).
+
The default take_id(bool) argument can be set to false if you do not want to consider the concept identifier as a possible default name.
+
The optional selector(integer) parameter can be set to only get results inheriting from the selector(integer) concept. The default value 0 represents no restriction on the result.
+
The result of this function depends on the setting of the working language.
Give all the names of concepts (str[]) with the lowest edit distance with parameter name(str).
+
The default take_id(bool) argument can be set to false if you do not want to consider the concept identifier as a possible default name.
+
The optional selector(integer) parameter can be set to only get results inheriting from the selector(integer) concept. The default value 0 represents no restriction on the result.
+
The result of this function depends on the setting of the working language and does not correspond to the concept identifiers but to other labels known by ontologenius.
+
The minimum editing distance can be set with the threshold(double) parameter. This value corresponds to the number of changes to be made to pass from one word to another divided by the length of the comparison word.
+
+
exist(self, index)
+
Returns True if the concept index(integer) exists in the subpart of the ontology managed by the client (i.e. class, individuals, object properties, data properties).
+
+
+
Muted labels
+
Ontologenius introduces the concept of muted label. They are written <onto:label> in an OWL file.
+
A muted label will be useful for adding labels with errors. These labels will allow you to find a concept with an error but will make sure you never use it in output (using getName).
The OntologyManipulatorIndex class is just an object to access all API ROS abstraction classes so that you can query and manage ontologenius.
+
At the difference of the usual OntologyManipulator class, this one provides access to the interfaces based on indexes (integers) for better performances.
ROS service client to to convert indentifiers to indexes and inverse.
+
+
+
+
+
Methods Documentation
+
+
__init__(self, name = '')
+
Constructs an index based ontology manipulator.
+
Can be used in a multi-ontology mode by specifying the name of the ontology name(str). For classic use, do not specify the ontology name name.
+
+
nb(self)
+
Gives the total number (int) of service calls from all ROS clients instances since the last reset.
+
+
resetNb(self)
+
Reset Call Counter for all instances of ROS clients.
+
+
close(self)
+
Same as the ActionClient closing function. Link all the concepts loaded from files and the Internet. Before closing an ontology, exploration requests are not allowed.
+
Returns False if the service call fails.
+
+
setVerbose(self, verbose)
+
If verbose is set to True, the clients will post messages about the failure to call the services and about their restoration.
This is the last tutorial! Implementing algorithms, we all know that scaling is important and that performances can become a bottleneck when trying to do so.
+ Furthermore, using an external knowledge base and thus passing by a communication layer, the amount of data to transfer can be an issue.
+ In such a way, the use of strings to interact with Ontologenius is not the more suitable one to have the best performances possible...
+ This is why Ontologenius proposes an interface based on indexes as integers!
+ More than reducing the amount of data to transfer, that provides a significative gain in Ontologenius internal algorithms and allows you to do the same on your side.
+
+
+
The mini-project that we will do will be the adaptation of the second tutorial algorithm, by using indexes..
+
+
+
+
The ontology manipulator
+
+
Until now, we have used an OntologyManipulator to access the different methods to explore the ontology, but using concept's identifiers (strings).
+
+
To access the index version of the API, we will now use an OntologyManipulatorIndex.
+ If it seems to be the exact same one as the original one, this is normal. Indeed, the interface is the same (same members' name and same functions' name) but all the exploration queries use indexes instead of identifiers, meaning integers instead of strings.
+ All related classes, based on index use, can be found at the bottom of the left sidebar.
+
+
+
Working in multi instances mode, you steal have to use an OntologiesManipulator and insteed of using the get method to extract an OntologyManipulator, you can use the getIndex method to extract an OntologyManipulatorIndex.
+
+
Passing from indentifiers to indexes
+
+
Before moving ahead, one should ask itself "But how can I know the index of a concept?", and this is an excellent question...
+
+
Indexes are attributed by Ontologenius to any concepts. It is a kind of internal identifier used by Ontologenius to ease the concepts manipulation.
+ In such a way, from one run to another, we cannot ensure that a given concept will have the same index...
+ It is thus important to first query Ontologenius for the indexes.
+
+
+
The actual only difference between an OntologiesManipulator and an OntologyManipulatorIndex, is the presence of a "conversion" member.
+ The conversion member is an instance of a ConversionClient which allows
+ you to pass from identifiers to indexes and inverse.
+
+
+
To better understand, let's take an easy example. Launch ontologenius with the launch file of the second tutorial and in a Python terminal execute the following:
In this example we have asked for the index of the "path" concept, then we have queried all the individuals of this type, but using the index, and finally,
+ we have converted the result into identifiers to display it to the user! Easy!
+
+
Literals and names
+
+
In index-based use, two special cases hold: the literals and the names in natural language.
+
+
First of all, the names in natural language do not use indexes and should thus be used with strings as usual.
+
+
At the difference, the literals used with data properties have indexes associated with them.
+ However, these indexes are negative! This specificity can be useful to easily discriminate literals to usual concepts.
+
+
+
Nevertheless, if concepts have positive indexes and literals have negative ones, what about zero?
+ It holds as an empty string as used in the identifier-based queries, meaning no answer.
+
+
+
Time to code!
+
+
It is now your turn to code. Take the final version of tutorial 2 and modify it to use indexes. A solution is provided on the next page of the tutorial.
+
+
While coding keep in mind that conversion between identifiers and indexes should be kept as the interface with your algorithm (initialisation and result display) and should be avoided in it.
+
+
As python is not a typed language, the algorithms will not have to be modified...
Here is a possible solution.
+ You can note that we have queried the indexes of the properties "isAlong" and "hasAlong" only once at the initialisation to avoid to recompute static information.
+ In a more usual way using classes, you could create a map with all the "static" indexes.
+