<!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 SWRLAPI: A Development Environment for Working with SWRL Rules</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Martin O'Connor</string-name>
          <email>martin.oconnor@stanford.edu</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Csongor Nyulas</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Ravi Shankar</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Amar Das</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Mark Musen</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Stanford Center for Biomedical Informatics Research Stanford</institution>
          ,
          <addr-line>CA 94305</addr-line>
          ,
          <country country="US">USA</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>SWRL is an expressive OWL-based rule language that can be used to increase the amount of knowledge encoded in OWL ontologies. While semantically a SWRL rule can be considered as an additional type of OWL axiom, the authoring and management of SWRL rule bases requires specialized tools that are not typically present in standard OWL development environments. In this paper, we describe such a tool-called the SWRLAPI-that provides a rich development environment for working with SWRL rules. The SWRLAPI is built on the widely-used Protégé-OWL ontology toolkit. It provides both a set of highly interactive user interfaces for working with rules and a set of lowlevel APIs for embedding rules in knowledge-driven applications. This SWRLAPI has been used to develop a number of technologies to support data integration on the Semantic Web, including a SWRL-based query language called SQWRL and a set of tools that support interoperation between OWL and a variety of information formats.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>
        We have developed a number of open-source tools to work with SWRL. One of the
primary results is the SWRLAPI [1], an extension to the Protégé-OWL ontology
development toolkit. The SWRLAPI provides both an authoring environment for
developing rules and a set of application programmer interfaces that support the
building of rule-driven applications. It has several core software components,
including an editor, a rule engine bridge that supports interoperation with a variety of
rule engines and OWL reasoners, a mechanism for defining Java implementations of
user-defined functions that can be used in rules, and an extensive set of libraries that
can be used to dramatically extend the expressive power of SWRL rules.
This core functionality has been used to build two complementary technologies: (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) a
SWRL-based query language called SQWRL that can be used to query OWL
ontologies; and (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) a set of data integration tools that support interoperation between
OWL, SWRL and other information formats, including XML, relational databases,
and a variety of others. We believe these two technologies can be used to tackle some
of the challenging data integration issues that are faced when developing Semantic
Web based software.
      </p>
    </sec>
    <sec id="sec-2">
      <title>The SWRLAPI: Core Features</title>
      <p>
        The SWRLAPI has several core software components, including (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) an editor that
supports interactive creating, editing, reading, and writing of SWRL rules; (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) a rule
engine bridge that provides the infrastructure necessary to interoperate with
thirdparty rule engines and OWL reasoners; (
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) a bridge that provides a mechanism for
defining libraries of built-ins; and (4) an extensive set of built-in libraries.
(
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) The Protégé-OWL SWRL Editor is an extension to Protégé-OWL that permits
interactive editing of SWRL rules. Users can create, edit, and read/write SWRL rules.
The editor supports the full set of language features outlined in the SWRL
Submission.
(
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) The SWRL Rule Engine Bridge is a subcomponent of the SWRLTab that
provides a bridge between an OWL model with SWRL rules and a third party rule
engine or OWL reasoner [2]. Its goal is to provide the infrastructure necessary to
incorporate rule engines and reasoners into Protégé-OWL to execute SWRL rules.
Interoperation with the Jess rule engine and the Pellet reasoner is currently provided.
Support for the Jena and Algernon rule engines are being developed.
(
        <xref ref-type="bibr" rid="ref3">3</xref>
        ) One of SWRL's most powerful features is its ability to support built-ins, which are
user-defined predicates that can be used in rules. A number of core built-ins are
defined in the SWRL Submission but users may also define their own libraries. The
SWRLAPI’s Built-in Bridge provides support for defining these libraries. Users
wishing to provide implementations for a library of built-in methods can define a Java
class that contains definitions for all the built-ins in their library. The bridge has a
dynamic loading mechanism to import these built-in definitions and provides an
invocation mechanism to execute built-ins in the library at run-time. If additional rule
engines are integrated into the SWRLAPI they can use these existing built-in libraries
without modification.
(4) The SWRLAPI provides set of Built-In Libraries [3]. These libraries include
implementations for the core SWRL built-ins defined in the SWRL Submission, a
temporal library that can be used to reason with temporal information in SWRL rules,
a mathematical library, an XML processing library, and libraries with ontology TBox
and ABox operators. Libraries for dealing with spreadsheet documents, WSDL,
SOAP, and RSS feeds are under development.
3
      </p>
    </sec>
    <sec id="sec-3">
      <title>The SWRLAPI: Querying with SQWRL</title>
      <p>SWRL is a rule language, not a query language. However, many ontology-based
applications require the ability to extract information from ontologies in addition to
reasoning with the information in those ontologies. To support this knowledge
extraction, we have developed a query language called SQWRL (Semantic
QueryEnhanced Web Rule Language; [4]) that extends SWRL to support querying of OWL
ontologies.</p>
      <p>SQWRL is implemented as a built-in library using the standard SWRL built-in
mechanism. The SQWRL built-in library contains SQL-influenced built-ins that can
be used in a rule to construct retrieval specifications for information stored in an
OWL ontology. For example, the following SQWRL query retrieves all persons in an
ontology whose age is less than 9, together with their ages:
Person(?p) ^ hasAge(?p,?a) ^ swrlb:lessThan(?a,9) -&gt; sqwrl:select(?p,?a)
Aggregation, ordering, and counting are also supported. For example, a query to
return the average age of persons with a known age in an ontology can be written:
Person(?p) ^ hasAge(?p, ?age) -&gt; sqwrl:avg(?age)
Like SWRL, SQWRL supports the use of OWL class descriptions. For example, to
retrieve all classes in an OWL ontology that are associated with an hasChild property
with a cardinality greater than or equal to one, we can write:
(hasChild &gt;= 1)(?i) -&gt; sqwrl:select(?i)
SQWRL has access to all available SWRLAPI built-in libraries. The ability to freely
use built-ins in a query provides a means of continuously expanding the power of the
query language. Crucially, it provides an interoperation bridge to deal with other
knowledge formats. SQWRL itself is formally based on OWL-DL and SQWRL
queries can be expressed only in terms of core OWL concepts. However, the built-ins
provides the ability to refer to non OWL DL concepts in queries. A TBox built-in
library, for example, allows direct querying of OWL classes and properties,
something that would not be possible in OWL DL. Similarly, an ABox built-in library
can support the direct querying of ABox entities. For example, to list all data valued
properties in an ontology and the number of their direct subproperties, we can write:
tbox:isDatatypeProperty(?p) ^ tbox:isDirectSubPropertyOf(?sp,?p)
-&gt; sqwrl:select(?p) ^ sqwrl:count(?sp)
The SWRLAPI provides a graphical interface to execute SQWRL queries. A
JDBClike Java interface is also provided to execute SQWRL queries in Java applications.
4</p>
    </sec>
    <sec id="sec-4">
      <title>The SWRLAPI: Data Integration</title>
      <p>
        Data integration is central challenge of the Semantic Web. Semantic Web applications
must typically deal with a variety of information formats. While there are many
dimensions to the data integration challenge, two functionalities are crucial: (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) the
ability to query diverse data formats; and (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) the ability to map between different
formats. The types of mapping required range from low level structural or syntactic
mappings to transformations that require extensive domain knowledge.
We have developed tools to support a variety of mappings to support data integration
with SWRL. These tools are: (
        <xref ref-type="bibr" rid="ref1">1</xref>
        ) XMLMapper, a library that supports the mapping of
information described in XML documents to and from OWL [5]; (
        <xref ref-type="bibr" rid="ref2">2</xref>
        ) DataMaster [6],
and Dynamic DataMaster [7], tools that supports mapping of relational data to OWL.
While we presently only support relational and XML data formats, SWRL's built-in
mechanism provided the extension point for dealing with additional formats.
5
      </p>
    </sec>
    <sec id="sec-5">
      <title>Discussion</title>
      <p>One of SWRL’s most useful features is its ability to incorporate user-defined built-in
libraries. This extension mechanism provides a very powerful means of expanding
SWRL’s expressiveness and of increasing the types of information that can be
reasoned with using rules. In particular, this mechanism can be used to tackle the
issue of data integration, which is one of the central challenges of the Semantic Web.
The ability to meet this challenge requires the development of a variety of mapping
technologies to allow interoperation between the various formats that will be
encountered when developing Semantic Web applications. The tools outlined in this
paper provide a set of basic building blocks that can be used to construct these
mapping technologies.
8th,
2008
from
[4] SQWRL (2008). SQWRL. Retrieved
http://protege.cim3.net/cgi-bin/wiki.pl?SQWRL
from
8th,
2008
from</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          <source>[1] SWRLAPI. Retrieved on August 8th</source>
          ,
          <year>2008</year>
          from http://protege.cim3.net/cgibin/wiki.pl?SWRLAPI
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>O</given-names>
            <surname>'Connor</surname>
          </string-name>
          <string-name>
            <given-names>MJ</given-names>
            ,
            <surname>Knublauch</surname>
          </string-name>
          <string-name>
            <given-names>H</given-names>
            ,
            <surname>Tu</surname>
          </string-name>
          <string-name>
            <given-names>SW</given-names>
            ,
            <surname>Grosof</surname>
          </string-name>
          <string-name>
            <given-names>B</given-names>
            ,
            <surname>Dean</surname>
          </string-name>
          <string-name>
            <given-names>M</given-names>
            ,
            <surname>Grosso</surname>
          </string-name>
          <string-name>
            <given-names>WE</given-names>
            , and
            <surname>Musen</surname>
          </string-name>
          <string-name>
            <surname>MA</surname>
          </string-name>
          (
          <year>2005</year>
          ).
          <article-title>Supporting rule system interoperability on the Semantic Web with SWRL</article-title>
          .
          <source>Fourth International Semantic Web Conference.</source>
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>SWRLTab</given-names>
            <surname>Built-In Libraries</surname>
          </string-name>
          . Retrieved on August http://protege.cim3.net/cgi-bin/wiki.pl?SWRLTabBuiltInLibraries
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [5]
          <string-name>
            <surname>XMLMapper</surname>
          </string-name>
          (
          <year>2008</year>
          ).
          <article-title>SWRLTab XMLMapper Tool</article-title>
          .
          <source>Retrieved on August 8th</source>
          ,
          <year>2008</year>
          from http://protege.cim3.net/cgi-bin/wiki.pl?SWRLTabXMLBuiltIns
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [6]
          <string-name>
            <surname>Datamaster</surname>
          </string-name>
          (
          <year>2008</year>
          ). DataMaster. Retrieved http://protegewiki.stanford.edu/index.php/DataMaster
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>O</given-names>
            <surname>'Connor</surname>
          </string-name>
          <string-name>
            <given-names>MJ</given-names>
            ,
            <surname>Shankar</surname>
          </string-name>
          <string-name>
            <given-names>RD</given-names>
            ,
            <surname>Tu</surname>
          </string-name>
          <string-name>
            <given-names>SW</given-names>
            ,
            <surname>Nyulas</surname>
          </string-name>
          <string-name>
            <given-names>C</given-names>
            ,
            <surname>Parrish</surname>
          </string-name>
          <string-name>
            <given-names>DB</given-names>
            , Musen, MA,
            <surname>Das</surname>
          </string-name>
          <string-name>
            <surname>AK</surname>
          </string-name>
          (
          <year>2007</year>
          ).
          <article-title>Using Semantic Web Technologies for Knowledge-Driven Querying of Biomedical Data</article-title>
          .
          <source>11th Conference on Artificial Intelligence in Medicine.</source>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>