<!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>Brain, a library for the OWL2 EL pro le</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Samuel Croset</string-name>
          <email>croset@ebi.ac.uk</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>John Overington</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Dietrich Rebholz-Schuhmann</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>EMBL-EBI, Wellcome Trust Genome Campus</institution>
          ,
          <addr-line>Hinxton, Cambridge CB10 1SD</addr-line>
          <country country="UK">UK</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>Brain is a Java library facilitating the interaction with OWL2 EL ontologies. The library aims at bridging the gap between graphical user interfaces such as Protege and the OWL-API: It provides a series of convenience methods to create and query knowledge bases using the Manchester syntax. The library is useful to develop web applications and particularly suited for the biomedical domain. Brain relies on ELK for reasoning tasks. The open source project is available at https://github.com/loopasam/Brain.</p>
      </abstract>
      <kwd-group>
        <kwd>OWL2 EL</kwd>
        <kwd>library</kwd>
        <kwd>Java</kwd>
        <kwd>Manchester syntax</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>1.1</p>
    </sec>
    <sec id="sec-2">
      <title>Introduction</title>
      <p>
        OWL2 EL
The second version of the Web Ontology Language (OWL2) introduces a series of
pro les: OWL2 EL, RL and QL [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. These pro les are subsets of the full OWL2
speci cation and have been designed to match the requirements of particular
case scenarios. Pro les are de ned by the type of axioms and constructs they
support: For instance the EL pro le, which has been inspired from biomedical
ontologies, does not allow disjunctions or cardinality restrictions among other
things. This limited expressivity however enables the implementation of fast
reasoning algorithms which can handle large amount of data as it is required by
the application domain. In this document we will present the core features of a
Java library, Brain, dedicated to support the OWL2 EL families and oriented
toward biomedical knowledge manipulation. Another description of the library is
being published at the time of writting in a biomedical journal. This manuscript
aims at publicising the work to the OWLED workshop 2013 audience.
1.2
      </p>
      <sec id="sec-2-1">
        <title>Motivation</title>
        <p>
          The biomedical domain is particularly interesting for the OWL community
because of the richness and variety of the ontologies it contains. The majority of
resources such as the Gene Ontology [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] or SNOMED CT [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] are very large but
they are fortunately in line with the EL pro le. Driven by the recent
improvements in the reasoning speed over big biomedical knowledge bases with reasoners
such as ELK, it becomes nowadays possible to build web applications or to
perform biological analysis relying heavily on OWL queries performed against an
ontology of interest. The options available to undertake such tasks span from
graphical user interfaces (GUI) such as Protege [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ] to application programming
interfaces as the OWL-API [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ]. GUIs are wonderful to develop toy examples,
but they are not suited to handle very large ontologies as the ones faced in life
sciences, potentially containing millions of axioms. The OWL-API is solid
solution to build applications but it could be daunting for new comers or users with
little experience in Java or OWL. OWLTools [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ] is an intermediary option for the
biomedical domain as Tawny-OWL [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ]. Both of these libraries provide an
alternative programmatic environment to develop OWL ontologies using either Java
or Closure. These projects however do not address web application development
issues: Indeed in such a setting, when a reasoner is used to query an ontology
based on requests from users, a special care as to be put on the management of
concurrency. In order to ease the interaction with OWL2 EL ontologies we have
developed Brain, a facade on the top of the OWL-API. The library facilitates
the manipulation of EL ontologies, specially in a web server cocurrent
environment. Brain is already successfully used in production as a back-end engine for
web applications such as the Virtual Fly Brain [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ] or the Functional Therapeutic
Chemical Classi cation System [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ].
2
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Features</title>
      <p>
        The rest of the document will present the core features of the library as well as
an example of axiom implementation. The main idea behind Brain is to prevent
ambiguous situations to happen while manipulating an ontology and to simplify
the interaction with biomedical knowledge bases. Brain is implemented following
a pattern facade: It wraps the interaction with the OWL-API and the ELK
reasoner [
        <xref ref-type="bibr" rid="ref14">14</xref>
        ] by providing some convenience methods. The wrapped softwares
yet remain accessible for any operation un-implemented by the facade classes.
2.1
      </p>
      <sec id="sec-3-1">
        <title>Availability</title>
        <p>
          The source code of the library is open and freely available [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] under an Apache
License 2. Brain binaries are also distributed on Maven central repository or
directly downloadable as a jar le including all the dependencies. The
documentation providing concrete examples can be accessed and edited [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ].
2.2
        </p>
      </sec>
      <sec id="sec-3-2">
        <title>Manchester syntax interaction</title>
        <p>
          The interaction with Brain resolves only to the Manchester syntax [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ] expressed
as Java strings. This notation is user friendly and already widely used inside
Protege. It allows to focus on the OWL axioms rather than on the programming
implementation. The advantage of working directly with strings as input rather
than with more complicated Java objects appears in a web application context:
HTTP messaging can indeed be easily parsed and interpreted in order to quickly
build an OWL end-point for instance. A list of OWL queries for instance is also
easier to maintain, read and understand when represented with the Manchester
syntax.
2.3
        </p>
      </sec>
      <sec id="sec-3-3">
        <title>Unique ontology</title>
        <p>One of the core design decision behind the library was to enforce the users to
work with only one ontology. This simpli cation helps to focus on one knowledge
base at the time and remove any ambiguity that could be present while dealing
with scattered entities. It is yet possible to import and load external ontologies
and entities, but Brain merge any new axioms into one single knowledge base.
2.4</p>
      </sec>
      <sec id="sec-3-4">
        <title>Unique short form names</title>
        <p>Brain also enforces OWL entities to have a unique short form name. This choice
was made in order to prevent ambiguity while using the Manchester syntax to
formulate OWL expressions. For instance the short forms of the OWL entities
http://example.org/Cat and http://semanticweb.org/Cat will be the same: Cat.
The string \Cat" is ambiguous in this case and could present problems later
on when this short form is used for a query. This issue is prevented by Brain
and an exception is thrown when a potentially dangerous situation such as this
one occurs. This choice is not exactly in line with some of the Semantic Web
philosophy, but it seems likely to work in the biomedical domain, where entity
identi ers are most of the time preceded by a unique pre x anyway. For example
the short form names of the Open Biomedical Ontology (OBO) classes all start
with a pre x uniquely identifying the biomedical resource. All Gene Ontology
concepts start with the pre x "GO ". Note that this design is not against the
unique name assumption: It is still possible for di erent names to refer to the
same entities.
2.5</p>
      </sec>
      <sec id="sec-3-5">
        <title>Error handling driven</title>
        <p>Brain enforces some constraints in order to keep the OWL ontology as robust
and straightforward as possible. A lot of di erent types of errors can be thrown
in order to alert the user that a problem exists in the underlying ontology. A
special care had also to be put when interacting with expressions entered as
strings. Problems encountered when creating or querying the ontology are made
explicit to the developer in order to preserve the consistency of the knowledge
base. Errors handling is also helpful to route requests and redirect users in a web
application scenario.
2.6</p>
      </sec>
      <sec id="sec-3-6">
        <title>Queries</title>
        <p>A common use-case for OWL ontologies is to run queries in order to retrieve
some implicit information. An OWL query is a standard OWL class expression
in the context of Brain. The ELK reasoner is handling the classi cation and query
tasks. The classi cation of the ontology is triggered only when absolutely needed
and transparent to the user (lazy initialization). Queries are also formulated
using the Manchester syntax and it is possible to use the label (rdfs:label) of
OWL entities to enter the query expression, as featured in Protege. Queries are
thread-safe: For instance the simultaneous queries of two users will be correctly
handled by Brain. This characteristic is important in a concurrent web server
setting.
2.7</p>
      </sec>
      <sec id="sec-3-7">
        <title>Limitations</title>
        <p>The methods present in the library are only ful lling requirements from users.
However some important features are still missing: Individuals are not currently
supported for example. Despite not being oriented towards OWL individuals,
OWL2 EL ontologies are yet sometimes using them. This drawback will be
addressed in a coming release.
3</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Example of implementation</title>
      <p>
        The easiest way to understand the interaction with Brain is probably by
looking at a concrete example. This section will present the implementation of a
biomedical axiom using the library. The features discussed before are illustrated
in Figure 1. The interested reader can nd more examples on the wiki page [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
4
      </p>
    </sec>
    <sec id="sec-5">
      <title>Conclusion</title>
      <p>Brain is a Java library leveraging the interaction with the OWL-API and the
ELK reasoner. The library is dedicated to OWL2 EL ontologies and provide an
interface to manipulate and query biomedical knowledge bases. The library has
been designed to build web applications and to perform new type of
biomedical analysis relying heavily on an OWL reasoner. Some features will be added
in future releases, such as individual support. New functionalities are also
currently implemented, such as the generation of scalable vector graphics (SVG)
representing the OWL class taxonomies from the underlying ontology. Brain is
already stably used in some real life biomedical applications and new use-cases
from the community will guide the further development of this library.
//Creation of a fresh Brain instance.
//All the operations will be done on this object.</p>
      <p>Brain brain = new Brain();
//Add some OWL classes to the ontology.
//Short forms or full URIs can be used, but
//the short forms have to be unique.
brain.addClass("Nucleus");
brain.addClass("http://example.org/Cell");
//Add an OWL object property to the ontology
brain.addObjectProperty("part-of");
//Declare a complex axiom (partial existential restriction).
//Note that OWL expressions using the
//Manchester syntax can be used directly for the axiom
//assertion. If the entities used in the expression were
//missing, an error will be thrown (not shown here).
brain.subClassOf("Nucleus", "part-of some Cell");
//Integrate the content of an external knowledge base
//with the current ontology.
brain.learn("http://example.org/bar.owl");
//Query the knowledge base for indirect subclasses
//with the help of the ELK reasoner.
//Note that the classification initialization is
//transparent to the user.</p>
      <p>List&lt;String&gt; subClasses =</p>
      <p>brain.getSubClasses("part-of some Cell", false);
//Free the resources used by the reasoner.
brain.sleep();
//Save the ontology as a file
//using the Manchester syntax.
brain.save("your/path/to/ontology.owl");
using Brain; the axiom expressed in natural language: A nucleus is part of some cells.
Same axiom described in OWL using the Manchester syntax: Nucleus subClassOf
partof some Cell.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <given-names>Documentation</given-names>
            <surname>Brain</surname>
          </string-name>
          . https://github.com/loopasam/Brain/wiki, [Online; accessed 07-March-2013]
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <given-names>Examples</given-names>
            <surname>Brain</surname>
          </string-name>
          . https://github.com/loopasam/Brain/wiki/Examples, [Online; accessed 07-March-2013]
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>Functional</given-names>
            <surname>Therapeutic</surname>
          </string-name>
          <article-title>Chemical Classi cation System</article-title>
          . https://www.ebi.ac.uk/chembl/ftc, [Online; accessed 07-March-2013]
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          <article-title>4. OWL 2 Web Ontology Language Pro les (Second Edition)</article-title>
          . http://www.w3.org/TR/owl2-pro les/, [Online; accessed 25-April-2013]
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>5. OWLTools. http://code.google.com/p/owltools, [Online; accessed 07-March-2013]</mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <given-names>Source</given-names>
            <surname>Code</surname>
          </string-name>
          <article-title>Brain</article-title>
          . https://github.com/loopasam/Brain/, [Online; accessed 07- March-2013]
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <given-names>Virtual</given-names>
            <surname>Fly</surname>
          </string-name>
          <article-title>Brain</article-title>
          . http://www.virtual ybrain.org/, [Online; accessed 07-March2013]
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Ashburner</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ball</surname>
            ,
            <given-names>C.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Blake</surname>
            ,
            <given-names>J.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Botstein</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Butler</surname>
            ,
            <given-names>H.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cherry</surname>
            ,
            <given-names>J.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Davis</surname>
            ,
            <given-names>A.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dolinski</surname>
            ,
            <given-names>K.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dwight</surname>
            ,
            <given-names>S.S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Eppig</surname>
            ,
            <given-names>J.T.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Harris</surname>
            ,
            <given-names>M.A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Hill</surname>
            ,
            <given-names>D.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>IsselTarver</surname>
            ,
            <given-names>L.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Kasarskis</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Lewis</surname>
            ,
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Matese</surname>
            ,
            <given-names>J.C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Richardson</surname>
            ,
            <given-names>J.E.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ringwald</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rubin</surname>
            ,
            <given-names>G.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Sherlock</surname>
            ,
            <given-names>G.</given-names>
          </string-name>
          :
          <article-title>Gene Ontology: tool for the uni cation of biology</article-title>
          .
          <source>Nature Genetics</source>
          <volume>25</volume>
          (
          <issue>1</issue>
          ),
          <volume>25</volume>
          {
          <fpage>29</fpage>
          (
          <year>2000</year>
          ), http://dx.doi.org/10.1038/75556
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Horridge</surname>
          </string-name>
          ,
          <article-title>Bechhofer: The OWL API: A Java API for OWL Ontologies</article-title>
          . Semantic Web Journal pp.
          <volume>11</volume>
          {
          <issue>21</issue>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Horridge</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Drummond</surname>
            ,
            <given-names>N.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Goodwin</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rector</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Stevens</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Wang</surname>
            ,
            <given-names>H.H.</given-names>
          </string-name>
          :
          <article-title>The Manchester OWL Syntax</article-title>
          .
          <source>Syntax</source>
          <volume>216</volume>
          ,
          <issue>10</issue>
          {
          <fpage>11</fpage>
          (
          <year>2006</year>
          ), http://dblp.unitrier.de/rec/bibtex/conf/owled/HorridgeDGRSW06
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11.
          <article-title>IHTSDO: SNOMED CT</article-title>
          . http://www.ihtsdo.org/snomed-ct/, [Online; accessed 07-March-2013]
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          12.
          <string-name>
            <surname>Lord</surname>
            ,
            <given-names>P.</given-names>
          </string-name>
          :
          <article-title>The Semantic Web takes Wing: Programming Ontologies with TawnyOWL</article-title>
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>13. NCBO: Protege. http://protege.stanford.edu/, [Online; accessed 07-March-2013]</mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          14.
          <string-name>
            <surname>Yevgeny</surname>
            <given-names>Kazakov</given-names>
          </string-name>
          ,
          <article-title>Markus Krotzsch, Frantisek Simanc k: Concurrent Classi cation of EL Ontologies</article-title>
          .
          <source>Proceedings of the 10th International Semantic Web Conference (ISWC'11) 7032</source>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>