Queries - Digital Thread Project

Query libraries in Syndeia 3.6 offer a powerful capability for users to develop collections of digital thread project queries that can be executed on demand (via Web Dashboard) or automatically (via the API). Query libraries are accessible from the Explore > Queries tab of the Digital Thread Project Dashboard, as shown in Figure 1 below.

Query authors can develop collections of Gremlin graph queries that can be run by all participants on the Digital Thread Project. Users can run a single query or an entire collection and visualize results in the dashboard. Feature-rich controls for managing queries and visualization of results are available on the dashboard.

Users can develop queries for frequently asked questions (FAQs) on a project that can be run each day and presented during design reviews with stakeholders. This will enable a shift from document-based to model-based project tracking and reviews, powered by a scalable digital threads managed by the Syndeia platform.

image-20240428-181558.png
Figure 1: Digital Thread Project - Query Library, Executions, Visualization

In the following sections, the capabilities to mange and execute queries and collections, and visualize execution results are presented.

Query and Collection

Let’s start with defining the terms Query and Collection.

  • Query - Graph Query in Gremlin language (Apache Tinkerpop). In Syndeia, digital threads are managed as graphs. Users can write queries using the Gremlin language to query and navigate digital threads.

  • Collection - Logical grouping of queries. A query can be a member of one (1) or more collections.

Refer to the Tutorials section at the end of this page to learn more.

Initialize Collection with Basic Queries

(1) If a Digital Thread Project does not contain any Collections with Queries, you will see a link to create a Collection with sample Queries, as shown in Figure 2 below. Click on the link.

image-20240429-021021.png
Figure 2: Initialize Collection with sample Queries

(2) Provide Name and Description, and click on the Create button.

(3) A Collection named Basic Queries will be initialized with a set of Queries, as shown in Figure 4 below.

(4) Hover on the Collection (Basic Queries) and click on the green-colored play button image-20240429-021256.png to play/execute all the Queries in the Collection, as shown in Figure 4 above. Once executed, scroll down/up the execution results on the RHS. The execution result for each query will include the following, as shown in Figure 5 below.

  • Name of the query, e.g. 2 - Get all Relations

  • Description of the query, e.g. Get all relations in the digital thread project, …

  • Results of query execution. Graph view with artifacts (nodes) and relations (edges) is shown by default. Change to Table and JSON Views, as shown in Figure 1 above.

  • Bird’s Eye View of the resulting graph.

(5) Hover on an individual Query and click on the Play button image-20240429-021304.png to execute the query, as shown in Figure 6 below. The results show that the Spacecraft 2404 project has 95 inter-model (digital thread) relations.

With only three clicks, a user can create and execute a Collection of sample Queries for any Digital Thread Project!


Manage Collections

In this section, the capabilities to manage Collections of Queries are presented.

Create a Collection

Follow the steps below to create a new Collection.

(1) Click on the Create Collection button image-20240428-223102.png, as shown in Figure 7 below.

(2) Specify Name and Description for the Collection. If you check the box “Add sample queries”, a set of sample queries will be added to the new Collection for the given Digital Thread Project. These sample queries are the same ones presented in the previous section and also shown in Figure 7 above under Basic Queries collection.

(3) A new Collection will be created, as shown in Figure 9 below.

(4) To add Queries to a Collection, refer to the next section Manage QueriesCreate a Query.

Execute a Collection of Queries

To execute a Collection of Queries, hover over the Collection and click on the Play button image-20240429-021416.png , as shown in Figure 4 above.

Update a Collection

Follow the steps below to update the name and/or description of a Collection.

(1) Hover over the Collection and click on the More Options menu (3 vertical dots), as shown in Figure 10-A below.

(2) Click on the Edit sub-menu, as shown in Figure 10-B above.

(3) Specify the new name and/or description for the Collection, and click on the Update button, as shown in Figure 10-C above.

Delete a Collection

Follow the steps below to delete a Collection.

(1) Hover on the Collection and select the More Options menu, as shown in Figure 10-A above.

(2) Select the Delete sub-menu, as shown in Figure 11-A below.

(3) Click on the Confirm button to confirm deletion, as shown in Figure 11-B below.

(4) On successful deletion, the Collection will be removed from the list of available Collections.

Collection is a logical grouping of Queries. Deleting a Collection will delete those Queries that are only included in the given Collection. If a Collection contains a Query that is also included in other Collection(s), that Query will not be deleted when the given Collection is deleted.


Manage Queries

In this section, the capabilities to manage Queries are presented.

Create a Query

Follow the steps below to create a new Query.

(1) Hover over a Collection and select the More Options menu (three vertical dots), as also shown in Figure 11 above.

(2) Click on the Create Query sub-menu, as shown in Figure 12-A below.

(3) Specify the following, as shown in Figure 12-B below.

  • Name - name of the new Query

  • Gremlin Query - Graph Query in Gremlin language, e.g. g.E().has('Relation','container','S2404B')

  • Description - description of the query

  • Collections - select Collections where this Query will be included

(4) Click the Create button. A new Query will be created, as shown in Figure 13 below.

(5) Hover over the Query and select the Play Query button image-20240429-021721.png to execute the Query, as shown in Figure 13 below. The results of the execution will be shown on the RHS.

Execute a Query

To execute a Query, hover over the Query and select the Play Query button image-20240429-021739.png , as shown in Figure 13 above. The results of the execution will be shown on the RHS.

Update a Query

Follow the steps below to update a Query.

(1) Hover over the Query and select the More Options menu (three vertical dots), as also shown in Figure 14 below.

(2) Click on the Edit sub-menu, as shown in Figure 14-A below.

(3) Edit the details of the Query, as shown in Figure 14-B above, and click on the Update button.

(4) The Query will be updated. Execute the query to get new results if the Gremlin Query was updated.

Clone a Query

Many times, it is easier to clone an existing Query and update it as opposed to creating a new Query. Follow the steps below to clone a Query.

(1) Hover over the Query you need to clone and select the More Options menu (three vertical dots), as also shown in Figure 14-A above.

(2) Click on the Clone sub-menu, as also visible in Figure 14-A above. This will open the Clone Query dialog, as shown in Figure 15 below.

(3) Provide the following inputs.

  • Select a Digital Thread Project from the drop down. By default, the cloned Query will be created in the same Digital Thread Project. However, you can select another Digital Thread Project for the cloned Query.

  • Name - Specify a new name for the cloned Query.

  • Gremlin Query - Specify the updated Gremlin graph query expression.

  • Description - Provide a new description for the cloned Query.

  • Collections - Select one or more collections that will include the cloned Query.

(4) Click on the Clone button. A new Query will be created in the selected Digital Thread Project, and included in the selected Collections.

Delete a Query

Follow the steps below to delete a Query.

(1) Hover over the Query and select the More Options menu (three vertical dots), as also shown in Figure 14 above.

(2) To delete a Query, select the Delete sub-menu, as also visible in Figure 14-A above.

(3) Click the Confirm button to confirm deletion, as shown in Figure 16 below.

(4) The Query will be deleted from all Collections where the given Query was included.

To remove a Query from some but not all Collections, follow the steps above to Update a Query, and then uncheck the Collections from where the Query needs to be removed. Deleting a Query will delete it from all Collections.


Tutorials

Refer to the following tutorials to learn more.