Manage multiple ontologies (cpp)

Sally & Anne test

Presentation of the problem

This is the fourth tutorial! You are now an expert in managing an ontology using Ontologenius and the ontology manipulator has no secrets for you. Now that we can represent the knowledge of our artificial agent, we will try to estimate and thus manage the knowledge of the other agents with whom we interact. This corresponds to the process called the theory of mind for human cognition.

The mini-project that we will do together to use the management of several ontologies will consist of the simplest implementation of the test of Sally and Anne which is used to illustrate the principle of the theory of mind.

Sally & Anne test is used in developmental psychology to assess, in social cognition, the ability of a child to understand that someone else has mental states different from his own. To implement this test, we will create an Ontologenius instance to represent Sally’s semantic knowledge and one for Anne’s. First of all, the two knowledge bases are loaded with a common ground that is at least knowledge of the existence of two containers, a ball, and some geometric properties like ”is in”. First of all, Sally will put the ball in the first container while Anne is present. After that, Anne will move the ball into the second container while Sally is away. At the end, we will try to detect a divergence of belief between the two agents.

The ontology used

The ontology used can be considered as the common ground of our two agents. It contains two containers, a table, and a ball. We also have in this ontology spatial relations as "isIn", "isOn", or "hasOn".

To go directly to the heart of the tutorial, the ball is already in the first container. We will only consider the second part of the test when Sally is away.

Before you start

Before moving on, you can create a new launch file and set the "files" argument with the common ground ontology tutotial_4.owl, and then set the "intern_file" argument to "multi.owl".

<launch>
<node name="multiple_ontologies" pkg="ontologenius_tutorial" type="multiple_ontologies" output="screen"/>
<include file="$(find ontologenius)/launch/ontologenius_multi_empty.launch">
<arg name="intern_file" default="$(find ontologenius_tutorial)/multi.owl"/>
<arg name="files" default="$(find ontologenius)/files/tutorials/tutorial_4.owl"/>
</include>
</launch>

Let's call this file multi.launch and put it in our package in the folder launch.

You can see here that we base our launch file on the launch file "ontologenius_multi" this time. This will launch an executable specifically dedicated to the management of several ontologies.

By specifying an internal file, Ontologenius is allowed to save the ontology it contains in a file when it is stopped and to reload it on its next start. In the case of managing multiple ontologies, the name we give to this file is considered a namespace. We will see in detail what this means later in the tutorial.