The ANALYZE Queries and ANALYZE Query Results views operate in concert and allow you to create, edit, and execute queries as well as to view their results.
Queries are stored in query files and displayed by the ANALYZE Queries view in a tree structure, with each query file at the top level, see the sample screenshot in the introductory section above.
The queries contained in a query file are shown as subordinate nodes of the respective file in the ANALYZE Queries view.
Query files must have the .query filename extension and can be stored anywhere in your workspace. A query file can contain multiple independent queries.
Initially, you don’t have any query files, so the ANALYZE Queries view will be empty.
Please note: Queries have no side effects and will never manipulate any data they are executed on.
You have several options to create a query file:
Both actions will open a file creation wizard asking for name and location of the file.
Creating a query file
After the query file has been created, itemis ANALYZE adds it to the ANALYZE Queries view and opens it in an editor. In this editor, you can formulate your queries, using the ANALYZE query language.
Editing queries
You can add as many queries as you want to a query file, but it is advised to maintain different queries in different files or at least maintain a clear structure, depending on your query’s purpose and semantics.
To open a query file, you have several options:
The query file will be opened in the query editor.
You have the following options to execute a query:
Executing a query
After executing a query, the ANALYZE Query Results view shows the results. Please note that some queries may take considerable time to execute, dependent on their complexity and on the size of your data model. A progress bar will inform you about the status of the query execution.
Each query execution adds a new result tab to the ANALYZE Query Results view. That is, you can execute the same query several times without loosing any results of formerly executed queries. To differentiate query results from each other, each result tab gets an individual name assigned, consisting of the query name and a time stamp.
Inspecting query results
By default, query results are displayed in the ANALYZE Query Results view. However, it is possible to export them to a file, either to an Excel spreadsheet or to a CSV (Comma Separated Values) file. There are several ways to achieve this:
In any case, you will be prompted with a dialog asking for some parameters:
Exporting a query result
Please note: If the Excel document is already open in Excel, itemis ANALYZE may not be able to write the file. In this case, a dialog will ask you to close the file in Excel and retry.
Attributes which are defined in an artifact type, but not mapped by any configuration of the type can be set by
attribute
queries. The query must collect one column named
Artifact with the artifact itself, which should be updated, and one column per attribute which should be updated with the same name as the attribute. Missing attributes or mapped attributes in the configuration are ignored.
Example attribute query:
attribute query "testCoverage"
source (allArtifacts('Requirements (Excel)')).collect (
it as Artifact,
"passed by query result" as testCoverage
)
This Query will update the attribute testCoverage of all Requirements (Excel) to the fixed value „passed by query result”.