Return to User manual

Query with PQL

Authors: Artem Polyvyanyy, Luigi Corno, Raffaele Conforti, Simon Raboczi, Marcello La Rosa, Giancarlo Fortino

This plugin allows querying Apromore’s process model repository based on order relations between process  activities (e.g. find all models where activity “X” always precedes activity “Y”). The language used to define queries is the Process Query Language (PQL). PQL is intuitive as its syntax has been shaped over that of the SQL language for querying relational databases. As an example, the following PQL query can be used to formulate the above search intent:

SELECT * FROM * WHERE TotalCausal(X,Y);

 The full syntax of PQL is available here.

To use this plugin, hit “Analyze>Query with PQL”. This will launch the PQL Editor where the search query can be specified.

queryEditor2

Each query can be given a name using the top text box. The main text area (called “Query”) is used to define the search query. Typing is assisted and context-sensitive (e.g. the tool will highlight query commands like FROM and WHERE and provide suggestions for operators and activity labels which can be used to auto-complete the query). The top text area (called “Variables”) can be used to define variable names and sets of activities associated with these names to be used within the query. The “Folders” view on the left-hand side allows the selection of which folders or models from the Apromore’s repository are to be used for the search. One can drag&drop folders or models onto the query area and they will be used to automatically populate the FROM clause of the query. To avoid cluttering the text area, they will be collapsed through an abbreviation, but they can always be expanded (or collapsed again) by pressing the button “Expand” (“Collapse”). The radio buttons at the bottom of the window can be used to specify which process model versions should be used for the search (all, just the latest, or custom). Finally, the “Log” box is used to notify syntax errors, while the “File” menu can be used to import/export queries.

After entering a PQL query, pressing the “Ok” button, and passing the syntax check, the plugin matches the query against the models specified in the FROM clause. Once the matching step is finished, the retrieved models, i.e., those process models whose instances satisfy the WHERE clause of the query, get listed in a new tab of Apromore’s Portal.

queryResult

One can review information on an issued query using the query information box, which can be accessed by double-clicking the icon next to the title of the query tab in the Portal. This box contains the PQL query, information on all the names/labels used in the query, including a list of labels found in the repository that are similar to those used in the query.

queryExplained

A screencast of this plugin is available here.

Note: this plugin is only available in the full-fledged version of Apromore which uses MySQL instead of the H2 database management system. This is because this plugin relies on stored procedures defined for MySQL.