<!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>Process Querying in Apromore</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Artem Polyvyanyy</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Luigi Corno</string-name>
          <email>cornoluigi1989@gmail.com</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Raffaele Conforti</string-name>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Simon Raboczi</string-name>
          <email>raboczi@gmail.com</email>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Marcello La Rosa</string-name>
          <email>m.larosag@qut.edu.au</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Giancarlo Fortino</string-name>
          <email>giancarlo.fortino@unical.it</email>
          <xref ref-type="aff" rid="aff2">2</xref>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>NICTA Queensland Lab</institution>
          ,
          <addr-line>Brisbane</addr-line>
          ,
          <country country="AU">Australia</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>Queensland University of Technology</institution>
          ,
          <addr-line>Brisbane</addr-line>
          ,
          <country country="AU">Australia</country>
        </aff>
        <aff id="aff2">
          <label>2</label>
          <institution>University of Calabria</institution>
          ,
          <addr-line>Cosenza</addr-line>
          ,
          <country country="IT">Italy</country>
        </aff>
      </contrib-group>
      <abstract>
        <p>This paper demonstrates the integration and usage of Process Query Language (PQL), a special-purpose programming language for querying large collections of process models based on process model behavior, in the Apromore open-source process model repository. The resulting environment provides a unique user experience when carrying out process model querying tasks. The tool is useful for researchers and practitioners working with large process model collections, and specifically for those with an interest in model retrieval tasks as part of process compliance, process redesign and process standardization initiatives.</p>
      </abstract>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1 Introduction</title>
      <p>
        Process querying addresses the problem of automatically retrieving process models from
collections thereof on the basis of user-defined queries. Process querying can be used to
tackle problems of process compliance, reuse, redesign, and standardization [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ].
      </p>
      <p>
        In this paper, we demonstrate a process querying environment that resulted from
integrating Process Query Language (PQL) [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] into the Apromore process model
repository [
        <xref ref-type="bibr" rid="ref3">3</xref>
        ]. PQL is a programming language based upon temporal logic with an intuitive
SQL-like syntax for the specification of queries. The semantics of PQL queries is
grounded in process model behavior. The intent of a PQL query is to retrieve process
models from a collection of models based on the arrangements of activities and/or events
in the process instances that these models describe. A screencast that demonstrates the
environment is available at https://youtu.be/S_U6frTWd3M.
      </p>
      <p>In the remainder of this paper, we provide an overview of PQL and its implementation,
present the Apromore process model repository, discuss the integration of PQL into
Apromore, and demonstrate the use of PQL in Apromore using a typical process querying
scenario in the context of a process model collection taken from industry.
This section discusses PQL (Section 2.1) and its integration into Apromore (Section 2.2).
2.1
PQL is a special-purpose programming language for managing collections of process
models based on information about process instances that these models describe. PQL
Copyright ©2015 for this paper by its authors.</p>
      <p>Copying permitted for private and academic purposes.
programs are called queries. PQL is a declarative language that is based upon temporal
logic. Temporal logic is an extension of traditional propositional logic with operators that
refer to the behavior of systems over time. These behavioral operators, called predicates
in PQL, provide PQL with a mathematically precise means for expressing properties
about the relation between activities and events in process instances.</p>
      <p>
        The abstract syntax of PQL is an extended version of the abstract syntax of “A
Processmodel Query Language” (APQL) [
        <xref ref-type="bibr" rid="ref4">4</xref>
        ]. PQL introduces its own semantics which is based
on the behavioral relations of the 4C spectrum and the label unification principle for
disambiguation of activity and event names/labels [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. The 4C spectrum systematizes four
fundamental relations that are commonly used to describe the behavior of concurrent
systems: co-occurrence, conflict, causality, and concurrency. The systematization is
performed by quantifying and, thus, measuring occurrences of activities and events in
process instances. The choice of the 4C relations to be included in the first edition of
the PQL language is due to the results of interviews with process analysts. The reader is
referred to [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ] for a detailed discussion on the design of the PQL language.
      </p>
      <p>
        The concrete syntax of PQL is inspired by SQL—a programming language for
managing data stored in relational database management systems [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ]. The rationale behind
this design decision is threefold: (i) PQL and SQL serve the same overarching purpose—
retrieval of information. (ii) SQL is a widely used standard that is well-recognized by
technical specialists. (iii) Finally, the SQL syntax was often recommended for PQL by
the interviewed process analysts [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ].
      </p>
      <p>The PQL language is implemented in the PQL tool, which is publicly available under
the open-source GNU Lesser General Public License.1</p>
      <p>
        To give the reader a better taste of PQL, below we provide two compliance rules taken
from Table 10.3 in [
        <xref ref-type="bibr" rid="ref7">7</xref>
        ] and the corresponding PQL queries that formulate search intents
to retrieve all process models that violate these rules.
c1. Before goods can be produced, components have to be bought.
      </p>
      <sec id="sec-1-1">
        <title>SELECT * FROM * WHERE</title>
        <p>CanOccur("produce goods") AND
(CanConflict ("produce goods","buy components") OR NOT
TotalCausal ("buy components","produce goods"));
c2. If an order is confirmed, it must have been received and processed before. Furthermore, once
confirmed an order must not be declined afterwards. Conversely, for a declined order no
confirmation is possible any longer.
x = f"receive order","process order"g;</p>
      </sec>
      <sec id="sec-1-2">
        <title>SELECT * FROM * WHERE</title>
        <p>(CanOccur("confirm order") AND
(CanConflict ("confirm order",x,ALL)
OR NOT TotalCausal (x,"confirm order",ALL)))</p>
        <p>
          OR CanCooccur("confirm order","decline order");
The execution speed of PQL queries can be improved by the use of indexes—special data
structures that can improve the speed of computations of behavioral relations at the cost
of time for their construction and space for their storage [
          <xref ref-type="bibr" rid="ref1">1</xref>
          ]. The PQL tool uses model
checking techniques to index behavioral relations. These are automated techniques that
given a finite-state model of a system (e.g., a process model) and a formal property (e.g.,
        </p>
        <sec id="sec-1-2-1">
          <title>1 https://github.com/processquerying/PQL.git</title>
          <p>
            a temporal logic formula) systematically check whether this property holds for (a given
state in) the model [
            <xref ref-type="bibr" rid="ref8">8</xref>
            ].
2.2
          </p>
          <p>
            PQL in Apromore
Apromore is an open-source process model repository [
            <xref ref-type="bibr" rid="ref3">3</xref>
            ]. Its source code is available
under the GNU Lesser General Public License.2 Its public version can be accessed at
http://apromore.qut.edu.au. Apromore’s basic features include model import and
export, version control and modeling support for a variety of languages, e.g., BPMN,
eEPC, YAWL, and Petri nets. In addition, Apromore provides a range of advanced
features, e.g., identification of similar process models on the basis of their structural
characteristics, merging similar process models into a consolidated model, and
comparison of process models on the basis of their behavior. Apromore uses the latest Java J2EE
technology, including Spring, OSGi, ZK and Maven.
          </p>
          <p>The integration of PQL into Apromore was carried out in two phases. The first phase
focused on embedding PQL into Apromore. As a result, PQL can access all models in
the Apromore repository and detect the creation, modification, and deletion of models
in order to update its index of behavioral relations. The second phase covered the
implementation of a GUI for specifying and issuing queries. This GUI offers a set of
features aimed at improving the user experience during the creation of queries. Two
features worth mentioning are (i) autocompletion capable of suggesting standard PQL
keywords, like SELECT, AND, ANY, or TotalConcurrent , and candidate activity/event
names, and (ii) drag-and-drop for selecting process models and repository folders to
be considered as part of the FROM section of a PQL query; for example, “SELECT id,
author FROM "./myModels";” query requests to find identifiers and authors of all
process models in the "./myModels" folder of the repository.
3</p>
        </sec>
      </sec>
    </sec>
    <sec id="sec-2">
      <title>Process Querying Scenario</title>
      <p>
        In this section, we demonstrate a process querying scenario of retrieving models that
satisfy a given PQL query. The retrieval is performed over a process model repository
taken from industry, viz. the SAP Reference Model [
        <xref ref-type="bibr" rid="ref9">9</xref>
        ].
      </p>
      <p>Every (version of) process model in Apromore gets indexed by the PQL tool. On
average, it takes 51 seconds to index a model from the SAP Reference Model.3 Once a
model is indexed, it can be retrieved as a response to a PQL query.</p>
      <p>Process querying in Apromore starts by a user specifying a PQL query. This can be
accomplished using the PQL query editor. One can invoke the editor by selecting the
“PQL filter” option in the menu of the Apromore’s repository view. A screenshot of the
PQL query editor is shown in Fig. 1(a). The editor contains a text field for entering
variable names and values, i.e., symbolic names as well as sets of activities associated
with these names to be used in PQL macros (see query c2 in Section 2.1), a text field
for entering PQL queries, the folder tree view control for selecting repository folders
and/or (versions of) process models to be used in the FROM section of a PQL query, the</p>
      <sec id="sec-2-1">
        <title>2 https://github.com/apromore/ApromoreCode.git</title>
        <p>3 The experiments on indexing times were performed on a laptop with Intel Core i7-3667U CPU
2.00GHz, 8GB of memory, running Windows 7 and Sun JVM 1.7.</p>
        <p>EPC
PQL syntax error notification box, menu items to call the routines for loading/saving
PQL queries from/to files, a text field for specifying names of PQL queries, etc.</p>
        <p>After entering a PQL query, pressing the “Ok” button, and passing the syntax check,
the PQL tool matches the query against the models specified in its FROM section. Once the
matching step is finished, the retrieved models, i.e., those process models that describe
instances that satisfy the WHERE clause of the query, get listed in a fresh tab of the
Apromore’s repository view, cf. Fig. 1(b). Consider the query given below.</p>
        <sec id="sec-2-1-1">
          <title>SELECT * FROM * WHERE TotalCausal (L,J);</title>
          <p>This query retrieves one model (listed in Fig. 1(b) and shown in Fig. 1(d)) from the SAP
Reference Model.4 The TotalCausal (L,J) predicate requests to retrieve all process
models where for every instance in which tasks L and J both occur, it holds that every
occurrence of task L precedes every occurrence of task J. Indeed, this property holds for
the model in Fig. 1(d), cf. EPC function L and EPC event J highlighted with dark grey
background in the figure. Note that the above query does not require tasks L and J to
co-occur in every instance of a matching model. Consider the next query.</p>
        </sec>
        <sec id="sec-2-1-2">
          <title>SELECT * FROM * WHERE TotalCausal (L,J) AND Cooccur(L,J);</title>
          <p>4 Note the use of short task names in Fig. 1; full names are given in the caption of the figure.
In this query, the Cooccur(L,J) predicate additionally requests to retrieve only those
models where it holds that if task L occurs in some instance then task J occurs in the
same instance, and vice versa. Clearly, the above query retrieves no models.</p>
          <p>Process model repositories often suffer from inconsistent usage of names/labels.
Semantically similar tasks may ‘wear’ syntactically different names. For these situations,
the PQL tool supports semantic name disambiguation.</p>
          <p>
            SELECT * FROM * WHERE TotalCausal (∼X,J) AND Cooccur(∼X,J);
Let the short label X in the above query refer to the full name “Delegation of requirement
for planning”. Note that this name is not used in any process model of the SAP Reference
Model. The tilde symbol (“∼”) in the query suggests that in place of X the PQL tool can
use other labels that are similar with X (up to the predefined similarity threshold); refer
to [
            <xref ref-type="bibr" rid="ref10">10</xref>
            ] for a technique on discovery of similar activity labels. Based on the Levenshtein
distance between two sequences of characters (one can configure the PQL tool to use
other metrics for string similarity), the PQL tool suggests labels C (highlighted with light
grey background in Fig. 1(d)) and L as being similar to X. Consequently, the tool treats
labels C and L as one label. This allows the tool to retrieve the model in Fig. 1(d) again
as a response to the last mentioned PQL query. Indeed, J always co-occurs either with C
or L, and C and L together are in the total causal relation with J. The above described
effect is implemented using the label unification principle proposed in [
            <xref ref-type="bibr" rid="ref5">5</xref>
            ].
          </p>
          <p>Finally, the user can review information on every issued PQL query using the PQL
query information box. The information box can be invoked by double-clicking the info
icon next to the title of the query result tab in the Apromore’s repository view. The PQL
query information box contains the PQL query, information on all the names/labels used
in the query, and all the discovered similar labels, as shown in Fig. 1(c).</p>
        </sec>
      </sec>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          1.
          <string-name>
            <surname>Polyvyanyy</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>La</surname>
            <given-names>Rosa</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>ter Hofstede</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.H.M.</surname>
          </string-name>
          :
          <article-title>Indexing and efficient instance-based retrieval of process models using untanglings</article-title>
          .
          <source>In:CAiSE</source>
          .Vol.
          <volume>8484</volume>
          of LNCS., Springer (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          2.
          <string-name>
            <surname>Polyvyanyy</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>ter Hofstede</surname>
            ,
            <given-names>A.H.M.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>La</given-names>
            <surname>Rosa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Ouyang</surname>
          </string-name>
          ,
          <string-name>
            <surname>C.</surname>
          </string-name>
          :
          <article-title>Process Query Language: Design, implementation and evaluation</article-title>
          .
          <source>BPM Center Report BPM-15-06</source>
          ,BPMcenter.org (
          <year>2015</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          3.
          <string-name>
            <given-names>La</given-names>
            <surname>Rosa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Reijers</surname>
          </string-name>
          ,H.A.,
          <string-name>
            <surname>van der Aalst</surname>
            ,
            <given-names>W.M.P.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dijkman</surname>
            ,
            <given-names>R.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Mendling</surname>
            ,
            <given-names>J.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Dumas</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Garc´</surname>
          </string-name>
          ıa-Ban˜uelos,L.:
          <article-title>APROMORE:An advanced process model repository</article-title>
          .
          <source>ESWA38(6)</source>
          (
          <year>2011</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          4.
          <string-name>
            <surname>ter Hofstede</surname>
            ,
            <given-names>A.H.M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Ouyang</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>La</surname>
            <given-names>Rosa</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>Song</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            ,
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            ,
            <surname>Polyvyanyy</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.</surname>
          </string-name>
          :
          <article-title>APQL: A process-model query language</article-title>
          .
          <source>In: AP-BPM</source>
          . Vol.
          <volume>159</volume>
          of LNCS., Springer (
          <year>2013</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          5.
          <string-name>
            <surname>Polyvyanyy</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weidlich</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Conforti</surname>
            ,
            <given-names>R.</given-names>
          </string-name>
          ,
          <string-name>
            <given-names>La</given-names>
            <surname>Rosa</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            ,
            <surname>ter Hofstede</surname>
          </string-name>
          ,
          <string-name>
            <surname>A.H.M.:</surname>
          </string-name>
          <article-title>The 4C spectrum of fundamental behavioral relations for concurrent systems</article-title>
          .
          <source>In: PETRI NETS</source>
          . Vol.
          <volume>8489</volume>
          of LNCS., Springer (
          <year>2014</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          6.
          <string-name>
            <surname>Date</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Darwen</surname>
          </string-name>
          , H.:
          <article-title>A Guide to the SQL Standard: A User's Guide to the Standard Database Language SQL</article-title>
          .
          <string-name>
            <surname>Addison-Wesley</surname>
          </string-name>
          (
          <year>1997</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          7.
          <string-name>
            <surname>Reichert</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weber</surname>
            ,
            <given-names>B.</given-names>
          </string-name>
          :
          <article-title>Enabling Flexibility in Process-Aware Information Systems</article-title>
          : Challenges, Methods, Technologies. Springer (
          <year>2012</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          8.
          <string-name>
            <surname>Baier</surname>
            ,
            <given-names>C.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Katoen</surname>
          </string-name>
          , J.:
          <article-title>Principles of Model Checking</article-title>
          . MIT Press (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          9.
          <string-name>
            <surname>Curran</surname>
            ,
            <given-names>T.</given-names>
          </string-name>
          , Keller, G.,
          <string-name>
            <surname>Ladd</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          :
          <article-title>SAP R/3 Business Blueprint: Understanding the Business Process Reference Model</article-title>
          . Prentice-Hall, Inc., Upper Saddle River, NJ, USA (
          <year>1998</year>
          )
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          10.
          <string-name>
            <surname>Awad</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Polyvyanyy</surname>
            ,
            <given-names>A.</given-names>
          </string-name>
          ,
          <string-name>
            <surname>Weske</surname>
            ,
            <given-names>M.</given-names>
          </string-name>
          :
          <article-title>Semantic querying of business process models</article-title>
          .
          <source>In: EDOC, IEEE Computer Society</source>
          (
          <year>2008</year>
          )
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>