<!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>Graph-based rule editor</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Maciej Nowak</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Jaroslaw Bak</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Czeslaw Jedrzejek</string-name>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>Institute of Control and Information Engineering, Poznan University of Technology</institution>
          ,
          <addr-line>M. Sklodowskiej-Curie Sqr. 5, 60-965 Poznan</addr-line>
          ,
          <country country="PL">Poland</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>In this paper we present a prototypical implementation of a graphical tool for creating rules. This tool uses a graph-based Palantir tool environment as a user interface to model rule conditions and conclusions. It is also used to visualize data and results of reasoning. We present a process of converting graph models stored in an XML format file into the Jess knowledge base and rules. Results obtained in the reasoning process are presented to the user in the same form as source data.</p>
      </abstract>
      <kwd-group>
        <kwd />
        <kwd>graphical rule representation</kwd>
        <kwd>Jess</kwd>
        <kwd>Palantir</kwd>
        <kwd>reasoning</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>Introduction</title>
      <p>Rule engines are becoming one of the most commonly used technologies in both
business and engineering projects. The usage of rule engines enables the reasoning
process which enriches gathered data and searching methods, utilizing pattern
matching applied in rules. Rules and rule engines are successfully used in: expert systems,
business processes, data integration and transformation, and in other applications
requiring intelligent data processing. Despite the clear advantages of rule-based
technologies, there are many software application areas where they occur in a relatively
simple form, e.g. by using filters. In the area of criminal analysis, the addition of rules
to investigation systems would enable analysts to discover very complex crime
schemes, totally beyond the capacity of traditional systems.</p>
      <p>A wide range of rule environments have been proposed, each with its own syntax
and semantics for a rule engine and interface. The process of acquiring this
knowledge can be simplified with the use of a graphical representation of rules and a
user-friendly interface.</p>
      <p>The main aim of this demo paper is to present a graph-based tool, in which an
untrained analyst is able to construct a set of simple rules and use them in order to obtain
new (inferred) information. The rules constitute the expert’s knowledge of a given
domain, while facts represent data. Both rules and facts are expressed graphically in
the form of directed graphs. Rules can be applied to facts using a reasoning engine.
After the inference process, a user gets the result which can be a graph with:
• the addition of new objects and/or relations,
• the modification of existing objects and/or relations,
• the lack of objects and/or relations that were deleted.</p>
      <p>The paper is organized as follows. Section 2 presents the main overview of the
proposed approach and related work. Section 3 describes a prototypical
implementation and applied tools. Section 4 demonstrates an example which reflects a fragment
of analysis of the real-world crime case. Section 5 contains concluding remarks.
2
2.1</p>
    </sec>
    <sec id="sec-2">
      <title>Graph-based Rule Representation</title>
      <sec id="sec-2-1">
        <title>Existing methods</title>
        <p>
          Graphical rule representation and creation has been the subject of research
conducted by many investigators and companies. Some efforts have sought to standardize
graphical notations, for example: Unified Modeling Language/Object Constraints
Language (UML/OCL) [
          <xref ref-type="bibr" rid="ref5">5</xref>
          ], UML-based Rule Modeling Language (URML) [
          <xref ref-type="bibr" rid="ref6">6</xref>
          ] or
Object Role Modeling (ORM) [
          <xref ref-type="bibr" rid="ref7">7</xref>
          ]. Among them, the ORM language is the most
intuitive and easy to use for people who are not familiar with the complex syntax of rules
and UML/OCL. The ORM concepts were adopted [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ] also in the SBVR (Semantics of
Business Vocabulary and Business Rules) standard [
          <xref ref-type="bibr" rid="ref8">8</xref>
          ]. Our ideas are based on ORM
and graph-based representation. Other popular rule representations include: decision
tables, decision trees and eXtended Tabular Trees [
          <xref ref-type="bibr" rid="ref10">10</xref>
          ].
        </p>
        <p>
          Tools that implement graphical rules representation are:
• Visual Rules [
          <xref ref-type="bibr" rid="ref11">11</xref>
          ] – supports building flow rules and decision tables using rich
and intuitive graphical editors.
• Drools Guvnor [
          <xref ref-type="bibr" rid="ref12">12</xref>
          ] – provides many ways of representing rules: guided editor
(easy to use, but not graphical), guided decision tables creation, rule flows
(which represent the flow of logic).
• VisiRule [
          <xref ref-type="bibr" rid="ref13">13</xref>
          ] – is an extension to Win-Prolog which supports building
decision models using a graphical paradigm. It offers graphical representation of
forward chaining rules, with access to Prolog.
• OntoStudio Graphical Rule Editor [
          <xref ref-type="bibr" rid="ref14">14</xref>
          ] – is based on ObjectLogic [
          <xref ref-type="bibr" rid="ref15">15</xref>
          ]
internally. It supports drawing rule diagrams, which consist of concepts, attributes
of these concepts and relations between them. It does not allow the
comparison of variables (only comparisons between values and variables are allowed).
        </p>
        <p>In this work we give only a short overview of the main differences. Detailed
comparisons among the mentioned standards will be presented elsewhere.</p>
        <p>In most of the current approaches, rules are created to control data workflows and
making decisions, while we apply rules to discover new information and to process
data. Accordingly, one rule (LHS and RHS respectively) is represented by two
graphs. Tools like Visual Rules, Drools Guvnor etc. are rule authoring frameworks
while our approach is only an attempt to integrate rules and data in one graph-based
form and perform reasoning. Such work, to the best of our knowledge, has not yet
been done for the Jess engine.
2.2</p>
      </sec>
      <sec id="sec-2-2">
        <title>Overview of the approach</title>
        <p>The main goal of this paper is to present the graph-based tool, in which a user can:
import data, construct rules, perform reasoning and obtain results. Rules and data,
represented graphically, can be more easily understood by an untrained analysts and
by engineers without intensive training. Our aim is to provide an easy-to-use and
easy-to-understand analytical tool which can be used in many domains where rules
and graphs can be employed to support a user’s work.</p>
        <p>The process of rule creation consists of creating two graphs which will later serve
as sides of the constructed rule: the LHS (left hand side, called the body) and the RHS
(right hand side, called the head). In our approach rules should be understood as if
LHS then RHS statements. These rules (expressed in the Jess language) can be used to
infer new information in a given rule-based knowledge base.</p>
        <p>The LHS is built from condition elements (patterns) that need to be fulfilled in
order to execute instructions written in the RHS. There are two types of conditions: the
(non-) existence of a fact in the knowledge base with specified attributes, and the
relationship between two attributes of existing facts. The execution of the rule may
cause one of the following results: modification or removal of an existing fact, or
addition of a new one. These operations are defined in the RHS of a rule.</p>
        <p>It is possible to represent conditions from the body of a rule in a graphical form,
more precisely in a graph. The graph consists of nodes and edges. The nodes are
graphical representation of objects from the Palantir ontology (see Section 3.1), and
the edges are the relations between them. Objects can have many properties; the type
of an object is the most important one. Relations do not possess properties other than
a type. The presence of an object in the graph means that a representing fact should
exist in the knowledge base with attributes equal to the properties of the object. The
presence of an object or a relation on a red background means that these artefacts
should not exist in the knowledge base. The red colour on the graph expresses the
negation of existence of objects or relations.</p>
        <p>The construction of a rule is made with the following steps (within the Palantir
environment):
1.</p>
        <p>A user creates a graph which constitutes the body of the rule, the conditions.
The user creates objects and relations between them. Values of objects’
properties, variables and constraints are specified in the Rule Creation Panel
(RCP).
2. The user creates another graph, a modification of the first one which
constitutes the head of a rule. The user adds/removes/modifies objects or relations of
this graph. Conclusions - changes in the knowledge base after the application
of the rule - can be modelled as the difference between two graphs.</p>
        <p>Such an approach allows modelling of rules depending on object types, relations
between them and values of objects’ properties. It allows comparing attributes’ values
with each other, which is a significant advantage over some other tools (e.g.
OntoStudio). There is no graphical way of presenting the comparison on the graph, so the only
solution is to present it in the corresponding panel. For this purpose, we use a simple
tab called Rule Creation Panel, which is presented in Figure 1.</p>
        <p>Created rules need to be applied to the working memory built from facts. In this
paper we present a converter (see Section 3.3), which transforms rules and data to the
Jess engine according to the structure expressed in the Palantir ontology. After the
reasoning process, a user obtains results presented on a new graph (in comparison to
the source data graph).</p>
        <p>
          In the Jess language, we represent objects and relations from the graph as triples
(as in RDF) [
          <xref ref-type="bibr" rid="ref16">16</xref>
          ] in order to express dependencies between objects and their
attributes. The triple consists of subject, predicate and object. Each relation (edge) from the
graph is mapped as the predicate, with its starting point as the subject and the ending
point as the object of a triple. Each subject (node) has a set of properties, where: the id
of the node constitutes the subject; property name corresponds to the predicate; and
the value constitutes the object (in triple-based representation). Such an approach can
be compared to the OWL Web Ontology Language, where ObjectProperties represent
relations between objects and DatatypeProperties represent links from individuals
(objects) to data values. Employing the triple-based representation we are able to
apply OWL ontology in the future.
        </p>
        <p>We have defined mapping for a bidirectional transformation between Palantir and
Jess, executed by the XMLtoJess converter. Table 1 presents available expressions,
with examples in the Jess language and graph elements.</p>
        <p>
          The authors of this paper have successfully used rule engines in the past [
          <xref ref-type="bibr" rid="ref16 ref18 ref19">16, 18,
19</xref>
          ]. They were used during investigations of a number of cases. For some economic
crime, the complete model of a crime investigation was constructed. That allowed
achieving a result in a fully automatic way, but each time the rule set was made by a
programmer experienced in the Jess language after consultation with a business
specialist. We want to shorten this process with the help of the proposed system, and to
increase analytical flexibility by including new elements of crime schemes.
        </p>
      </sec>
    </sec>
    <sec id="sec-3">
      <title>Technologies Used</title>
      <sec id="sec-3-1">
        <title>Palantir Government Graph Application</title>
        <p>
          Palantir Government [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ] is a Java-based platform for analysing and visualizing
data. It is widely used by financial (Palantir Finance) and government agencies. It is
capable of importing data structured in many various formats (such as Excel), and,
due to the Palantir Dynamic Ontology (PDO) [
          <xref ref-type="bibr" rid="ref2">2</xref>
          ], objects inside the platform possess
some semantic background meaning, which can be easily transformed into rules. The
PDO is very simple; it only indicates that two objects are connected with a certain
relation (represented then on a graph by an icon or relation).
        </p>
        <p>Graph is the most sophisticated part of the Palantir Platform. It provides
visualization of input data, with the structure defined in the given ontology. Properties of each
object are not visible directly on the graph; they are reachable under the "Browser"
tab. It is possible to export information from the graph into an external XML file,
which is an essential element of the integration with a rule engine.
3.2</p>
      </sec>
      <sec id="sec-3-2">
        <title>The Jess Rule Engine</title>
        <p>
          Jess [
          <xref ref-type="bibr" rid="ref3">3</xref>
          ] is a rule engine and rule-based environment for building expert systems. It
uses an enhanced version of the Rete [
          <xref ref-type="bibr" rid="ref4">4</xref>
          ] algorithm, which processes rules and facts in
a very efficient way. Jess supports forward and backward chaining, working memory
queries and many other useful features. Jess is provided as a library written in the
Java language. It can easily be embedded into other Java applications. We applied
Jess and its forward reasoning as extensions to the Palantir Government tool.
3.3
        </p>
      </sec>
      <sec id="sec-3-3">
        <title>XMLtoJess Converter</title>
        <p>XML is used as the interchange format between Jess and Palantir modules. Rule
engines require input knowledge in form of facts, and that is why XMLtoJess
converter is an essential part of the presented method.</p>
        <p>The XMLtoJess converter is used to extract objects and relations stored in a
Palantir XML (pXML) document generated from Palantir and create the Jess knowledge
base. pXML format is the default output structure of the Palantir Platform. It holds
information about objects in the Graph and all properties related to selected objects.
4</p>
      </sec>
    </sec>
    <sec id="sec-4">
      <title>Example</title>
      <p>
        In this section, we provide an example which reflects part of the analysis of a
realworld crime case, the VAT carousel crime, also called the Missing Trader
IntraCommunity crime (MTIC). It is a sophisticated international fraud exploiting Value
Added Tax (VAT) evasion, in order to create large amounts of unpaid VAT liabilities
and VAT repayment claims connected with them. More information can be found on
the demo site [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ] and in [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ].
      </p>
      <p>Figure 2 depicts a graphical representation of the rule presented on the next page
(where letters are used as shortcuts: s – subject, p – predicate, o – object).
(defrule VATFraudsterRule
?f &lt;- (triple (s ?Z) (p "Object Type") (o "GBOrganization"))
(triple (s ?TaxObligation) (p "Object Type") (o "MoneyTransfer"))
(triple (s ?TaxObligation) (p "property-Transfer Type") (o "Taxobligation"))
(triple (s ?TaxObligation) (p "property-goodsItemCode") (o ?good1))
(triple (s ?TaxObligation) (p "relation-Of Company") (o ?Z))
(triple (s ?TaxObligation) (p "property-Value") (o ?oblgval))
(triple (s ?TaxPaid) (p "Object Type") (o "MoneyTransfer"))
(triple (s ?TaxPaid) (p "property-Transfer Type") (o "Taxpayment"))
(triple (s ?TaxPaid) (p "property-goodsItemCode") (o ?good1))
(triple (s ?TaxPaid) (p "relation-by Company") (o ?Z))
(triple (s ?TaxPaid) (p "property-Value") (o ?paidval))
(test (&gt; ?oblgval ?paidval))
(test (neq ?TaxObligation ?TaxPaid))
=&gt;
(modify ?f (object "VATFraudster")))</p>
      <p>This rule modifies the icon of the company which pays obligatory tax, less than it
should be. As a result, this company is called a VAT fraudster. Unfortunately, the
Palantir Government tool limits objects to one type (some additional types can be
deduced only by an engineer according to the given Palantir Dynamic Ontology).</p>
      <p>LHS</p>
      <p>RHS
rules for the Jess engine. The tool integrates data and rules in the Palantir Government
tool. Graph-based representation is convenient and intuitive for an untrained analysts.
Such tool can be used in many domains where rules and graphs can be employed to
support a user in her/his work.</p>
      <p>
        Because of copyright issues connected with the Palantir Government application,
we provide only the presentation which contains screenshots of executing the example
concerning an analysis of a real-world criminal case. The presentation with a more
detailed description is available on the demo site [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ].
      </p>
      <p>Acknowledgement. This work was supported by DS-MK 45-102/12 and
45085/11 DS-PB grants.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>1. Palantir Government Platform, http://palantir.com/government</mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2. Palantir Dynamic Ontology, https://wiki.palantir.com/pgdz/palantir
          <article-title>-dynamic-ontology-properties</article-title>
          .html
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <surname>Jess (Java Expert System Shell</surname>
          </string-name>
          ), http://jessrules.com/
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>Forgy</surname>
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Rete</surname>
          </string-name>
          :
          <article-title>A Fast Algorithm for the Many Pattern/Many Object Pattern Match Problem</article-title>
          ,
          <source>Artificial Intelligence</source>
          ,
          <volume>19</volume>
          , pp.
          <fpage>17</fpage>
          -
          <lpage>37</lpage>
          ,
          <year>1982</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <given-names>Object</given-names>
            <surname>Constraint</surname>
          </string-name>
          <article-title>Language (OCL)</article-title>
          ,
          <year>v2</year>
          .0. http://www.omg.org/spec/OCL/2.0/
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          <article-title>6. UML-based Rule Modelling Language</article-title>
          , http://oxygen.informatik.tu-cottbus.de/rewerse-i1/?q=URML
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Halpin</surname>
            <given-names>T.</given-names>
          </string-name>
          :
          <article-title>Object-Role Modeling: an overview</article-title>
          ,
          <year>2001</year>
          , http://www.orm.net/pdf/ORMwhitePaper.pdf
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Lukichev</surname>
            <given-names>S.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jarrar</surname>
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Graphical Notations for Rule Modeling</article-title>
          . In: A.
          <string-name>
            <surname>Giurca</surname>
            ,
            <given-names>D.</given-names>
          </string-name>
          <string-name>
            <surname>Gasevic</surname>
          </string-name>
          ,
          <article-title>and</article-title>
          K. Taveter (Eds),
          <source>Handbook of Research on Emerging Rule-based Languages and Technologies: Open Solutions and Approaches</source>
          , IGI Publishing,
          <year>2009</year>
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>9. Semantics of Business Vocabulary and Business Rules, http://www.omg.org/spec/SBVR/1.0/</mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Grzegorz J. Nalepa</surname>
            , Antoni Ligęza, and
            <given-names>Krzysztof</given-names>
          </string-name>
          <string-name>
            <surname>Kaczor</surname>
          </string-name>
          .
          <year>2011</year>
          .
          <article-title>Overview of knowledge formalization with XTT2 rules</article-title>
          .
          <source>In Proceedings of the 5th international conference on Rule-based reasoning</source>
          , programming, and applications (RuleML'
          <year>2011</year>
          ), Nick Bassiliades, Guido Governatori, and Adrian Paschke (Eds.). Springer-Verlag, Berlin, Heidelberg,
          <fpage>329</fpage>
          -
          <lpage>336</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          11. Visual Rules, http://www.visual
          <article-title>-rules.com/business-rules-management-software-rules-engine</article-title>
          .html
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>12. Drools Guvnor Rules Authoring, http://docs.jboss.org/drools/release/5.4.0.Final/drools-guvnor-docs/html/ch04.html</mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>13. VisiRule, http://www.lpa.co.uk/vsr.htm</mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>14. OntoStudio Graphical Rule Editor, http://ontorule-project.eu/showcase/OntoStudio_Graphical_Rule_Editor</mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          15.
          <string-name>
            <surname>Michael</surname>
            <given-names>Kifer</given-names>
          </string-name>
          , Georg Lausen, and
          <string-name>
            <given-names>James</given-names>
            <surname>Wu</surname>
          </string-name>
          .
          <article-title>Logical foundations of object oriented and frame-based languages</article-title>
          .
          <source>J. ACM</source>
          ,
          <volume>42</volume>
          (
          <issue>4</issue>
          ):
          <fpage>741</fpage>
          -
          <lpage>843</lpage>
          ,
          <year>1995</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          16.
          <string-name>
            <surname>Bak</surname>
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jedrzejek</surname>
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Falkowski</surname>
            <given-names>M.:</given-names>
          </string-name>
          <article-title>Usage of the Jess Engine, Rules and Ontology to Query a Relational Database</article-title>
          .
          <source>In Proceedings of the 2009 International Symposium on Rule Interchange and Applications (RuleML '09)</source>
          , Guido Governatori, John Hall, and Adrian Paschke (Eds.). Springer-Verlag, Berlin, Heidelberg,
          <fpage>216</fpage>
          -
          <lpage>230</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>17. Demo site: http://draco.kari.put.poznan.pl/ruleml2012/</mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          18.
          <string-name>
            <surname>Jedrzejek</surname>
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bak</surname>
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Falkowski</surname>
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Cybulka</surname>
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Nowak</surname>
            <given-names>M.</given-names>
          </string-name>
          ,
          <article-title>On the Detection and Analysis of VAT Carousel Crime</article-title>
          ,
          <source>in: Frontiers in Artificial Intelligence Applications</source>
          , vol.
          <volume>235</volume>
          ,
          <source>Proceedings of JURIX 2011: The Twenty-Fourth Annual Conference Legal Knowledge and Information Systems</source>
          , pp.
          <fpage>130</fpage>
          -
          <lpage>134</lpage>
          , IOS Press,
          <year>2011</year>
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          19.
          <string-name>
            <surname>Nowak</surname>
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Jedrzejek</surname>
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Bak</surname>
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Szwabe</surname>
            <given-names>A.</given-names>
          </string-name>
          ,
          <article-title>A rule-based expert system for building evidence in VAT-carousel</article-title>
          ,
          <source>Proceedings MISSI'12</source>
          , Multimedia and
          <string-name>
            <given-names>Internet</given-names>
            <surname>Systems</surname>
          </string-name>
          : New Solutions, in print.
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>