Querying in Insights
You can open your project from Portfolio using Insights™. This application lets you explore the Quantum model visually and navigate the relationships interactively.
In addition to browsing the Quantum data structure visually, you can also query your data. Insights is an Integrated Development Environment (IDE) where you can test your queries.
When you create a new account, you are usually provided with example or Demo buildings, so you can see some query results even if you have not created or scanned a building of your own.
You can query your data set in the following ways:
- Query Builder: A visual drag-and-drop tool to help you create queries (the panel is titled QUERY).
- Editing the GraphQL code: You can edit and test the code Query Builder gives you, in the GraphiQL code panel.
- Creating your own GraphQL query: You can type and test your own original queries in the GraphiQL code panel.
The GraphiQL panel includes predictive text and documentation of the Quantum API™ types and specific attributes.
When you click Build Query, the panel opens and you can drag items from the Object type browser into the To and From trays. You can also add attributes to create a filter in the Where tray, or add query chaining by clicking the chain icon. When you click Run Query , the Query panel opens, displaying a GraphQL query and the results of the query.
-
Editing the GraphQL query generated by the Query Builder: When you click Build Query > Run Query
, the Query panel opens. You can edit the GraphQL query generated by Query Builder if you want to create more complex queries.
-
Creating your own GraphQL query: When you click Build Query > Run Query
, the GraphiQL Query panel opens even if you have not filled in any fields. You can create and run a GraphQL query with your own query text.
Using the Query Builder in Insights
After you open your project in Insights, click the Build Query button.
Drag Quantum object types to TO and FROM trays in the QUERY panel. You can also add attributes to create a filter in the WHERE tray. Click to add a chained query.
Click Run to see the results, where you can continue to edit and test your queries in the GraphiQL code panel. This embedded GraphiQL has auto-complete when you're entering type names and a Documentation Explorer
to view the types list
To return to the Query Builder, click the dragger in the bottom left corner.
The following examples explain how to query by using the visual Query Builder.
- What zones are on the ground floor? This one is an introduction, so it has more detail described in the steps.
- What's the ceiling height?
- What doors are in each zone?
Editing the Query in GraphiQL Code Panel
In addition to using the visual Query Builder tool that helps you build the GraphQL query string, you can also edit the text string created by Query Builder, or create your own, in the GraphiQL code tool.
(To query the cloud data with GraphQL using the Quantum API™, see Quantum API Documentation.)
Open the Query panel for GraphQL by clicking Build Query > Run Query in Insights.
In the first field, you can type or edit an existing query string. In the second field, you can copy the results.
The following image is an overview of the features in this panel.
Your query text strings are saved and displayed in the query history until you clear your browser cookies. You can rename queries in the history, or click the star to display a query at the top of the list. You can also use Ctrl+F or Cmd+F to search in the query results panel.
The following section contains sample queries you can run, with text you can copy and paste into the Query panel. When you create a new account, you will usually see some example projects, so you can get query results even if you have not created or scanned a building of your own.
Filtering for a Specific Project
One helpful feature of Insights is the Project Picker. Click the dragger at the bottom left for a list of your projects. If you have any projects already open in the browser, they are displayed at the top (called Active Sessions). When you select a project, Insights automatically filters your queries to that particular project.
Of course, you can also narrow your search using the Query Builder or by typing code.