Defining the structure of a Visual Query

The first part of creating a Visual Query is to define its structure by adding query items.

Procedure

  1. On the Home tab of the ribbon, in the Information Store group, click Visual Query to open the Information Store Visual Query window.
  2. Open a saved query, or click New query to create one.
    Analyst's Notebook opens a new tab in the Information Store Visual Query window.

    For a new query, the Edit query structure window opens immediately. For a saved query, you can click the Edit structure button Edit query.

  3. In the Edit query structure window, add the query entities that represent the structure that you want to find. To add a query entity, drag an entity type from the query palette to the query surface.
    When you place or select a query entity on the query surface, the details about that entity are displayed. Query entities must have unique labels. You can overtype the default label if you want to change it.
  4. Connect the query entities in the structure with query links. To create a link, select the two query entities that you want to connect.
    If there are no suitable link types available between the selected entities, you see the No valid link types message.
  5. From the Multiple query items window, select a link type.
    When you select a link type, the options that you can apply to the link are displayed. Like query entities, query links must have unique labels, and you can overtype the default label if you want to change it.
  6. Optional: To prevent results from being returned for a particular query item, clear the Include in results checkbox.
    For example, from your query structure of a Person, a Vehicle, and an Owner link, you might want to see the owners but not the vehicle details. In that case, leave the checkbox selected for the Person query entity, but clear it for the Vehicle query entity. When you do so, the checkbox for the query link is automatically cleared too, and an icon is displayed next to all the query items that do not return results.
    Be aware that a link record can only be returned if both end records are present in the results. When you choose to exclude entities, you also exclude their associated links.
  7. Optional: To add a direction to a query link, choose an option from the Direction list.
  8. Optional: To require that matches for your query structure must contain multiple records for a particular query item, set a count on that query item.
    For example, using your query structure of a Person, a Vehicle, and an Owner link, you might want to find people who own a certain number of cars. Select the Vehicle query entity in the query structure, then click the Count condition button and click OK. In the count condition structure, select Equal to and type the number.
    You can set a count condition on only one query item in the structure. If you set a count condition on a second query item, the first one is removed.
  9. Optional: If you set a count condition on a query entity that's linked to two or more other query entities, you can select which relationships to apply the condition to. By default, it applies to all relationships. Clear the checkbox for any query entity to which the condition does not apply. You cannot deselect all the query entities in the list.
  10. Click OK.
    After you click OK, you can edit the query structure at any time by clicking the Edit structure button edit query.

What to do next

After you define the query structure, add conditions to the items in the structure, and then run the query.