Queries: Running and managing queries
Running and Managing Queries
In this section we will learn how to manage, run and optimise the usage of queries in order to save as much time as possible with the use of this feature!
Accessing Queries
All queries which users have access to can be reached from the right toolbar on the workspace.
Upon clicking on the {}
button, users can view the list of all their queries sorted in
alphabetical order.
From the right panel, users can do several things with the queries accessible to them. They can run, view details and add their queries to Favorites.
Editing and viewing details of queries
From the queries' right panel, users can edit, delete and view details of queries that they
created. They can do that by clicking on ...
menu on each query.
Only the creator of a query can edit and delete it.
Editing Queries
When clicking on edit query, users are redirected to the query editor where they can perform changes to their query.
Deleting Queries
When deleting a query, the system will ask for a confirmation from the user to delete the query. Deleted queries will no longer be accessible to any of the users who had access to them and the action is irreversible.
Viewing details of queries
When users view the details of a query, they can view the query's name, ID, description, share
settings as well as the raw graph query code.
Moreover, users can load the query in the editor from the view details
panel which will
redirect them to the query editor.
Favorite Queries
Users can set queries as their favorite. They can do that by clicking on the three dots on a query's card and adding them to favorites. The benefit of having favorite queries is that they can be accessed much quicker.
All the user's favorite queries can be accessed at once via clicking on the Favorites tab at the bottom of the query panel.
Favorite queries are individual to each user.
Running Queries
All queries can be accessed and run from the right panel in the workspace. Depending on whether a query requires graph or user input, a form is displayed for the user to input the relevant information. Users can also search for a query to run by name or description.
Depending on the nodes or edges that users have selected, the suggested queries tab of the queries panel will show queries that can be run with the current graph selection as input.
Query results and edges
A query can return nodes and edges. When running a query, Linkurious Enterprise will have a different behavior depending on whether the query returns some edges or node.
If the query does not return any edges, the system will add all mutual edges between the nodes in the result to the query result. For example, if the query returns nodes A and B but no edges, then running the query will actually return A, B and all edges between A and B.
Example:
MATCH (a:Person)--(b:Person)
WHERE a.name = 'John'
RETURN a, b
The system will add all edges between
a
andb
to the result automatically.
If a query does return some edges, the system will not try to add any edges to the result automatically.
Example:
MATCH (a:Person)-[edge]-(b:Person)
WHERE a.name = 'John'
RETURN a, edge, b
The system will only return the edges explicitly returned by the query.
In addition to the automatically added edges, when adding the results of a query to a visualization, the system will always also add to the visualization the mutual edges between the nodes in the result and the nodes that were already in the visualization.
Example:
- The user is in a visualization containing node A
- The user runs a query that return node B
- The visualization will now contain nodes A and B, and all edges between A and B