Required Permission: Project Settings management (Read more about permissions in User Groups)

Table of Contents


The Queries setting is used to store the project's queries. There are several types of queries that can be defined with this setting (read more about queries on the Queries page):

  • Node Filter query
    • This type of query allows users to search for nodes using a simple condition builder and fulltext search. Any property or node labels (_dbLabels) can be displayed as columns in the result table. The user can define a simple condition to filter nodes and combine it with the fulltext search to find specific nodes. Selected nodes from the result can be visualized (used in a new visualization or added to the last opened visualization).
    • Query definition consists of "title", "description", "columns", and "condition" (optional) - see Explanation of JSON properties below.
  • Cypher/Gremlin query
    • This type of query allows users to enter any Cypher or Gremlin query (based on the user's permissions only read queries can be executed or any query if the user has the All Data permission).
    • Query definition consists of "title", "description", and "cypher"/"gremlin" - see Explanation of JSON properties below.
  • Query Template
    • A Query Template is a custom Cypher/Gremlin query presented to the user as a form with dynamic parameters (with suggestions) that the user can set in the UI and run 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.

Configuration

  1. In the "Application Menu" (top right) choose page "Project Settings"
  2. In the "Project Settings" panel click on the "Queries" row.
  3. Enter JSON configuration and confirm by pressing the "Save" button.

Description of configuration

The configuration is entered in JSON format. Example:

[
{
"title":"Nodes in a table",
"description":"Persons and Companies of some subtype",
"condition":{
"labels":[ "Person", "Company" ],
"properties":[
{
"property":"type",
"values":[ "person", "company" ]
},
{
"property":"subtype",
"values":[ "auditor", "manager", "limited" ]
}
]
},
"columns":[
{
"property":"title"
},
{
"property":"type"
}
]
},
{
"title":"Cypher query",
"description":"Returns the first 100 nodes.",
"cypher":"MATCH (n) RETURN n LIMIT 100"
},
{
"title":"SomeRelType Pattern",
"description":"This pattern looks for all relationships of a particular type starting in nodes of some specific type. Max number of returned relationships is 100.",
"template":{
"textTemplate" : "Get all nodes related to nodes of type $type_list with relationship type $rel_type . Max number of returned nodes is 100",
"cypherTemplate" : "MATCH (a:SomeLabel)-[r:$rel_type]->(b) WHERE a.type IN $type_list RETURN r LIMIT 100",
"parameters" : [
{
"parameter" : "type_list",
"type" : "NODE_PROPERTY_VALUES",
"config" : {
"multiple" : true,
"labels" : ["SomeLabel"],
"property" : "type"
}
},
{
"parameter" : "rel_type",
"type" : "REL_TYPES",
"config" : {
"multiple" : false
}
}
]
}
}
]

Explanation of JSON properties:

Property

Values

Query type support

Description

title

mandatory

String

All query types

Title of the query.

description

String

All query types

Description of the query.

cypher

String

Cypher query

Cypher query defining the output of this query object.

gremlin

String

Gremlin query

Gremlin query defining the output of this query object.

template

Object

Query template

Cypher query Template object. Please refer to Query Templates for more information and examples.

condition

Object

Node Filter query

Condition for filtering nodes listed in the result table. Always use it together with columns.

condition.properties

null, undefined, Array of SFO objects

Node Filter query

An array of filter criteria. Defined criteria will be used in the search and only elements which match these criteria will be shown in the results. If not defined, set to null, or set to an empty array then no filtering is applied for this query. Each criterion is defined by SFO (Search Filter Object).

Logical "AND" is between each criteria in properties and logical "OR" is between items in values. Final condition based on properties can be for example: "type"="person" AND ("subtype"="auditor" OR "subtype"="manager").

SFO.property

mandatory

String

Node Filter query

Name of the DB property to filter on. This property has to be indexed, which means it has to be set in properties of Node Index configuration or Relationship Index configuration. See the fulltext index configuration here - Graph Connections#FulltextSearchConfiguration.

SFO.values

mandatory

Array of strings/numbers/booleans

Node Filter query

List of values of the DB property which are matched in the search filter. The exact string/number/boolean value is matched.

condition.labels

Array of strings

Node Filter query

Defines search criteria for node DB labels. Logical "OR" is used - a node passes the filter if it has at least one of the listed labels.

columns

mandatory

Array of CDO objects

Node Filter query

An array of column definitions used in the search results table. Each column is defined by CDO (Column Definition Object) which holds primarily the DB property name. Other metadata is used from Data Schema (e.g. title).

CDO.property

mandatory

String

Node Filter query

Name of the DB property used in the defined column. Values of this DB property will be listed as cell values in the result table column.