How to Run Amazon IoT TwinMaker knowledge graph queries - Amazon IoT TwinMaker
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

How to Run Amazon IoT TwinMaker knowledge graph queries

Before you use the Amazon IoT TwinMaker knowledge graph, make sure you have completed the following prerequisites:

Note

In order to use the Amazon IoT TwinMaker knowledge graph, you need to be in either the standard or tiered bundle pricing modes. For more information, see Switch Amazon IoT TwinMaker pricing modes.

The following procedures show you how to write, run, save, and edit queries.

Open the query editor
To navigate to the knowledge graph query editor
  1. Open the Amazon IoT TwinMaker console.

  2. Open the workspace in which you wish to use knowledge graph.

  3. In the left navigation menu, choose Query editor.

  4. The query editor opens. You are now ready to run queries on your workspace's resources.

Run a query
To run a query and generate a graph
  1. In the query editor, choose the Editor tab to open the syntax editor.

  2. In the editor space, write the query you wish to run against your workspace's resources.

    The editor space with a query entered.

    In the example shown, the request searches for entities that contain vav_% in their name, then organizes these entities by the feed relationship between them, using the following code.

    SELECT ahu, vav, r FROM EntityGraph MATCH (vav)<-[r:feed]-(ahu) WHERE vav.entityName LIKE 'vav_%'
    Note

    The knowledge graph syntax uses PartiQL. For information on this syntax, see Amazon IoT TwinMaker knowledge graph additional resources.

  3. Choose Run query to run the request you created.

    A graph is generated based on your request.

    A graph showing the results of the query detailed in the preceding steps.

    The example graph shown above is based on the query example in step 2.

  4. The results of the query are also presented in a list. Choose results to view the query results in a list.

  5. Optionally, choose Export as to export the query results in JSON or CSV format.

This covers the basic use of knowledge graph in the console. For more information and examples demonstrating the knowledge graph syntax, see Amazon IoT TwinMaker knowledge graph additional resources.