For Dashboard Designers Reference Query
Friday, November 11, 2022 12:54 PMQuery
Label: :IA_Function
Property: type: Query
Inherits from: Function
Executes any query statement with related query language to selected store's database and returns its results.
Properties
Key | Description | Default value | Possible values |
---|---|---|---|
cypher * |
The Cypher statement that has to be executed. | any valid Cypher statement | |
gremlin * |
The Gremlin statement that has to be executed. | any valid Gremlin statement | |
options.ids |
An array of parameter names that should be treated as IDs (relevant for Gremlin and Sparql). | array of strings | |
options.uuids |
A number of uuids that should be generated and made available as $UUID parameter. Can be used as e.g. $UUID[0] . |
0 | number |
params.{myParameter} |
Parameters that are to be passed to the query statement. | a literal value | |
process |
Determines whether the query result should be processed to a set of nodes and relations. | false | true|false 0|1 |
sparql * |
The Sparql statement that has to be executed. | any valid Sparql statement | |
store |
The graph store against which the related statement is to be executed. | application | name of a configured store |
- Query statements can be run with a 'store dialect' indication,
e.g.
cypher.neo4j
would execute on a Neo4j store, whereascypher.memgraph
would execute on a Memgraph store. - Multiple query statements can be run by providing an object with custom keys, e.g.:
{
"cypher.first": "...",
"cypher.second": "..."
}
The queries will be executed in alphabetical order, and the result will be an object of results, with the same keys.
The two features above can also be combined, e.g.:
{
"cypher.neo4j.first": "...",
"cypher.neo4j.second": "...",
"cypher.memgraph": "..."
}
which would execute 2 queries if executed on Neo4j, and a single query if executed on Memgraph.
Outgoing triggers
Type: success
Occurrence: When the CypherQuery function executes successfully,.
Additional event properties (besides the inherited properties):
Key | Description | Possible values |
---|---|---|
data |
array of data as it is returned by store | array |
meta |
meta information | object |
meta.columns |
array of columns returned in result | array of strings |
meta.cypher |
Cypher statement | string |
meta.sparql |
Sparql statement | string |
meta.gremlin |
Gremlin statement | string |
meta.memory |
memory used in bytes | integer |
meta.nodecount |
count of nodes returned | integer |
meta.params |
parameters and values used in the cypher query | object |
meta.processData |
status of processData flag | integer |
meta.relcount |
count of relations returned | integer |
meta.status |
true if Cypher executed successfully | boolean |
meta.store |
store against which the Cypher was executed | string |
meta.stats |
store query stats | object |
meta.timing |
timing of query in ms | object |
meta.timing.data |
Time to retrieve data from store | integer |
meta.timing.processing |
Time to process data into processed |
integer |
meta.timing.total |
Total time to retrieve and process data | integer |
processed |
data after processing in case process: true |
object |
processed.labels |
all node labels in the results | array of strings |
processed.nodes |
all nodes in the result | array of nodes |
processed.relations |
all relationships in the result | array of relations |
processed.reltypes |
all relation types | array of strings |
processed.private |
number of nodes /relations not being transferred to client | integer |
Permissions (beta)
Besides the permissions inherited from Function, the following permissions can be required:
for: query
Determines: whether or not to execute the Query
Key | Description | Type |
---|---|---|
params |
The parameters to use for the query | object |
store |
The store on which the query will be executed | string |
For: filter
Determines: which rows in the result data to keep
Key | Description | Type |
---|---|---|
data |
The result data from the query | array of objects |
params |
The parameters used for the query | object * |
store |
The store on which the query was executed | string |
* By default, the expression or query will be executed against each row of data
, with an additional parameter row
to determine whether that row should be in- or excluded. Alternatively, batch: true
can be set on the Permission node,
to filter all data in a single query or expression. There will not be a row
parameter, and the result of the query or
expression must be an array with, for each row, an {allow: true/false}
object.
For: flag
Determines: the 'flags' set in the '_permissions' column of the data. Can be used to provide permission states for each item to the frontend. Will not filter any data.
Key | Description | Type |
---|---|---|
data |
The result data from the query | array of objects |
params |
The parameters used for the query | object * |
store |
The store on which the query was executed | string |
* By default, the expression or query will be executed against each row of data
, with an additional parameter row
to determine whether that row should be flagged or not. Alternatively, batch: true
can be set on the Permission node,
to flag all data in a single query or expression. There will not be a row
parameter, and the result of the query or
expression must be an array with, for each row, an {allow: true/false}
object.