<!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>Implementing the Instance Store</article-title>
      </title-group>
      <contrib-group>
        <aff id="aff0">
          <label>0</label>
          <institution>Information Management Group Department of Computer Science University of Manchester Manchester</institution>
          ,
          <country country="UK">UK</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Sean Bechhofer</institution>
          ,
          <addr-line>Ian Horrocks, Daniele Turi</addr-line>
        </aff>
      </contrib-group>
      <pub-date>
        <year>1998</year>
      </pub-date>
      <fpage>636</fpage>
      <lpage>647</lpage>
      <abstract>
        <p>We describe the implementation of the instance store, a DL system using a combination of TBox reasoning and database queries to perform efficient and scalable role-free ABox reasoning.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>
        Description Logic (DL [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ]) reasoning over individuals is an important aspect of the
vision behind the Semantic Web and it is crucial in applications of ontologies in areas
such as bioinformatics (gene description) and web-service discovery. This also poses
new challenges for ontological reasoning. Firstly, applications might require vast
volumes of individuals exceeding the capabilities of existing reasoners. Secondly, while
one can assume that changes in the terminological part of an ontology are relatively
infrequent, the above scenarios require dynamic, frequent and, possibly, concurrent
modification of the information related to the individuals in ontologies.
      </p>
      <p>
        To tackle this problem we have developed a Java component, called instance Store
(iS) [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. As a starting point, we postulate there is no direct relation between instances,
ie the ABox is role-free. This means that reasoning over instances can be reduced to
reasoning over their descriptions (possibly involving properties). From an
architectural point of view, the ontology of classes can then be treated as a static schema,
loaded from a file into a DIG [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ] compliant TBox reasoner such as FaCT [13] or
RACER [
        <xref ref-type="bibr" rid="ref12">12</xref>
        ], while all the assertions about the individuals are dynamically added to
and retrieved from a database. This way, we can exploit robust enterprise database
technology offering persistency, scalability, and secure and concurrent transaction
∗Work partly funded by the European Union MONET Project (IST-2001-34145).
management. All this, while ensuring both the soundness and completeness of the
resulting reasoning for role-free ABoxes.
      </p>
      <p>
        We have discussed the basic ideas behind iS , its performance, and related and
future work in [
        <xref ref-type="bibr" rid="ref13">14</xref>
        ]. In this paper, we present its architecture and implementation
issues in detail.
2
      </p>
    </sec>
    <sec id="sec-2">
      <title>Architecture</title>
      <p>The architecture of iS is shown in Figure 1 while its functionality is encapsulated in
three basic methods as shown in Figure 2.</p>
      <p>
        The recent W3C recommendation for web ontology languages is OWL [
        <xref ref-type="bibr" rid="ref11">11</xref>
        ], while
the (de facto) XML standard for communicating with DL reasoners is the DIG
Interface [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ]. This is reflected in our design of the iS , which consists of a core component
working with DIG ontologies and descriptions and of an OWL wrapper around it
using the OWL API [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ] and the DIG Interface API [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] to translate OWL to DIG and
vice versa.
2.1
      </p>
      <p>
        OWL Wrapper
In the OWL wrapper the ontology is in OWL and, at initialisation time, it is parsed
into a Java OWLOntology object using the OWL API. The iS accepts OWL
descriptions either as Java OWLDescription objects of the OWL API, or as
description strings in OWL Abstract Syntax [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ]. OWL ontologies and descriptions are
submitted to the reasoner using suitable parsers and renderers in the OWL API and
XMLBeans [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and other classes from the DIG Interface API. (See Figure 3 for an
overview.)
      </p>
      <p>The iS also has a simple XSLT stylesheet which can convert DIG descriptions to
descriptions in OWL abstract syntax.
The first operation (initialise) connects to the database (creating the tables if
needed) and the reasoner and loads the ontology into the reasoner.</p>
      <p>The second operation (addAssertion) stores in the database the fact that
individual (as a URI) is an instance of (DIG) description, together with additional
information gathered through calls to the reasoner, such as the atomic concepts in the
ontology the individual is instance of, and the position of the description in the
taxonomy.</p>
      <p>The third operation (retrieve) again uses the database and the reasoner (with
respect to the ontology) to retrieve all individuals (again as URIs) which are instances
of the description query.
3</p>
    </sec>
    <sec id="sec-3">
      <title>Database</title>
      <p>The iS tries to minimise the amount of reasoning required at retrieval time by storing
as much information as possible about the descriptions used both during assertion and
retrieval. For this we use a relational database whose schema is depicted in Figure 4.</p>
      <p>Each description (either asserted or retrieved) is assigned a unique numerical
identifier and stored in a dedicated Descriptions table; the identifier acts as primary
key and the descriptions are indexed. The assertions are stored in the corresponding
table1 containing contains individuals and the identifiers of their associated
descriptions; the latter are foreign keys referencing ids in the descriptions table; the
individual/descriptionId pair forms a primary key. Next, we use a Types table containing
description ids and all the primitive concepts in the ontology which subsume them;
again the description ids are foreign keys, the concept/descriptionId pair is a primary
key, and the concepts are indexed. Finally, we use three more tables of the same type
as Types to store the primitive concepts which are, respectively, equivalent to, parent
of and child of a given description.</p>
      <p>We have implemented the above schema using three different DBMS: MySQL,
Oracle, and Hypersonic. The latter is mostly for testing and demo purposes; it is
entirely in Java and requires no installation other than including the corresponding jar
in the classpath; each database consists of simply two files, one with properties and
one with a script incrementally updated with the issued SQL statements.</p>
      <p>MySQL offers the best performance, but it lacks set operations so in our
algorithms below we mostly refer to the Oracle implementation.
4</p>
    </sec>
    <sec id="sec-4">
      <title>Algorithms</title>
      <p>Apart from the initialisation phase, the main functionality of iS consists of asserting
that an individual is an instance of a class and retrieving all instances of a description.
In both cases, iS first checks if the description is already in store. If this is not the
case, then iS uses the TBox reasoner to classify it and then stores the result as shown
in Algorithm 1.</p>
      <p>Algorithm 1 storeClassification(Description D) : int
1: id ← database.addDescription(D)
2: classification ← reasoner .classify (D)
3: database.addToTypes(id, classification.getAncestors())
4: if classification.getEquivalents() 6= ∅ then
5: database.addToTypes(id, classification.getEquivalents())
6: database.addToEquivalents(id, classification.getEquivalents())
7: else
8: database.addToParents(id, classification.getParents())
9: database.addToChildren(id, classification.getChildren())
10: end if
11: return id</p>
      <p>1Here we refer to this table as Assertions, but in the actual implementation it is, misleadingly,
called primitive.</p>
      <p>In order to satisfy the constraint that there is a single description for each
individual in the assertions table, before adding an assertion we first check whether the
individual is already in store. If this is the case, then the corresponding description is
conjuncted with the new description (unless subsumed). See Algorithm 2 for details.</p>
      <p>As for retrieval, the first step is to check whether the description whose instances
are required is consistent. Next, iS checks whether the description is in store and, if
not, the description and its classification are stored in the database. After this
preprocessing phase, the actual algorithm begins.</p>
      <p>Firstly, iS checks whether the description is equivalent to any primitive concept
in the ontology. Since, at this stage, the classification of the description is already in
the database, it is sufficient to query the table of equivalents. This is done in Query 1.
Note that the query is a join which effectively returns all the ids of descriptions
subsumed by primitive concepts equivalent to the query description. If the set returned
Query 1 idsFromEquivalents (int id)
SELECT DISTINCT Types.descriptionId FROM Types, Equivalents
WHERE id = Equivalents.descriptionId</p>
      <p>AND Equivalents.concept = Types.concept
by such query is not empty then iS can just return the individuals corresponding to
such description ids in the table of assertions.</p>
      <p>In general, however, there might be no primitive concept equivalent to the query
description. In that case we have to return the instances of children of the query
description and also check all the instances of its parents. There is a particular
case though when this task can be accomplished in a relatively straightforward way,
namely when the conjunction of the parents of the query description is equivalent
to the query description: we then know that the desired set of instances consists of
the intersection of the instances of each parent, union the instances of the children of
description. (See Query 2.)</p>
      <sec id="sec-4-1">
        <title>Query 2 allIndividuals(int id, Set {p1,...,pn})</title>
        <p>SELECT DISTINCT individual FROM Assertions</p>
        <p>WHERE descriptionId IN (</p>
        <p>SELECT descriptionId FROM Types WHERE concept = p1
INTERSECT
...</p>
        <p>INTERSECT
SELECT descriptionId FROM Types WHERE concept = pn
UNION
SELECT Types.descriptionId FROM Types, Children</p>
        <p>WHERE Children.concept = Types.concept</p>
        <p>AND Children.descriptionId = id)</p>
        <p>When the above does not hold, the iS has then to perform the following, more
complex process. First, collect all the description ids corresponding to instances of
parents which are not also instances of children. This is performed by Query 3.</p>
      </sec>
      <sec id="sec-4-2">
        <title>Query 3 getCandidates(int id, Set {p1,...,pn})</title>
        <p>SELECT DISTINCT description FROM Descriptions</p>
        <p>WHERE Descriptions.id IN (</p>
        <p>SELECT descriptionId FROM Types WHERE concept = p1
INTERSECT
...</p>
        <p>INTERSECT
SELECT descriptionId FROM Types WHERE concept = pn
MINUS
SELECT Types.descriptionId FROM Types, Children</p>
        <p>WHERE Children.concept = Types.concept</p>
        <p>AND Children.descriptionId = id)</p>
        <p>Next, ask the TBox reasoner to compute the subset of the above candidate
descriptions which are subsumed by the query description. This requires a single DIG
ask, but as many internal checks as there are candidates. Here the performance of the
reasoner really matters. The instances of this set together with the instances of the
children of the query description forms then the final result. (See Algorithm 3 for full
details.)</p>
        <p>
          Enterprise iS
In many applications, many different clients might want to access iS concurrently and
securely. This can be easily accomplished thanks to our architectural choices. Indeed,
we have developed an Enterprise Java Beans version of iS which is deployed using
the JBoss [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ] J2EE application server. (See Figure 5.) It consists of:
1. a wrapper for InstanceStore implementing the SessionBean interface;
        </p>
        <sec id="sec-4-2-1">
          <title>2. a managed bean (MBean) wrapper for the reasoner;</title>
        </sec>
        <sec id="sec-4-2-2">
          <title>3. a Hibernate [2] version of BackingStore.</title>
          <p>
            Hibernate allows to persist the plain Java objects corresponding to iS descriptions,
individual, and primitive concepts. Object-relational mappings define the way the
relevant properties in the objects are mapped to entries in a relational database. We
used XDoclet [
            <xref ref-type="bibr" rid="ref6">6</xref>
            ] to generate the Hibernate object-relational mapping as well as the
local and remote interfaces to the beans.
          </p>
          <p>As for the reasoner, the use of managed beans means that several instances of the
same TBox reasoner can be dynamically spawned when required by the clients (at
least if the TBox reasoner is available as a DLL, ie dynamically linked library).
The architectural choices made in the implementation of iS ensure that we use
appropriate technologies for appropriate tasks. It is clear that at some point the reasoner
must be used in order to retrieve individuals, but in our approach it is only used when
necessary. Databases are well suited to handling large amounts of data and are
optimised for the performance of operations such as joins and intersections – for example
the queries described in the query in Figure 2.</p>
          <p>As discussed in Section 5, the architecture also allow us to make use of
functionality supported by existing component architectures such as Enterprise Java Beans.
Then issues like concurrency and security can be passed off to the application servers
running the beans.</p>
          <p>The use of a database back end also allows us to support persistency. A-boxes
may well include large amounts of data, and we can make use of the fact that this is
precisely a task that databases are designed to support. There is still, of course, the
question of persistent storage of the ontology within the reasoner, but again the
separation of the reasoning component from the instance storage means that alternative
reasoner implementations can simply be “swapped in” as necessary.
Acknowledgements. Phillip Lord participated in the early stages of the
implementation of the iS and Nick Taylor and David Roberts from Stilo International PLC
participated in the development of the enterprise iS .</p>
        </sec>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <article-title>[1] DIG Interface API</article-title>
          . http://dig.sourceforge.net.
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>Hibernate</surname>
          </string-name>
          . http://www.hibernate.org.
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          <article-title>[3] Instance Store API</article-title>
          . http://instancestore.man.ac.uk.
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>[4] JBoss. http://www.jboss.org.</mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>OWL</given-names>
            <surname>API</surname>
          </string-name>
          . http://sourceforge.net/projects/owlapi.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>[6] XDoclet. http://xdoclet.sourceforge.net.</mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>[7] XMLBeans. http://xml.apache.org/xmlbeans.</mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>Franz</given-names>
            <surname>Baader</surname>
          </string-name>
          , Diego Calvanese,
          <string-name>
            <surname>Deborah</surname>
            <given-names>McGuinness</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Daniele</given-names>
            <surname>Nardi</surname>
          </string-name>
          , and Peter PatelSchneider, editors.
          <source>The Description Logic Handbook - Theory, Implementation and Applications</source>
          . Cambridge University Press,
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          [9]
          <string-name>
            <given-names>Sean</given-names>
            <surname>Bechhofer</surname>
          </string-name>
          .
          <article-title>The DIG description logic interface: DIG/1.1</article-title>
          .
          <source>In Proceedings of the 2003 Description Logic Workshop (DL</source>
          <year>2003</year>
          ),
          <year>2003</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <surname>Sean</surname>
            <given-names>Bechhofer</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Peter F. Patel-Schneider</surname>
            ,
            <given-names>and Daniele</given-names>
          </string-name>
          <string-name>
            <surname>Turi. OWL Web Ontology Language Concrete Abstract Syntax</surname>
          </string-name>
          ,
          <year>December 2003</year>
          . Available from http://owl.man.ac.uk/2003/ concrete/latest/.
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <surname>Sean</surname>
            <given-names>Bechhofer</given-names>
          </string-name>
          , Frank van Harmelen,
          <string-name>
            <surname>Jim Hendler</surname>
          </string-name>
          , Ian Horrocks, Deborah L.
          <string-name>
            <surname>McGuinness</surname>
          </string-name>
          ,
          <string-name>
            <surname>Peter F. Patel-Schneider</surname>
          </string-name>
          ,
          <article-title>and Lynn Andrea Stein</article-title>
          .
          <source>OWL Web Ontology Language Reference</source>
          .
          <source>Technical Report REC-owl-ref-20040210</source>
          , The Worldwide Web Consortium,
          <year>February 2004</year>
          . Available from http://www.w3.org/TR/2004/REC-owl-ref-
          <volume>20040210</volume>
          /.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>Volker</given-names>
            <surname>Haarslev</surname>
          </string-name>
          and
          <string-name>
            <given-names>Ralf</given-names>
            <surname>Moller</surname>
          </string-name>
          .
          <article-title>Description of the RACER system and its applications</article-title>
          . In Rajeev Gore, Alexander Leitsch, and Tobias Nipkow, editors,
          <source>Automated reasoning: First International Joint Conference, IJCAR</source>
          <year>2001</year>
          , Siena, Italy, June 18-23,
          <year>2001</year>
          : proceedings, volume
          <volume>2083</volume>
          <source>of Lecture Notes in Artificial Intelligence</source>
          , New York, NY, USA,
          <year>2001</year>
          . Springer-Verlag Inc.
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [14]
          <string-name>
            <surname>Ian</surname>
            <given-names>Horrocks</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>Lei</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Daniele</given-names>
            <surname>Turi</surname>
          </string-name>
          , and
          <string-name>
            <given-names>Sean</given-names>
            <surname>Bechhofer</surname>
          </string-name>
          .
          <article-title>The Instance Store: DL reasoning with large numbers of individuals</article-title>
          .
          <source>In Proc. of the 2004 Description Logics Workshop (DL</source>
          <year>2004</year>
          ), pages
          <fpage>31</fpage>
          -
          <lpage>40</lpage>
          ,
          <year>2004</year>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>