Defining the structure of a Visual Query

The first step of a Visual Query is to define the structure by adding query items.

  1. On the Home tab of the ribbon, in the Search Information Store group, click Visual Query.
    The Information Store Visual Query window opens. If you have used the Visual Query feature before, there might be a list of saved queries in the 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 items must have unique labels. You can overtype the default label should you want to change it.
  4. Link the query entities in the structure with the query links that you want to find. To create a link, select the two query entities that you want to link.
    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 entities, links must have unique labels, however you can overtype the default label should you want to change it.
  6. Optional: To prevent the results from being returned, deselect the Include in results box. 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. You should leave Include in results selected for the Person query entity. When you turn off the option for the Vehicle query entity, the link is automatically turned off too, and an icon is displayed next to all the query items that are not included.
    Be aware that a link record can only be returned if both end records are present. 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 indicate that the structure must contain multiple records for a query item, set a count on the 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 set number of cars. Select the Vehicle query entity in the query structure, then click the Count condition button. Click OK and in the count condition structure, select Equal to. Type the number of vehicles the count should be equal to.
    You can set a count on only one item in the query structure. If you set a count on a second item, the first one is removed.
  9. Optional: If you have enabled Count condition and you have an entity linked to two or more other entities, you can select a relationship to apply the count condition to. By default, all entities are selected. Click the check box to deselect an entity. You cannot deselect all the 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.
After you define the query structure, add conditions to the items in the structure, and then run the query.