<!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>The OWLlink API</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Olaf Noppens</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Marko Luther</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Thorsten Liebig</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>DOCOMO Communications Laboratory Europe GmbH</institution>
          ,
          <addr-line>Munich</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Institute of Artificial Intelligence, Ulm University</institution>
          ,
          <addr-line>Ulm</addr-line>
          ,
          <country country="DE">Germany</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>We introduce the OWLlink API that implements the OWLlink protocol on top of the Java-based OWL API. Besides providing an API to access remote OWLlink reasoning engines, it turns any OWL API aware reasoner into an OWLlink server. As such the OWLlink API provides the missing piece to replace the outdated DIG protocol by OWLlink in applications such as Protégé.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>Imagine you are editing a fancy ontology at your work place using your favorite
ontology editor. For validation, however, your laptop lacks the necessary free
memory and computing power. Why not access the reasoning engine installed on
your company’s ultra fast server over the network? Imagine you have to integrate
a set of reasoning engines from various vendors, each running on a different
platform, into your company’s next-generation product, without affecting its
stability. Often the only economic solution is to rely on a common protocol for
the connection of external components.</p>
      <p>
        In the past DIG [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] has been the standard protocol for connecting applications
to Description Logic reasoners. However, DIG’s poor support for OWL as well
as other conceptual shortcomings have become a major obstacle these days.
Therefore the extensible OWLlink protocol [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] has been defined as its follow up.
OWLlink is fully aligned with the latest OWL 2 specification and adds modern
features like retraction, introspection of capabilities and configurations as well as
a rich set of elementary queries.
      </p>
      <p>
        This paper introduces the OWLlink API,3 which provides a programmatic
interface for the OWLlink protocol on top of the Java-based OWL API [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. It
enables applications to access remote reasoners (so called OWLlink servers) and
enhances existing OWL API reasoners with OWLlink functionality.
The OWLlink API realizes a client and a server adapter (cf. Figure 1). The
client adapter allows applications to access OWL reasoner functionality via
      </p>
      <sec id="sec-1-1">
        <title>3 http://owllink-owlapi.sourceforge.net/</title>
        <p>itcn itaon
a ic
eSm lppA</p>
        <sec id="sec-1-1-1">
          <title>Client Adapter</title>
          <p>OWLlink</p>
        </sec>
        <sec id="sec-1-1-2">
          <title>Server Adapter</title>
          <p>OWL API</p>
          <p>3.0
Reasoner
Pellet 1.x
Pellet 2.x
HermiT</p>
          <p>FaCT++
RacerPro 2.x
native OWLlink or OWL API 3 Java interfaces. The server adapter enables
OWL API 2 or 3 reasoners to speak OWLlink. The OWLlink API implements
the HTTP/XML binding of the OWLlink interface and builds on the actual
OWL API 3 for the management of OWL 2 ontologies as well as for the parsing
and rendering of axioms in OWL/XML syntax.</p>
          <p>The client adapter enables Java applications to access remote OWLlink
services. It provides an extensible OWLlink specific API that supports all OWLlink
core requests and responses. In addition, the client adapter fully integrates
with the OWL API structures by implementing its OWLReasoner interface. The
server adapter offers a framework for developers to enhance their reasoners with
OWLlink functionality. It supports OWL API 3 aware reasoners directly and
enables OWL API 2 reasoners via a mediator component.
3</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Example Use</title>
      <p>The OWLlinkHTTPXMLReasoner class is an implementation of the OWL API
OWLReasoner interface, which allows existing applications to access remote
OWLlink servers without any further change of their program logic. The following
example shows the typical access of a supported reasoner using the OWL API.
The only line that is specific for accessing an OWLlink reasoner is line 7 where
the actual reasoner object is allocated.
1 OWLOntologyManager manager = OWLManager . createOWLOntologyManager ();
2 OWLDataFactory dFactory = manager . getOWLDataFactory ();
3 OWLOntology ontology = manager . createOntology ( IRI . create (" http :// owled " ));
4 OWLClass A = dFactory . getOWLClass ( IRI . create (" http :// owled #A" ));
5 OWLClass B = dFactory . getOWLClass ( IRI . create (" http :// owled #B" ));
6 manager . addAxiom ( ontology , dFactory . getOWLSubClassOfAxiom (A , B ));
7 OWLlinkHTTPXMLReasonerFactory rFactory = new OWLlinkHTTPXMLReasonerFactory ();
8 OWLReasoner reasoner = rFactory . createReasoner ( ontology );
9 // Now you can use the reasoner as an arbitrary OWLReasoner
10 boolean b = reasoner . isSubClassOf (A , B );</p>
      <p>To benefit from the additional OWLlink functionality beyond the OWL API
OWLReasoner interface, such as introspection, Knowledge Base management,
parallel handling of Knowledge Bases, and additional queries, one can allocate
the OWLlinkReasoner interface instead.
1 OWLOntologyManager manager = OWLManager . createOWLOntologyManager ();
2 OWLOntology ontology = manager . createOntology ( IRI . create (" http :// default " ));
3 URL url = new URL (" http :// localhost :8080 " );
4 OWLlinkHTTPXMLReasonerFactory rFactory = new OWLlinkHTTPXMLReasonerFactory ();
5 OWLlinkReasonerConfiguration conf = new OWLlinkReasonerConfiguration ( url );
6 OWLlinkReasoner reasoner = rFactory . createReasoner ( ontology , configuration );
7 // Create a new Knowledge Base ...
8 CreateKB createKB = new CreateKB ();
9 KB kb = reasoner . answer ( createKB );
10 IRI kbIRI = kb . getKB ();
11 // ... and transfer a set of axioms (e.g., from another ontology ) to it
12 Tell tell = new Tell ( kbIRI , anotherOntology . getAxioms ());
13 OK ok = reasoner . answer ( tell );
14 GetSubClassHierarchy request = new GetSubClassHierarchy ( kbIRI );
15 ClassHierarchy hierarchy = reasoner . answer ( getSubClassHierarchy )
16 ReleaseKb releaseKB = new ReleaseKb ( kbIRI );
17 reasoner . answer ( releaseKB );</p>
      <p>In this case, the reasoner is also accessible via the standard OWLReasoner interface,
which performs all method invocations on a knowledge base that can be retrieved
via getDefaultKB().</p>
      <p>As defined by the OWLlink protocol, requests can be bundled into one
request message for efficiency reasons. The OWLlink API supports this by an
answer method that consumes multiple requests. The resulting ResponseMessage
contains the responses corresponding to the given requests.
1 ResponseMessage responseMessage = reasoner . answer ( query1 , query2 , query3 , ..);
2 for ( Response response : responseMessage )
3 // process responses</p>
      <p>On server side the adapter can turn any reasoner into an OWLlink server
as long as the reasoner implements the OWLReasonerFactory interface of either
OWL API 2 or 3. For most popular reasoning engines (such as HermiT,4 Pellet5
and FaCT++6) the required OWLlinkServerFactory interfaces are already
provided. One just needs to make the libraries implementing the reasoner available
and start the server from the command line.</p>
      <p>For not yet supported reasoners, like CEL,7 only a factory class with an
implementation along the following lines needs to be added.
1 // reasoner factory of your reasoner
2 OWLReasonerFactory reasonerFactory = ...;
3 // HTTP port for the server
4 int port = ...;
5 OWLlinkServer server = new OWLlinkServer ( factory , port );
6 server . run ();
4</p>
    </sec>
    <sec id="sec-3">
      <title>Discussion</title>
      <p>Even for applications running on platforms with in-memory access to reasoners,
like Java which features the native implementations Pellet and HermiT as well
4 http://hermit-reasoner.com/
5 http://clarkparsia.com/pellet/</p>
      <sec id="sec-3-1">
        <title>6 http://owl.man.ac.uk/factplusplus/</title>
      </sec>
      <sec id="sec-3-2">
        <title>7 http://lat.inf.tu-dresden.de/systems/cel/</title>
        <p>
          as CEL and FaCT++ via their foreign function interface, the importance of the
standardized remote access to reasoners has been identified, mainly for stability
and scalability reasons [
          <xref ref-type="bibr" rid="ref4 ref5 ref6 ref7">4,5,6,7</xref>
          ]. While the IYOUIT system [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ] already connects
to RacerPro8 using its native OWLlink support, LarKC [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] still makes use of
DIG and both HERAKLES [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] and KDI [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ] are currently using some proprietary
protocol, which in the latter case, is based on the serialization of OWL API
structures into remote objects. However, all plan to switch to the common
OWLlink protocol.
        </p>
        <p>
          The OWLlink API client adapter facilitates the use of OWLlink for such
Java-based applications in a similar way as the Thea library [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] does for the Prolog
platform and is used by the OWLlink plug-in for Protégé9 that is to replace
its outdated DIG handler. Additionally, the OWLlink API server adapter turns
existing reasoners supporting the OWL API into OWLlink aware reasoners, ready
for remote access. The current OWLlink API implements all of the core protocol
as well as the retraction extension. Support for further OWLlink extension will
be added in the near future. We are also about to add further protocol bindings
besides HTTP/XML, like HTTP/Functional, to ease the integration of further
reasoners that come without OWL/XML support on non-Java platforms like the
CB reasoner10 into the Java platform.
        </p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Acknowledgements</title>
      <p>The authors would like to acknowledge the support of Matthew Horridge who
aligned parts of his OWL API implementation to the needs of the OWLlink API
and Alan Ruttenberg who tested early versions of the OWLlink API.
8 http://www.racer-systems.com/products/download/preview20.phtml
9 http://owllink-owlapi.sourceforge.net/download.html
10 http://code.google.com/p/cb-reasoner/</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Bechhofer</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Möller</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Crowther</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>The DIG Description Logic interface</article-title>
          .
          <source>In: Proc. of the Int. Workshop on Description Logics (DL'03)</source>
          . (
          <year>2003</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Liebig</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Luther</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Noppens</surname>
            ,
            <given-names>O.</given-names>
          </string-name>
          :
          <article-title>The OWLlink Protocol</article-title>
          . [9]
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Horridge</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bechhofer</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          :
          <source>The OWL API. [9]</source>
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Böhm</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Koolwaaij</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Luther</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          , et al.:
          <article-title>Introducing IYOUIT</article-title>
          .
          <source>In: Proc. of ISWC'08</source>
          . Volume 5318 of LNCS., Springer Verlag (
          <year>2008</year>
          )
          <fpage>804</fpage>
          -
          <lpage>817</lpage>
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Bock</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Tserendorj</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Xu</surname>
            ,
            <given-names>Y.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wissmann</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Grimm</surname>
            ,
            <given-names>S.:</given-names>
          </string-name>
          <article-title>A reasoning broker framework for OWL</article-title>
          . [9]
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Huang</surname>
            ,
            <given-names>Z.</given-names>
          </string-name>
          :
          <article-title>Initial evaluation and revision of plug-ins deployed in use-cases</article-title>
          .
          <source>EU IST FP7 Project Deliverable 4.7</source>
          .1,
          <string-name>
            <given-names>The</given-names>
            <surname>Large Knowledge Collider (LarKC)</surname>
          </string-name>
          (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Koutsomitropoulos</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Solomou</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Pomonis</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          , et al.:
          <article-title>Developing distributed reasoning-based applications for the Semantic Web</article-title>
          .
          <source>In: Proc. of the IEEE Int. Symposium on Mining and Web (MAW'10)</source>
          . (
          <year>2010</year>
          ) To Appear.
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Vassiliadis</surname>
            ,
            <given-names>V.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wielemaker</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mungall</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          :
          <article-title>Processing OWL 2 ontologies using Thea: an application of logic programming</article-title>
          .
          <source>[9]</source>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Hoekstra</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Patel-Schneider</surname>
          </string-name>
          , P.F., eds.
          <source>: Proc. of the OWLED'09 Workshop</source>
          . Volume 529 of CEUR Workshop Proceedings., CEUR-WS.org (
          <year>2009</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>