Run Aggregated Queries

This topic explains how to run aggregated queries and view their results. This feature allows you to view grouped results from several data sources, filtered by the information you want to view. For example, through an aggregated query, a police officer can access the data sources of the Motor Vehicle Registration Division and the New York Police Department, and enter the name of a person in one of the query filters. The results will display any registered incidents associated with that person's license and criminal record. In other words, an aggregated query allows queries to one or more data sources to be executed through a single interface (in this case, the Integration module).

To register an aggregated query, the queries to be used as data sources must first be registered in the system. This includes REST queries using the HTTP method, created in the Manage Queries section of this module, which can retrieve information from any database accessible via API.

Once registered, the queries to be used must be configured in the "\App_Data\IntegratedQueriesConfig.xml" XML file, available in the installation folder for the system. Note that REST queries that are configured in the XML file, but are not correctly configured in the system, will be displayed together with their filters in the aggregated queries list when executing the query, however no results will be displayed.

Next, in this same XML file, aggregated queries can be assembled using the previously configured data sources. During this configuration, the input fields to be displayed in the system can be registered. These fields are used as search filters, available to users when executing the query. Validations for these input fields can be configured so that the system can check for errors that would prevent the query from being successfully executed. For details on how to configure and validate input fields for aggregated queries, see Appendix -> Configurations for Aggregated Queries -> Registering Aggregated Queries -> How to Configure Input Fields for an Aggregated Query.

Query results will be displayed in the interface according to a default template that can also be customized in the XML file.

The "\App_Data\IntegratedQueriesConfig.xml" file has the following XML structure:

 

<IntegratedQueriesConfig>

                 <DataSource ID="Individual Query ID">...</DataSource>

                 <IntegratedQuery ID="Aggregated Query ID">...</IntegratedQuery>

</IntegratedQueriesConfig>

 

In this file, two main elements must be configured:

    DataSource: Used to register data sources. This element is contained within a DataSource node and should be registered first. For details on how to configure this node, see Appendix -> Configurations for Aggregated Queries -> Configuring Data Sources for Aggregated Queries.

    IntegratedQuery: Used to register aggregated queries. This element is contained within an IntegratedQuery node and should be configured once all the data sources to be included have been registered. For details on how to configure this node, see Appendix -> Configurations for Aggregated Queries -> Registering Aggregated Queries.

 

Consider the example below:

 

 

In the example above, the aggregated query on the left was configured to query the data sources on the right, which are queries to a police department and the Social Security Administration. Note that each data source requires different input data. Also, note that, in order to query all of the data sources listed, the aggregated query must request all of the required input data.

In addition, aggregated queries can be associated so that, once one is executed, one or more query parameters can be used as search parameters for the associated queries. For example, if a query to view the social security numbers of the employees of an organization was created, and another, separate query was created to view their criminal records (including their SSN), these two queries can be associated so that the user can easily view both of the related items. More than one parameter can also be used in the associated queries, so that if an aggregated query contains data sources with the SSN and the driver’s license of employees and another aggregated query contains information on traffic violations from three different data sources that contain the employees’ SSN, driver’s license, and SSN and driver’s license, respectively, only the results that contain both parameters (SSN and driver’s license) will be displayed. A PDF report can then be generated for each entry from the results, listing all the results from the associated queries that are related to the entry selected. Note that all aggregated queries will be listed, but only results from individual queries of which you are the author or audience member will be available.

Also note that a breadcrumb trail listing the executed queries, according to the execution order, is available at the top of the page so that you can return to previously executed aggregated queries. For details on how to generate reports for aggregated queries, see Chapter 15: Integration -> Aggregated Queries -> Run aggregated Queries -> How to Run an Aggregated Query. For more information on associating aggregated queries, see Appendix -> Configurations for Aggregated Queries -> Registering Aggregated Queries -> How to Associate Aggregated Queries.