Using SRL language in PDL queries

PolyAnalyst supports two query languages which are designed to operate on different column types:

  1. PDL is used to work with text columns.

  2. SRL is used to work with non-text columns (e.g. String, Number or DateTime columns).

SRL and PDL expressions can be combined in a single mixed query with the help of OR, AND, NOT, AND NOT, XOR operators. Mixed queries are used to specify a number of search conditions to search in multiple columns of different types.

There are special formatting rules used in mixed queries.

PDL is a default query language for the nodes that are designed to work with text columns, e.g. Search Query or Taxonomy. In order to use mixed queries in such nodes, users have to enclose the SRL part of the query in % symbols (%SRL-expression%).

SRL is a default query language for the nodes that are designed to work with non-text columns, e.g. Filter Rows or Derive. In order to use mixed queries in such nodes, users have to enclose PDL expressions in single quotes and specify the column to search in after the @ symbol ('PDL-expression@[ColumnName]').

Task example: Car complaint analysis

Consider the task of analyzing car complaints. Let us imagine that there is a dataset with three columns: Description, Manufacturer, and Model Year:

pdl mixed 1

Suppose one is interested in defects of air bags. To search for all air bag defects, a simple PDL query would work:

pdl mixed 2

However, in order to search for air bag defects related to a particular vehicle manufacturer, one has to use a mixed query:

pdl mixed 3

The query matches documents which have the Manufacturer column set to 'MANUFACTURER1' and contain the phrase "air bag" in the Description column. The query consists of two parts:

  1. "air bag" is the PDL part

  2. %[Manufacturer] = "Manufacturer1"% is the SRL part

As the Search Query Node operates on text columns and thus uses PDL by default, the SRL part of the query is enclosed in % symbols.

This query can be expanded further, for example, it is possible to search for air bag defects related to MANUFACTURER1’s 2015 models:

pdl mixed 4

It should be noted, that the same query looks different in the nodes which use SRL by default, such as Filter Rows. In this case users have to enclose the PDL part of the query in ' symbols and specify the column to search in:

pdl mixed 5