<!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>From Unary/Binary Datalog and PSOA RuleML to Graphviz and Grailog</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Ismail Akbari</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Bo Yan</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Junyan Zhang</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Harold Boley</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>A. Frame Formulas: Associating Slots with an Object Identifier</institution>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Faculty of Computer Science University of New Brunswick Fredericton</institution>
          ,
          <addr-line>NB</addr-line>
          ,
          <country country="CA">Canada</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>SWRL rules are transformed in two steps for visualization in a subset of Grailog. A Unary/Binary Datalog rule in SWRL presentation syntax is translated to a corresponding PSOA RuleML rule in a RIF-like presentation syntax employing frame formulas. This is then translated to the Graphviz DOT language so that the Graphviz tool can render it visually as a Grailog graph with an object identifier and slots. Supported by the obtained visual graphs, users can more easily analyze the original symbolic logic rules.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>-</title>
      <p>Keywords- Semantic Web; SWRL rules;
Unary/Binary Datalog; F-logic; PSOA RuleML; Grailog;
Visualization; Graphviz; Transformation</p>
      <p>I.</p>
      <p>INTRODUCTION</p>
      <p>
        The Semantic Web Rule Language (SWRL) [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ]
combines the sublanguages Web Ontology Language
Description Logic (OWL DL) with the Unary/Binary
Datalog RuleML sublanguage of the Rule Markup
Language. The Graph inscribed logic (Grailog) has
been introduced as a systematic graph standard for
visual-logic knowledge [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. This work uses
transformations targeting the Graphviz tool [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ] to
visualize SWRL rules as Grailog 1.0 graphs. SWRL
rules are translated to corresponding PSOA
(Positional-Slotted, Object-Applicative) RuleML [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]
frame rules, which are then translated to the Graphviz
DOT language for rendering as Grailog graphs.
      </p>
      <p>II.</p>
      <p>LANGUAGES AND TOOLS</p>
      <p>
        There exist many methods and tools to visualize
data and knowledge [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ] in diverse areas. One of these
areas is the Semantic Web, whose knowledge can be
visualized via Directed Labeled Graphs (DLGs) and
DLG-extending Grailog graphs.
      </p>
    </sec>
    <sec id="sec-2">
      <title>A. OWL DL and OWL Lite</title>
      <p>
        OWL achieves machine interpretability of Web
ontologies by providing an XML syntax and a formal
semantics [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. SWRL's sublanguage OWL DL
supports users who want high expressiveness while
retaining computational completeness and
decidability. OWL DL's sublanguage OWL Lite
supports those users primarily needing a classification
hierarchy and simple constraints.
      </p>
    </sec>
    <sec id="sec-3">
      <title>B. Frame Logic</title>
      <p>
        Frame logic (F-logic) is a frame-based language
using slot-described objects typed by classes that are
organized as a light-weight ontology (taxonomy) [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ].
The semantics of F-logic makes the closed world
assumption as opposed to the open world assumption
of description logics. Also, F-logic is generally
undecidable whereas OWL DL is decidable.
      </p>
    </sec>
    <sec id="sec-4">
      <title>C. PSOA RuleML</title>
      <p>
        PSOA RuleML is a rule language that deeply
integrates relational (predicate-based) and
objectcentered (frame-based) modeling. In PSOA RuleML,
the notion of a PSOA term is introduced as a
generalization of: (1) the positional-slotted term in
POSL [
        <xref ref-type="bibr" rid="ref10">10</xref>
        ] and (2) the frame term and the class
membership term in F-logic and RIF-BLD [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ].
      </p>
    </sec>
    <sec id="sec-5">
      <title>D. Graphviz</title>
      <p>
        Graph Visualization Software (Graphviz) is a
package of open source tools that was introduced by
AT&amp;T Labs Research for graph drawing, e.g. via
DOT language scripts [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. Graphviz layout programs
take the description of graphs in a simple text file
based on the DOT language script format and
generate diagrams (graphs) in the desired output
format [
        <xref ref-type="bibr" rid="ref8">8</xref>
        ].
      </p>
      <p>III.</p>
      <sec id="sec-5-1">
        <title>UNARY/BINARY FRAME DATALOG</title>
        <p>In Grailog, we extend Unary/Binary Datalog with
frames. A unary relation is a class pointing to the
relation’s single argument as the node it types. A
binary relation describes a relationship between two
nodes.</p>
        <p>Slots in Grailog are drawn as special,
bulletattached arrows distinguishing a start node as playing
the role of the Object IDentifier (OID). In
Unary/Binary Frame Datalog, a node (an instance or a
variable), acting as the OID of a frame, can be pointed
to by a class-originating arrow for (‘unary’) typing
and can have outgoing slot arrows. The same node
can also act as the first or second argument of a binary
relation, drawn as a regular (bullet-free) arrow. See
figure 1 for an example.</p>
        <p>STRUCTURE OF THE IMPLEMENTATION</p>
        <p>The main steps of our prototype implementation
are as follows. First, the tool receives SWRL's
(Unary/Binary) Datalog rules from the input and
translates them into Frame Datalog. Next, it splits
each rule into its components, including instances,
classes and slots, written to a text file. From these
components, it then generates the Graphviz DOT file.
Finally, it calls Graphviz for the visual rendering of
the graph output.</p>
        <p>V.</p>
        <p>SWRL-TO-PSOA TRANSFORMATION</p>
        <p>This section describes how to transform Datalog
SWRL rules to Frame Datalog PSOA RuleML rules,
used by our Grailog visualization and reusable
generally. SWRL rules use a conjunctive formula as
premise and as conclusion. After receiving a SWRL
rule, it will be translated to a Frame Datalog rule in
PSOA RuleML. As an example, consider the
following SWRL rule. The “?” symbol indicates
variables and “^” denotes conjunction:</p>
        <p>Person(?x) ^
Man(?y) ^
hasAge(?x,?age1) ^
hasAge(?y,?age2) ^
hasSibling(?x,?y) ^
swrlb:greaterThan(?age2,?age1)
-&gt;
hasOlderBrother(?x,?y)
(1)
(2)</p>
        <p>This is translated to the following PSOA RuleML
rule, whose first two premises represent single-slot
frames, where the term f(t) encodes the slot f-&gt;t:
hasOlderBrother(?x ?y)
:</p>
        <p>And(?x#Person(hasAge(?age1))
?y#Man(hasAge(?age2))
hasSibling(?x ?y)
swrlb:greaterThan(?age2 ?age1))</p>
        <p>The frame premises check that object “?x” of class
“Person” has property “hasAge” with value “?age1”
and object “?y” of class “Man” has property “hasAge”
with value “?age2”.</p>
        <p>VI.</p>
        <p>ILLUSTRATIVE RULE RENDERING</p>
        <p>
          An example is used to show the tool’s operation.
Consider formula (1) as the SWRL rule input. Its
transformation to formula (2) and further processing
described in [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ] lead to the output (the graph) shown
in figure 1. The red arrows show the premises of the
rule. The green arrow shows its conclusion. Recall
that a bullet distinguishes the OID of a slot arrow. An
oval shows a class and an octagon shows a variable.
        </p>
      </sec>
      <sec id="sec-5-2">
        <title>CONCLUSION</title>
        <p>
          Our tool transforms SWRL from Unary/Binary
Datalog rules to Frame Datalog PSOA RuleML. The
Graphviz-rendered visualization of frame rules as
Grailog graphs lets people more easily analyze the
logic of SWRL rules. By visualizing SWRL rules, this
work is an implementation of a Grailog 1.0 subset. A
demo and more details about the implemented system
are online [
          <xref ref-type="bibr" rid="ref9">9</xref>
          ].
        </p>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <surname>Horrocks</surname>
          </string-name>
          ,
          <string-name>
            <surname>Ian</surname>
          </string-name>
          , et al.
          <article-title>SWRL: A Semantic Web rule language combining OWL and RuleML</article-title>
          .
          <source>W3C subm</source>
          .
          <volume>21</volume>
          (
          <year>2004</year>
          ):
          <fpage>79</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <given-names>Harold</given-names>
            <surname>Boley</surname>
          </string-name>
          .
          <article-title>Grailog 1.0: Graph-Logic Visualization of Ontologies and Rules</article-title>
          .
          <source>Proc. RuleML</source>
          <year>2013</year>
          , Seattle, Washington, USA,
          <year>July 2013</year>
          , Springer LNCS 8035. Preprint: http://cs.unb.ca/~boley/papers/GrailogVisOntoRules.pdf
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <surname>Goldstein</surname>
            ,
            <given-names>Ira P.</given-names>
          </string-name>
          <article-title>The genetic graph: a representation for the evolution of procedural knowledge</article-title>
          .
          <source>International Journal of Man-Machine Studies 11.1</source>
          (
          <year>1979</year>
          ):
          <fpage>51</fpage>
          -
          <lpage>77</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>Pascal</given-names>
            <surname>Hitzler</surname>
          </string-name>
          , et al., OWL 2
          <string-name>
            <given-names>Web</given-names>
            <surname>Ontology Language Primer (Second Edition</surname>
          </string-name>
          ),
          <source>W3C Consortium</source>
          ,
          <source>Recommendation REC-owl2-primer-20121211</source>
          ,
          <year>Dec 2012</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>Michael</given-names>
            <surname>Kifer</surname>
          </string-name>
          , et al.,.
          <article-title>Logical foundations of object-oriented and frame-based languages</article-title>
          .
          <source>Journal of the ACM (JACM) 42.4</source>
          (
          <year>1995</year>
          ):
          <fpage>741</fpage>
          -
          <lpage>843</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>Harold</given-names>
            <surname>Boley</surname>
          </string-name>
          .
          <article-title>A RIF-Style Semantics for RuleML-Integrated Positional-Slotted,Object-Applicative Rules</article-title>
          ,
          <source>Proc. 5th Int'l Symposium on Rules: Research Based and Industry Focused (RuleML-2011 Europe)</source>
          , Barcelona, Springer,
          <year>July 2011</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <surname>Koutsofios</surname>
          </string-name>
          , Eleftherios, and Stephen North.
          <article-title>Drawing graphs with dot</article-title>
          .
          <source>Technical Report 910904-59113-08TM</source>
          , AT&amp;T Bell Laboratories, Murray Hill, NJ,
          <year>1991</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>[8] http://graphviz.org/</mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>[9] http://2012team8project.weebly.com/index.html</mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>Harold</given-names>
            <surname>Boley</surname>
          </string-name>
          .
          <article-title>Integrating Positional and Slotted Knowledge on the Semantic Web</article-title>
          , JETWI
          <volume>2</volume>
          (
          <issue>4</issue>
          ):
          <year>2010</year>
          ,
          <fpage>343</fpage>
          -
          <lpage>353</lpage>
          .
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>