The "Queries" page can be opened via the Application Menu (top right corner).
The main purpose of the "Queries" page is to search for graph elements or patterns and visualize them.
Queries page elements
Queries are used to organize and save search queries for repeated use. For example, if your domain is Configuration Management then you can create separate queries for Services, Applications, Servers and Racks.
All queries are organized into two groups:
My Queries - these queries are visible only to the logged-in user. Every user can create and organize his queries in this group.
Project Queries - these queries are available to all users in the project. Only users with the "Project Settings" permission can manage these queries, other users can run the queries, or copy them to their "My Queries" group.
Add new query
A new query can be created with the "Add" button which shows all available types of queries that can be added. A new query is created in the user's "My Queries" group.
Query Builder Panel
Query Builder panel contains all configuration options for the selected query. Any change in the query configuration is saved after the "Run Query" button is clicked.
Query configuration is specific depending on the type of the query:
Node Filter: configuration of the condition and columns in the Query Result.
Cypher/Gremlin: input for the custom query.
Template: textual representation of the Template query and dynamic parameters of the Template.
Query Result Panel
The Query Result panel contains all data returned by the query which can be used to create a new visualization or can be added to the currently opened visualization. The result is shown in different ways depending on the type of the Query. See the next chapters for more details.
There are several types of queries that can be created:
Node Filter Query: this type of search query is used for fulltext searching for nodes. The Query Builder for this type of query allows filtering of nodes based on labels or property values. Found nodes are presented in a table in the Query Results panel with configurable columns and sorting. Rows representing nodes can be selected and visualized in a graph or exported in CSV format (can be opened in MS Excel).
Cypher/Gremlin Query: this type of query lets the user enter any Cypher or Gremlin query (based on the connected graph DB). Based on the user's permissions only ready queries can be executed or any query, if the user has the "Read all data" permission. The Result Panel for this type of query shows basic statistical information about the returned elements and allows to visualize the result.
Query Template: template is a custom Cypher/Gremlin query presented to the user as a form with dynamic parameters (with suggestions) that the user can use to change and use the query without any Cypher/Gremlin knowledge. The Result Panel for this type of query shows basic statistical information about the returned elements and allows to visualize the result.
Node Filter query
With this type of query the user can
construct a simple condition for filtering nodes,
combine it with the fulltext search term (searching in indexed properties),
specify columns of the results table (every column is one property of the found nodes).
The condition consists of sub-conditions on labels and/or properties. Multiple properties can be added and for every property, multiple values can be specified. In order for a node to pass the condition it has to have at least one of the specified labels (OR between labels) and for every specified property (AND between properties) at least one of the values (OR between property values). For the setting in the picture above the condition can be read as follows: Return the properties (specified as columns) of all nodes with the label ("Database" OR "Application Component") AND with the property "Problem Priority" set to ("2 - High" OR "1 - Critical" OR "3 - Medium").
The resulting table has columns in the order as specified in the columns picker. If you want to reorder columns in the table you can do it by reordering the values (drag&drop) in the columns picker.
The Query Result panel contains all data that meet the combined search criteria defined by the fulltext search and the condition in the Query Builder.
The header of the Result table includes:
Button Visualize - start new visualization for selected elements. See Visualization.
Button Add To Opened Visualization - add selected elements to the currently opened visualization (the name of the visualization is in the left top corner). See Visualization.
Search field - full-text search input:
Fulltext search runs only within the data defined by the queries query condition in the Query Builder.
If the search is configured to work automatically, the searching starts automatically every time the text in the Search field is changed (can be configured, see Graph Connections#FulltextSearchConfiguration).
If the search is configured to work manually, press "Enter" to start a fulltext search with the current input in the Search field.
Which properties can be searched is configured in Graph Connections#FulltextSearchConfiguration.
Both settings, Search mode and Node fulltext index can also be configured directly on the Search page with the Search Settings button.
CSV export - exports result in CSV format (can be opened in Microsoft Excel or other CSV editing tools). Exported columns, column names and the maximal number of exported rows can be configured (see Export).
Nodes in the table can be selected:
To select 1 element: click on the record.
To select more elements: hold CTRL and click on several records.
To select more consecutive elements: click on the first record, then hold SHIFT and click on the last record - every record between the first and the last record will be selected.
Selected nodes can be used to start a new visualization, or can be added to the currently opened visualization, or can be exported. Export options can be configured (see CSV export).
The table contains only some properties of nodes (selected in Query Builder). To view all properties press the "Details" icon on the right side of the record. Tabs of the detail panel can be configured (see Data Schema).
If there are too many columns in the result table, some of them are automatically hidden (the table is responsive). Press the "+" icon on the left side of a row to show the hidden properties.
The sorting of any column can be changed by pressing the arrow next to the column title.
With this type of query, the user can execute Cypher or Gremlin queries (based on the type of the graph DB in the project) and start a new visualization with the query result as a starting point for the visualization.
Read queries are available for all users.
Write queries are available for users with the "Data management" permissions.
Fulltext search and CSV export are not available in combination with Cypher/Gremlin queries.
you can export nodes or relationships as a CSV file in the visualization - just click "New visualization" and then export the data
The result of the Cypher query is summarized in the Query Result panel. The counts of the different record types are displayed, and simple data distribution tables for node labels and relationship types are available. If there is at least one node, relationship or a path in the result then the "Visualize" and "Add To Opened Visualization" buttons are enabled.
Custom Cypher/Gremlin query presented to the user in a human-readable form with dynamic parameters (with suggestions) that the user can use to change and use the query without any Cypher knowledge.
The query template can be edited using the "Edit Template" button (available only to users with the "Settings" permission. See Query Templates for more information.
The result of the Template query is summarized in the Query Result panel. The counts of the different record types are displayed, and simple data distribution tables for node labels and relationship types are available. If there is at least one node, relationship or a path in the result then the "Visualize" and "Add To Opened Visualization" buttons are enabled.