<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta />
    <article-meta>
      <title-group>
        <article-title>A ROS Multi-Ontology References Service: OWL Reasoners and Application Prototyping Issues</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Luca Buoncompagniy</string-name>
          <email>luca.buoncompagni@edu.unige.it</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Alessio Capitanelliy</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Fulvio Mastrogiovanni</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Bioengineering, Robotics and Systems Engineering, University of Genoa</institution>
          ,
          <addr-line>Via Opera Pia 13, 16145, Genoa</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper introduces a ROS Multi Ontology References (ARMOR) service, a general-purpose and scalable interface between robot architectures and OWL reasoners. ARMOR addresses synchronization and communication issues among heterogeneous and distributed software components. As a guiding scenario, we consider a prototyping approach for the use of symbolic reasoning in human-robot interaction applications.</p>
      </abstract>
      <kwd-group>
        <kwd>software architecture for robotics</kwd>
        <kwd>knowledge representation</kwd>
        <kwd>reasoning</kwd>
        <kwd>description logics</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        The challenge of sharing and communicating information is crucial in complex
human-robot interaction (HRI) scenarios. Ontologies and symbolic reasoning are
the state of the art approach for a natural representation of knowledge,
especially within the Semantic Web domain, and it has been adopted to achieve high
expressiveness [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. Since symbolic reasoning is a high complexity problem,
optimizing its performance requires a careful design of the knowledge resolution.
Specifically, a robot architecture requires the integration of several components
implementing different behaviors and generating a series of beliefs. Most of the
components are expected to access, manipulate, and reason upon a run-time
generated representation of knowledge grounding robot behaviors and perceptions
through formal axioms, with soft real-time requirements.
      </p>
      <p>
        The Robot Operating System (ROS) is a de facto standard for robot software
development, which allows for modular and scalable robot architecture designs.
Currently, some approaches exist to integrate a semantic representation in ROS,
such as the KnowRob [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] which provide a complete framework of relevant
ontologies, or the native ROS support of MongoDB1, which can also be used to
provide a suitable representation for semantic querying. Unfortunately, none of
these supports the study of advanced reasoning paradigms, and they heavily rely
      </p>
      <sec id="sec-1-1">
        <title>1 https://www.mongodb.com.</title>
        <p>on ad hoc reasoning solutions, significantly limiting their scope. We argue that
this fact affects the study of different approaches to semantics in Robotics. For
instance, it limits our capability to explore novel semantic representations of
perceptions, which offers similar but not equivalent beliefs. We lack a standardized
general framework to work with ontologies, natively supporting symbolic logic
and advanced reasoning paradigms.</p>
        <p>
          The Ontology Web Language (OWL)2 is a standard representation
supporting several reasoning interfaces, e.g., Pellet [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ], and logic formalisms, e.g., the
Allen’s Algebra [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]. Thus, it can be a solid foundation for a framework for
symbolic reasoning in Robotics. OWL is based on the separation between
terminological and assertional knowledge, referred to as different boxes (Tbox and Abox).
Typically, in Robotics scenarios, we design a static semantics for the beliefs to
be represented in the TBox. Then, we populate the ABox through individuals
defined using types and properties and, at run-time, we classify knowledge using
instance checking. We argue that, due to the high complexity of HRI scenarios,
the possibility of a dynamic semantics in the TBox is desirable as well. For
instance, it could be used to learn new types for classification. This leads us to a
study requiring reasoning heuristics to be compared, components to be shared,
and different semantics to be adapted.
        </p>
        <p>For this purpose, we propose the ROS Multi Ontology References3
(ARMOR). ARMOR is an open source service which manipulates and queries
multiple OWL ontologies. It provides access to a set of dynamic ontologies, handling
also the synchronizations among different components in the architecture.
Therefore, it is a convenient tool for managing knowledge representation supported by
advanced reasoners.
2</p>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>System’s Architecture</title>
      <p>
        Figure 1 shows a schematic representation of ARMOR. It interfaces the OWL
API [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and reasoners through the Java-based Multi Ontology References
library (AMOR). Then, ARMOR exposes AMOR functionalities as a service to
ROS-based architectures, relying on the support for Java in ROS (ROSJava4).
ARMOR messages have been designed to accommodate all OWL functionalities.
Nevertheless, we have implemented only an exhaustive subset of those features so
far (i.e., only common run-time operations). Indeed, ontology managers are not
distributed across satellite components of a ROS architecture. Instead, dedicated
components are in charge of management, while others only provide knowledge
axioms, possibly at run-time. With ARMOR, it is possible to inject in the
service procedure managing symbols from a centralized perspective, based on the
functionalities provided by AMOR. Nevertheless, complex static representations
can always be defined also off-line with dedicated software, e.g., Protégé5.
      </p>
      <sec id="sec-2-1">
        <title>2 https://www.w3.org/TR/owl-guide.</title>
      </sec>
      <sec id="sec-2-2">
        <title>3 https://github.com/EmaroLab/ARMOR.</title>
      </sec>
      <sec id="sec-2-3">
        <title>4 https://github.com/rosjava.</title>
      </sec>
      <sec id="sec-2-4">
        <title>5 http://protege.stanford.edu.</title>
        <p>«knowledge base»</p>
        <p>Ontology
references 1
«library»
a Multi Ontology
References (AMOR)
«class»
Injected</p>
        <p>Service
F injected
response
«ROSjava package»
a ROS Multi Ontology References (ARMOR)
«interface» «realization»</p>
        <p>AMOR OWL
Enquirer Enquirer
«interface»</p>
        <p>AMOR
Manipulator
«ROS service»</p>
        <p>ARMOR
interface
F injected
request
«implements»</p>
        <p>«depends»
«realization»</p>
        <p>OWL
Manipulator
| qmuaenriypulation
F injected request
«engine»</p>
        <p>OWL
Reasoner
«factory»</p>
        <p>OWL</p>
        <p>API
| scoolnustiisotnency
F injected response
The core library, referred to as AMOR, contains a map of instantiated
ontologies, where the key is a unique name identifier used to access the corresponding
ontology in a thread-safe manner. AMOR provides several common operations,
such as those to create individuals, assign their properties, make them
disjointed and classify them, to name a few. Furthermore, AMOR ensures complete
accessibility to the OWL API6 features for compatibility and extendability
purposes. For example, AMOR allows for invoking reasoners by specifying their
OWLReasoner factory, i.e., the unique package of its Java implementation, which
assures compatibility with all OWL reasoners.</p>
        <p>In the current implementation, we interface several properties that are useful
to tune the AMOR behaviour, e.g., the buffering of the manipulations or a
continuous reasoner update, using the standard ROS Parameter Server, as well
as parameters for debugging purposes such as toggling a Graphical User Interface
(GUI) for visualising ontology states on-line.
2.2</p>
        <p>The ARMOR Interface
The ARMOR interface is based on a ROS message structure (i.e., a triple) for
the use of the AMOR functionalities from any node in the architecture, even
when the development language is different from Java (e.g., Python7 and C++
are the most common languages in Robotics development). Such a message is
composed of: 1. the client name, which is used by the service to identify different
callers, 2. the reference name, indicating the operation’s target reference, and</p>
      </sec>
      <sec id="sec-2-5">
        <title>6 http://owlapi.sourceforge.net.</title>
      </sec>
      <sec id="sec-2-6">
        <title>7 An ARMOR client is available at https://github.com/EmaroLab/ARMOR_py_api.</title>
        <p>3. the command to execute, i.e., add, remove, replace, query, load, mount, etc.8
Each of those commands may be further refined by: (a) the primary and
secondary specifiers, which augment command labels, e.g., add(individual, class )
or remove(individual, property ), and (b) the arguments, a list of entities in
the reference parameterising the command, e.g., hadd(class ) "Sphere"i, or
even hadd(property,individual ) "hasNorth" "LivingRoom" "Corridor"i.
An ARMOR call is based on one or more messages with the same structure.
When such a request is sent, the service manipulates or queries the ontology
with the given directives. Then, it returns whether the ontology is consistent,
eventual error codes with their description, and the names of the queried
entities, if requested. In other words, the interfaces | and  in Figure 1, and F can
be defined for each specific injected service, if any.</p>
        <p>One advanced feature of ARMOR is the possibility of flexibly synchronising
all operations. This follows a mounting/unmounting paradigm, where one or
more nodes identified by the same client name can prevent other nodes from
manipulating a given ontology, in order to ensure manipulation consistency. On
the contrary, queries are always allowed, except during reasoning time. Calls to
busy ontologies will report a mounting issue, and the user can choose how to
handle this situation.
3</p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Applications and Conclusions</title>
      <p>
        We are currently using ARMOR in different applications, but here we mention
only two of them. The first is aimed at implementing a dynamic PDDL problem
generator. This approach uses descriptions of the predicates and objects in a
tabletop scenario to infer unsatisfied norms and consequently generate goals [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ].
The system has been integrated with ROSPlan9 by substituting the internal
semantic data structure with ARMOR and a suitable ontology.
      </p>
      <p>
        The second application is a system to learn by demonstrations the
arrangement of objects in the robot’s workspace by mapping their properties into the
TBox. In particular, we used an injected service10 in ARMOR for performing
scene learning and classification in a scenario where a robot explains its beliefs
to a human, which might want to correct it through dialogues [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ].
      </p>
      <p>This paper introduces the ARMOR service to manipulate OWL ontologies
and query their reasoners in a ROS-based architecture. ARMOR services are
available through a flexible message allowing for the direct access OWL features
from any component of the architecture. It ensures synchronisation between
client calls and flexibility through procedure injection. Also, ARMOR allows for
an easy interface between robotic architectures and OWL representations, and
we practically showed it during a tutorial presented at the ROS Development</p>
      <sec id="sec-3-1">
        <title>8 Listed at https://github.com/EmaroLab/ARMOR/blob/master/commands.md.</title>
      </sec>
      <sec id="sec-3-2">
        <title>9 https://github.com/KCL-Planning/ROSPlan. 10 https://github.com/EmaroLab/injected_armor_pkgs.</title>
        <p>Conference 201811. The tutorial is focused on the control of mobile robots based
on a topological environment representation and SLAM.</p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Allen</surname>
            ,
            <given-names>J.F.</given-names>
          </string-name>
          :
          <article-title>Maintaining knowledge about temporal intervals</article-title>
          .
          <source>Communications of the ACM</source>
          <volume>26</volume>
          (
          <issue>11</issue>
          ),
          <fpage>832</fpage>
          -
          <lpage>843</lpage>
          (
          <year>1983</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Baader</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Horrocks</surname>
            ,
            <given-names>I.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sattler</surname>
            ,
            <given-names>U.</given-names>
          </string-name>
          :
          <article-title>Description logics as ontology languages for the semantic web</article-title>
          .
          <source>In: Mechanizing Mathematical Reasoning</source>
          , pp.
          <fpage>228</fpage>
          -
          <lpage>248</lpage>
          . Springer (
          <year>2005</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Buoncompagni</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mastrogiovanni</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>Dialogue-based supervision and explanation of robot spatial beliefs: a software architecture perspective</article-title>
          .
          <source>In: 2018 27th IEEE International Symposium on Robot and Human Interactive Communication (ROMAN)</source>
          . pp.
          <fpage>977</fpage>
          -
          <lpage>984</lpage>
          (
          <year>Aug 2018</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Capitanelli</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mastrogiovanni</surname>
            ,
            <given-names>F.</given-names>
          </string-name>
          :
          <article-title>An ontology-based hybrid architecture for planning and robust execution in tabletop scenarios</article-title>
          .
          <source>In: Proceedings of the 3rd Italian Workshop on Artificial Intelligence and Robotics A workshop of the XV International Conference of the Italian Association for Artificial Intelligence (AI*IA</source>
          <year>2016</year>
          ). vol.
          <year>1834</year>
          , pp.
          <fpage>31</fpage>
          -
          <lpage>35</lpage>
          . CEUR-WS, Genova, Italy (nov
          <year>2016</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Horridge</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bechhofer</surname>
            ,
            <given-names>S.:</given-names>
          </string-name>
          <article-title>The owl api: A java api for owl ontologies</article-title>
          .
          <source>Semant. web 2</source>
          (
          <issue>1</issue>
          ),
          <fpage>11</fpage>
          -
          <lpage>21</lpage>
          (
          <year>Jan 2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Sirin</surname>
            ,
            <given-names>E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Parsia</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grau</surname>
            ,
            <given-names>B.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kalyanpur</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Katz</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          :
          <article-title>Pellet: A practical owl-dl reasoner</article-title>
          .
          <source>Web Semantics: science, services and agents on the World Wide Web</source>
          <volume>5</volume>
          (
          <issue>2</issue>
          ),
          <fpage>51</fpage>
          -
          <lpage>53</lpage>
          (
          <year>2007</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Tenorth</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Beetz</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Knowrob - knowledge processing for autonomous personal robots</article-title>
          .
          <source>In: 2009 IEEE/RSJ International Conference on Intelligent Robots and Systems</source>
          . pp.
          <fpage>4261</fpage>
          -
          <lpage>4266</lpage>
          . IEEE (Oct
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          11 http://www.theconstructsim.com/ros-developers
          <string-name>
            <surname>-</surname>
          </string-name>
          online-conference-2018
          <string-name>
            <surname>-</surname>
          </string-name>
          rdc
          <article-title>-worldwide/ros-developers-conference-speaker-alessio-capitanelli</article-title>
          . Code available at https://github.com/EmaroLab/armor_rds_tutorial.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>