Exercise 20.3 - Digital Thread Queries for Teamwork Cloud

Exercise 20.3 - Digital Thread Queries for Teamwork Cloud

Objectives

The objective of this exercise is to help new users formulate digital thread graph queries for Teamwork Cloud (TWC) to analyze inter-model relations from/to artifacts in Teamwork Cloud to artifacts in other digital engineering repositories. The specific learning objectives of this exercise are to:

  • create a new Teamwork Cloud query collection for a Digital Thread Project.

  • create graph queries (using Gremlin language) to analyze relations from/to Teamwork Cloud artifacts.

  • run the queries to display the graph view of Teamwork Cloud relations.

Preparation

This exercise assumes the student has:

Because the content of your digital thread project will be different, the specific examples in the following exercise instructions are only a guide and example for your actions. It is generally advisable to carry out these exercises in a non-production repository, a "sandbox", set up for training and practice purposes.
See the tutorials under Syndeia Cloud Web-Dashboard/Part 19 – Syndeia Cloud Graph Analysis for an overview of this feature.

Background – Syndeia Cloud Data Model

Figure 1 provides a simplified schema for elements in the Syndeia Cloud graph. All graph nodes are either Repositories, Containers, Artifacts, or their types where each Artifact is owned by a Container and each Container is owned by a Repository. Each has a Type; the set of ContainerTypes and ArtifactTypes are owned by the Repository. How the TWC data model maps to the Syndeia Cloud data model is discussed in the next section.

Figure 1 - Syndeia Cloud Schema (simplified)

Background – Teamwork Cloud (TWC) and Queries

Screenshot 2026-05-08 121319.jpg
Figure 2 - Tree view of TWC repository

Exercise

  1. Select a Digital Thread project that has existing relations to and from TWC artifacts. In this example, we are using the project Autonomous Vehicle (AV01). Go to the Explore → Queries interface as shown in Figure 3.

Screenshot 2026-05-05 143429.jpg
Figure 3 - Digital Thread Project → Explore → Queries
  1. Create a new query collection by clicking the folder icon button as shown in Figure 4. Name the collection ‘Teamwork Cloud Queries’, give it a description and click the Create button.

Screenshot 2026-05-05 143603.jpg
Figure 4 - Create new Query Collection
  1. We will add our first query. Click the three dots next to the collection and select Create Query as shown in Figure 5. In the Create Query window, name it ‘Get All TWC Artifact Relations’ and give a description. Copy and paste the below query in the Gremlin Query field.

  • g.E().has('Relation', 'container', 'AV01') .has('_isLatest', 'TRUE') .where(bothV().repeat(out('ownedBy')) .until(hasLabel('Repository') .has('name', 'Teamwork Cloud 2024x @ Intercax')))

  • In the query, make the following changes specific to your digital thread project and TWC repository:

    • Specify the Key of your digital thread project (e.g. AV01) in the first has step of the query - has('Relation', 'container', 'AV01')

    • Specify the Name of the TWC repository you are using (e.g. Teamwork Cloud 2024x @ Intercax) in the last has step of the query - has('name', 'Teamwork Cloud 2024x @ Intercax').This will be the name that was given to the repository when adding it, as shown in Figure 6.

  • Click Create to finish.

Screenshot 2026-05-05 143808.jpg
Figure 5 - Create first TWC query
image-20260505-184222.png
Figure 6 - Refer to repository settings for the Repo name to use in query
  1. The first newly created query will now show up in the Teamwork Cloud Queries Collection shown below in Figure 7. Run the first query by clicking the Play button .

Screenshot 2026-05-07 142156.jpg
Figure 7 - Play the first query
  1. This will execute the query and fetch both outgoing and incoming relations to elements in the given Teamwork Cloud repository, and display them in the query results area shown in Figure 8. The color keys on the RHS indicate artifacts by repository type (e.g. Jama, Jira).

image-20260507-183740.png
Figure 8 - Query to fetch both outgoing and incoming relations to elements
  1. Click on Settings (gear button shown below in Figure 9) and set Select edge display label as Relation Type to show the relation types for inter-model relations (i.e. Refines) in the graph view shown below.

image-20260505-192256.png
Figure 9 - Adjust Edge label settings in graph view
  1. Add a 2nd query by cloning the first query. To do this, hover over the first query, click the More Options menu (three vertical dots), and select the Clone option, as shown below. In the Clone Query window shown in Figure 10, name it ‘Get All Incoming Relations to TWC Artifacts’ and give a description. In the Gremlin Query field, we will update the bothV() to inV() so that the raw query is:

  • g.E().has('Relation', 'container', 'AV01') .has('_isLatest', 'TRUE') .where(inV().repeat(out('ownedBy')) .until(hasLabel('Repository') .has('name', 'Teamwork Cloud 2024x @ Intercax')))

  • Click the Clone button to finish.

image-20260505-193238.png
Figure 10 - Add 2nd TWC query by cloning and modifying first query
  1. Clone the 2nd query above by repeating step 7. But in this case, name it ‘Get All Outgoing Relations to TWC Artifacts’. In the Gremlin Query field, we update the inV() to outV() so that the raw query is:

  • g.E().has('Relation', 'container', 'AV01') .has('_isLatest', 'TRUE') .where(outV().repeat(out('ownedBy')) .until(hasLabel('Repository') .has('name', 'Teamwork Cloud 2024x @ Intercax')))

  1. For the 4th and final query, we will see all relations between TWC and Jama (or any two repositories). Create a new query in the Teamwork Cloud queries collection (see step 3) and use the following Gremlin query:

  • g.E().has('Relation', 'container', 'AV01') .has('_isLatest', 'TRUE') .where(outV().repeat(out('ownedBy')) .until(hasLabel('Repository') .has('name', 'Teamwork Cloud 2024x @ Intercax'))).where(inV().repeat(out('ownedBy')) .until(hasLabel('Repository') .has('name', 'Jama @ Intercax')))

  • The 1st where step above filters relations where the source vertex outV() belongs to the Teamwork Cloud repository with the given name.

  • The 2nd where step above filters relations where the target vertex inV() belongs to the Jama repository with the given name.

  1. Run the query by clicking the Play button . Repeat the Relation Type display setting in step 4 and the result should look like Figure 11 below. You can repeat steps 8-9 for any pair of repositories.

image-20260505-200838.png
Figure 11 - Graph view of final query
  1. There should now be 4 queries in the Teamwork Cloud Queries Collection. You can run the entire collection of queries (all 4) by clicking the Play button next to the query collection, as shown in Figure 12 below.

image-20260505-201402.png
Figure 12 - Play the entire query collection

Congratulations! You have now learned how to create and run digital thread queries (using Gremlin) for Teamwork Cloud artifacts.