Objectives
The objective of this exercise is to help new users of Syndeia graph analysis to formulate Gremlin queries to analyze their graph with the Syndeia Web Dashboard. The specific learning objectives of this exercise are to create lists of
...
Windchill artifact types belonging to a specific
...
Repository
...
Windchill artifacts connected in a specific
...
Digital Thread Project
Artifacts connected to Windchill Items in a specific Digital Thread Project
Preparation
This exercise assumes the student has
...
Syndeia Cloud 3.
...
6 installed with a valid user account, and
...
An existing Syndeia graph containing Windchill
...
Parts connected to elements in other repositories.
Because the content of your Syndeia graph 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 1 for Running Saved Graph Queries and Creating Graph Queries and Part 19 – Syndeia Cloud Graph Analysis for
...
Update for Syndeia Cloud 3.6 – This exercise assumes that the user has been assigned Global Graph Query permission by the Syndeia Cloud administrator in order to access the Graph Queries page. Screenshots in this tutorial were taken from an earlier release; the icons on the left margin of the figures and the graphical display format of query results have been modified but the instructions are otherwise unchanged.
...
general background.
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, or Artifacts, 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 Windchill data model maps to the Syndeia Cloud data model is discussed in the next section.
...
Background – Windchill
As envisioned by Intercax, the Digital Thread is composed of inter-model connections between models in different repositories, which Syndeia creates and manages, and intra-model connections between elements in the same repository, which the individual tool creates and manages. As of Syndeia release 3.6, the Syndeia Web Dashboard can extract and display some model information from
...
the Windchill repository. Figure 1 shows a tree view of this information, with labels identifying the Windchill element types
...
. The label color coding indicates how the Windchill element type is mapped to the Syndeia Cloud element types: Repository (green)
...
and Artifact (blue).
...
Windchill repositories do not have an element type corresponding to the Syndeia concept of Container, so Syndeia creates a default container for the entire Windchill repository for its internal graph.
This information is important in formulating and interpreting Syndeia graph queries. A more complete diagram of the Windchill data model as it is understood by Syndeia is available through the web dashboard help menu on the left.
It is also important to understand the limitations of graph queries with respect to the Windchill repositories. As of Syndeia 3.6, graph queries cannot extract the internal structure of a Windchill repository, i.e. they cannot be used to obtain the full structure of the Windchill repository or internal (intra-model) relations between Windchill artifacts. In this way, graph queries are different than the Tree View or Graph View (Digital Thread Explorer) capabilities of the Repositories page in the Syndeia Web Dashboard. Graph queries are most useful in viewing inter-model connections from Windchill elements to other repositories.
...
Figure 2 Tree view of Windchill repository
Exercise
...
Log on to the Syndeia Cloud Web Dashboard (see Video 1.2) and click on the Graph Queries icon on the left border.
...
The first task is to compile a list of Windchill Artifacts of a specific type. Per Figure 1, ArtifactTypes are owned by (specific to) a Repository. We typically want to begin by creating a list of Artifact types available in such a Repository.
If we use Query Builder (Figure 3), we select ArtifactType from the pull-down menu under Label.
Figure 3 Graph Queries page (icon outlined in red) – Query Builder
To restrict the list of ArtifactTypes to our current Windchill repository, we click Filters. We will filter by the name of our Repository, so we select Repository from the pull-down menu at the top marked Property of. Under Property Key, we select the Name property and under Property Value, we enter Windchill 11.1 @ Intercax. We then click the Plus (+) button to add the filter in the bottom list and the window should look similar to Figure 4. Click Close
Figure 4 Query Builder Filters window
...
Back on the Graph Queries page, click Run. The results, a list of all ArtifactTypes in Windchill 11.1 @ Intercax, may be displayed in table form as in Figure 5. Key ArtifactType properties in the table are Name and Key because we will use these in the next search. Click the Exports icon to export the list as a CSV file for future reference, if desired.
...
Figure 5 Graph Queries page, ArtifactTypes results in table format (Export icon highlighted in red)
...
Exercise
Log on to the Syndeia Web Dashboard (see introductory videos for the web dashboard), open a Digital Thread Project (in our example, UGV02 which includes relations to Windchill Items) and go to the Explore Queries page. In our example (Figure 3), it contains one previously saved graph collection, Timeline Queries.
The first task is to create an empty Collection to contain our new graph queries. Click on the Create Collection icon (Figure 3). Enter a name and description for the collection (Figure 4) and click Create.
Our first objective is to extract a list of artifact types belonging to our Windchill repository (Windchill 11.1@ Intercax). We will use the artifact type keys to build the later queries.
Hover over the Tutorial Queries collection, click on the three-dot icon and select Create Query (see Figure 5).
In the Create Query window (Figure 6), enter the name, query and description. In this case, the Gremlin query is g.V().has('sLabel','ArtifactType').where(outE().has('sLabel','ownedBy').inV().has('name','Windchill 11.1 @ Intercax'))
...
which translates as “Get all nodes of type Artifact Type that are owned by the repository Windchill 11.1 @
...
We can search by ArtifactType Name (“WCTYPE|wt.part.WTPart”) or Key (ART-TYPE341), which we got from the table in Figure 5. Generally, it is better to search by Key, which is unique within the Syndeia Cloud database, rather than Name, which is not unique.
If we use Query Builder, we select Artifact from the pull-down menu under Label, as in Figure 6.
Figure 6 Query Builder, Artifact search
To restrict the list of Artifacts to the Windchill Part type, we click Filters. We will filter by the ArtifactType Key, so we select ArtifactType from the pull-down menu at the top marked Property of. Under Property Key, we select the sKey property and under Property Value, we enter ART-TYPE341, which we took from the table in Figure 5. After we click the Plus (+) icon, the Filters window should look like Figure 7. Click Close.
Figure 7 Query Builder Filters window, filter by ArtifactType sKey
...
Back on the Graph Queries page, click Run. The results, a list of all Artifacts of type ART-TYPE341, which is owned by the repository Windchill 11.1 @ Intercax, may be displayed in table form as in Figure 8. Click the Exports icon to export the list as a CSV file for future reference, if desired.
...
Figure 8 Graph Queries page, Artifacts results in table format, truncated (Export icon outlined in red)
...
Note at the top of Figure 5, the Query Builder utility has created a Gremlin query. We could have performed the same search with the same results by going to the Raw Query mode and entering this query directly.
g.V().has('sLabel','Artifact').where(outE().has('sLabel','hasType').inV().has('sKey','ART-TYPE341'))
...
The second task is to compile a list of Windchill Artifacts in a specific Windchill Product. Per Figure 2, Products in Windchill are Containers and are owned by (specific to) a Repository. We will begin by creating a list of Containers available in a Windchill Repository.
If we use Query Builder (Figure 9), we select Container from the pull-down menu under Label.
Figure 9 Graph Queries page (icon outlined in red) – Query Builder
To restrict the list of Containers to our current Windchill repository, we click Filters. We will filter by the name of our Repository, so we select Repository from the pull-down menu at the top marked Property of. Under Property Key, we select the Name property and under Property Value, we enter Windchill 11.1 @ Intercax. We then click the Plus (+) button to add the filter in the bottom list and the window should look similar to Figure 10. Click Close.
Figure 10 Query Builder Filters window
...
Figure 11 Graph Queries page, Containers results in table format (Export icon highlighted in red)
...
Note at the top of Figure 11, the Query Builder utility has created a Gremlin query. We could have performed the same search with the same results by going to the Raw Query mode and entering this query directly.
g.V().has('sLabel','Container').where(outE().has('sLabel','ownedBy').inV().has('name','Windchill 11.1 @ Intercax'))
...
The final part of the second task is to generate a list of all Artifacts in a specific Container within the Windchill 11.1 @ Intercax Repository. Note that Syndeia will return only those Windchill Parts that are connected within the Syndeia Cloud graph, not all Parts in the repository.
We can search by Container Name (“UAV”) or Key (CONT871), which we got from the table in Figure 11. Generally, it is better to search by Key, which is unique within the Syndeia Cloud database, rather than Name, which is not unique.
If we use Query Builder, we select Artifact from the pull-down menu under Label, as in Figure 12.
Figure 12 Query Builder, Artifact search
To restrict the list of Artifacts to the Windchill Product UAV, we click Filters. We will filter by the Container Key, so we select Container from the pull-down menu at the top marked Property of. Under Property Key, we select the sKey property and under Property Value, we enter CONT871, which we took from the table in Figure 11. After we click the Plus (+) icon, the Filters window should look like Figure 13. Click Close.
Figure 13 Query Builder Filters window, filter by Container sKey
...
Back on the Graph Queries page, click Run. The results, a list of all Artifacts in Container CONT871, which is owned by the repository Windchill 11.1 @ Intercax, may be displayed in table form as in Figure 14. Note that only Windchill parts that are part of the Syndeia Cloud graph appear; there may be other Windchill parts in this Project without connections to other repositories that do not appear.
...
Figure 14 Graph Queries page, Artifacts results in table format, truncated
...
Note at the top of Figure 14, the Query Builder utility has created a Gremlin query. We could have performed the same search with the same results by going to the Raw Query mode and entering this query directly.
g.V().has('sLabel','Artifact').where(outE().has('sLabel','ownedBy').inV().has('sKey','CONT871'))
...
The third task is to compile a list of Windchill Artifacts that are connected as part of a specific Syndeia Project. Syndeia Projects are partitions within the Syndeia Cloud graph database that separate different projects or system models. Syndeia Projects are Containers owned by the Syndeia Repository. Unlike Windchill Projects, Syndeia Projects contain only relations, the inter-model relations that define the “macrostructure” of the Digital Thread for that system or project. In this case, we are looking not for the Windchill parts directly; we are looking for inter-model connections where one end is a Windchill part.
...
We will begin by creating a list of Containers available in the Syndeia Repository.
If we use Query Builder (Figure 15), we select Container from the pull-down menu under Label.
Figure 15 Graph Queries page (icon outlined in red) – Query Builder
To restrict the list of Containers to the Syndeia repository, we click Filters. We will filter by the name of our Repository, so we select Repository from the pull-down menu at the top marked Property of. Under Property Key, we select the Name property and under Property Value, we enter Syndeia Repository. We then click the Plus (+) button to add the filter in the bottom list and the window should look similar to Figure 16. Click Close.
Figure 16 Query Builder Filters window
...
Back on the Graph Queries page, click Run. The results, a list of all Containers in the Syndeia Repository may be displayed in table form as in Figure 17. Key Container properties in the table are Name and Key because we will use these in the next search. Click the Exports icon to export the list as a CSV file for future reference, if desired.
...
Figure 17 Graph Queries page, Containers results in table format, truncated
...
Note at the top of Figure 17, the Query Builder utility has created a Gremlin query. We could have performed the same search with the same results by going to the Raw Query mode and entering this query directly.
g.V().has('sLabel','Container').where(outE().has('sLabel','ownedBy').inV().has('name','Syndeia Repository'))
...
The next part of the third task is to generate a list of all Relations within a specific Syndeia Project.
We can search by Container Name (“Lonnie Sandbox 02”) or Key (LVSB02), which we got from the table in Figure 17. Generally, it is better to search by Key, which is unique within the Syndeia Cloud database, rather than Name, which is not unique.
If we use Query Builder, we select Relation from the pull-down menu under Label, as in Figure 18. Remember, the Syndeia Projects contain relations, not artifacts.
Figure 18 Query Builder, Artifact search
To restrict the list of Relations to a specific Syndeia Project, we click Filters. We will filter by the Container Key, so we select Container from the pull-down menu at the top marked Property of. Under Property Key, we select the sKey property and under Property Value, we enter LVSB02, which we took from the table in Figure 17. After we click the Plus (+) icon, the Filters window should look like Figure 19. Click Close.
Figure 19 Query Builder Filters window, filter by Container sKey
...
Back on the Graph Queries page, click Run. The results, a list of all Relations in Container LVSB02, which is owned by the Syndeia Repository, may be displayed in table form as in Figure 20. Note that all relations within the project appear, not just those with a Windchill artifact at one end.
...
Figure 20 Graph Queries page, Relations (Edges) results in table format, truncated
...
If we select Raw Query and enter this in the Gremlin Query field, we generate the table in Figure 21, showing all Windchill parts of ART-TYPE341 used in the Syndeia Project LVSB02.
...
Figure 21 Graph Queries page, Artifacts results in table format, truncated
There are alternate ways to approach the problem. If we wanted to search for Windchill parts in a specific Windchill Project (CONT871) that were used in a Syndeia Project (LVSB02), we could reformulate the query using the first part from Step 20 and the second part from Step 13.
...
Intercax”.
To execute or “play” the saved query, expand the Tutorial Queries collection, hover over the new query (Figure 7) and click the green arrow. The query will execute in the main window and the results will be displayed initially graphically. Click on the Table View icon to display the artifact types with their Keys (Figure 8). We will be interested in Windchill Part with Key ART_TYPE320 in the next new queries.
The second query asks for all Windchill Parts connected in the active Digital Thread Project (UGV02 in our example). As in Step 4, click Create Query next to Tutorial Demos. In the Create Query window, enter a Gremlin query such as g.E().has('Relation','container','UGV02').bothV().has('type','ART-TYPE320') along with appropriate name and description. This query asks first for all Relations in the Syndeia project UGV02 and then for all nodes at either end (bothV() includes both outgoing/Source and incoming/Target ends of the relation) with type ART-TYPE320, which we showed in the first query represents Windchill Parts.
Play the new query similarly to Step 5. The results should appear similar to Figure 9
We will use a slightly different approach to create the third query, show all nearest neighbor connected elements to Windchill Parts in the active digital thread project (UGV02 in our example). Because this query, g.E().has('Relation','container','MBSB11').where(bothV().has('type','ART-TYPE813')) is only slightly different from the previous query (it returns the Relations themselves where one end is a Windchill Part), we will clone and edit it. To clone an existing query, hover over it, click the three-dot icon and select Clone (Figure 10). In the Clone query window (Figure 11), edit name, query and description as needed and click Clone.
The new graph query will appear under the Tutorial Demos collection. Execute it and it should appear similar to Figure 12.
The entire set of queries can be executed and displayed by hovering over the Tutorial Demos collection and clicking the green arrow.