Skip to main content

Query Details

Overview

The Query Details page is the core workspace of Query Studio, providing a visual topology query editor. You can define query topology structures graphically, configure filter conditions, set return attributes, and more.

The detail page uses a left-right split layout:

  • Left: Query topology graph, visually displaying query nodes and their connections
  • Right: Configuration panel with multiple tabs for configuring different aspects of the query
Query Detail Page

Configuration Panel

The configuration panel contains the following tabs:

  1. CI Types: Add selected CI types as query nodes to the left topology graph
  2. Attribute Filter: Configure attribute filter conditions
  3. Link Conditions: Configure connection relationships between nodes
  4. Return Attributes: Configure attribute fields returned by the query
  5. Type Filter: Configure subtype inclusion rules

Topology Graph Operations

Adding CI Types as Query Nodes

Method 1: Drag and Drop

  1. Find the desired type in the type tree in the CI Types tab
  2. Hold the left mouse button and drag the type node to the left topology graph area
  3. Release the mouse to complete adding

Method 2: Add from Type Tree (supports batch adding)

  1. Check the desired CI types in the type tree in the CI Types tab
  2. Click the Add button
  3. CI types are added as new nodes to the topology graph

Creating Connection Relationships Between Nodes

  1. Move the mouse over the source node, hold the left button and drag a line from the source node to the target node
  2. In the popup relationship selection dialog, select the relationship type
  3. Click OK to complete relationship creation

Node Operations

Right-click a node to open the context menu:

OperationDescription
Set as Root NodeSet the current node as the query's root node
Show CI InstancesView the CI type's instance list
Change Node TypeChange the current node's CI type to another type; may require cascading changes to connections with other query nodes
RenameModify the node's query identifier
Hide in query resultControl whether the node returns results in query output
DeleteRemove the node from the query

Edge Operations

Right-click an edge (relationship) to open the context menu:

OperationDescription
Hide in query resultControl whether the relationship returns results in query output
Change Relationship TypeModify the relationship type
DeleteRemove the relationship from the query topology

CI Types

Overview

The CI Types tab manages the CI types included in the query. You can select and add CI types from the type tree to the query.

CI Types Tab

Type Tree Features

The type tree displays all CI types in a hierarchical structure:

  • Expand/Collapse: Click the arrow before a node to expand or collapse subtypes
  • Search: Enter keywords in the search box to quickly locate types
  • Multi-select: Check the checkbox before types for multiple selection
  • Drag: Hold a type node to drag it to the topology graph
  • Hide Empty Types: When selected, only show CI types with CI instances in the tree

Operations

  1. Select Types: Check the CI types to add
  2. Add: Click the Add button
  3. Cancel Selection: Click the Cancel button to clear selection
  4. Hide Empty Types: Check the checkbox above the CI type tree

Attribute Filter

Overview

The Attribute Filter tab configures node attribute filter conditions. By setting attribute filter conditions, you can precisely control which CI instances are returned by the query.

Attribute Filter Tab

Click the Edit button to configure attribute filter conditions in the popup. For detailed configuration, see Attribute Filter Configuration. After configuration, you can see a summary of attribute filter conditions in the tab for quick understanding and verification.

Overview

The Link Conditions tab configures connection relationships between query nodes. Link conditions determine how the query traverses from one node to related nodes.

Link Conditions Tab
Condition TypeDescriptionUse Case
ExistsA connection from source to target must existQuery CIs that must have this relationship
Not ExistsA connection from source to target must not existExclude CIs that have this relationship
OptionalConnection may or may not existOptional relationship query

Steps

  1. Select the node to configure in the query topology graph
  2. Switch to the Link Conditions tab
  3. View all link conditions for the current node
  4. Click the Edit button to modify link conditions:
    • Select logical combination method (AND/OR)
    • Set condition type for each relationship
    • Add or remove relationship conditions
  5. Click Save to apply changes

For nodes with multiple relationships, you can use logical combinations:

  • AND: All conditions must be satisfied
  • OR: At least one condition must be satisfied

After configuration, you can see a summary of link conditions in the tab for quick understanding and verification

tip

A query node's link conditions must correspond one-to-one with the node's edge count, i.e., each edge must have exactly one link condition definition

Return Attributes

Overview

The Return Attributes tab configures the attribute fields returned in query results. By properly configuring return attributes, you can reduce data transfer and improve query performance.

Return Attributes Tab

Return Modes

Return ModeDescriptionUse Case
No AttributesQuery results contain no attribute fields, only basic CI identificationOnly need CI ID and type, no specific attribute values
All AttributesReturn all attributes for the type (default)Need complete information, or attribute count is small
IncludeReturn only selected attributesOnly care about specific fields, reduce data transfer
ExcludeReturn all attributes except selected onesExclude irrelevant or sensitive fields

Configuration Steps

  1. Select Type in the Return Attributes tab
  2. If selecting Include or Exclude, check the corresponding attributes
  3. After configuration, see a summary of return attributes at the bottom of the tab for quick understanding and verification

Configuration Examples

Scenario 1: Return Basic Info Only

SettingValueDescription
Return ModeIncludeReturn only selected attributes
Selected AttributesName, Primary IP Address, Serial NumberReturn only these three attributes

Scenario 2: Exclude Sensitive Information

SettingValueDescription
Return ModeExcludeExclude selected attributes
Selected AttributesPassword, Email AddressExclude sensitive fields

Scenario 3: Only Need Instance List

SettingValueDescription
Return ModeNo AttributesReturn identification info only
Selected AttributesNo attributes to select

Type Filter

Overview

The Type Filter tab configures whether the query includes subtypes of CI types. CI types in CMDB typically have inheritance relationships. Type filter determines whether the query includes instances of subtypes.

Type Filter Tab

Click the Edit button on the Type Filter tab to edit type filter conditions in the popup. For detailed configuration, see Type Filter Configuration. After configuration, you can see a summary of type filters in the tab for quick understanding and verification.

Query Preview

Overview

Query preview lets you view query results before saving to validate query logic.

Steps

  1. After completing query configuration
  2. Click the Preview button in the topology graph toolbar
  3. View query results in the preview dialog:
    • Table View: Display results in table format
    • Graph View: Display results as a topology graph
  4. Adjust query configuration based on preview results

Preview Views

Query Preview Dialog

Query Count

Overview

Query count display the number of instances each node in the query will return, helping you assess query data scale.

Steps

  1. After completing query configuration
  2. Click the Count button in the topology graph toolbar
  3. The system displays the instance count for each type on each node
  4. Optimize query conditions based on statistics
Count

Query Validation

Connectivity Validation

The system automatically validates the query graph's connectivity:

  • All nodes must be reachable from the root node
  • Isolated nodes or relationships are not allowed

If the query graph is not connected, an error message is displayed when saving. You need to:

  1. Check for isolated nodes
  2. Add missing relationship connections
  3. Or delete unnecessary nodes

Query Examples

The product includes multiple system query examples to help you understand TQL query definitions. Below are two typical query examples:

Example 1: Computer Software and Hardware Inventory Query

Business Need: Comprehensively understand computers and their associated software and hardware resources. Use this query when you need to count all computers' hardware configurations, see what software is installed on each computer, and generate IT asset reports.

Steps:

  1. Create Query:

    • Click "Create Query" button
    • Enter query name: "computer-software-inventory"
    • Enter display name: "Computer Software and Hardware Inventory"
    • Select query group
  2. Add CI Types:

    • Find and check the following types in the type tree:
      • Computer
      • Installed Software
      • Disk
      • File System
      • Digital Certificate
      • IP Address
      • Network Adapter
      • Endpoint
      • Application
    • Click "Add" button
  3. Create Relationships:

    • Drag from Computer node to Installed Software, select contains relationship
    • Drag from Computer node to Disk, select contains relationship
    • Drag from Computer node to File System, select contains relationship
    • Drag from Computer node to Digital Certificate, select uses relationship
    • Drag from Computer node to IP Address, select uses relationship
    • Drag from Computer node to Network Adapter, select contains relationship
    • Drag from Computer node to Endpoint, select provides relationship
    • Drag from Application node to Computer, select depends on and runs on relationship
  4. Configure Link Conditions:

    • Select Computer node, switch to "Link Conditions" tab
    • Set all relationship condition types to Optional
  5. Configure Return Attributes:

    • Select simple mode, return all attributes
    • Set each node to include subtypes
  6. Preview Results:

    • Click "Preview" button to view query results
    • Switch to graph view to see computers and their associated software and hardware resources

Expected Result: Query returns all computers and their associated software and hardware information (disks, file systems, installed software, IP addresses, network adapters, digital certificates, endpoints, etc.). Optional relationships mean these associated resources may or may not exist.

Query Structure:

  • Node count: 9
  • Relationship count: 8
  • Root node: Computer

Example 2: Network Computer Topology Query

Business Need: Visually display physical and logical connections between network devices and end computers. Use this query when you need to view the entire network's device connection architecture and trace the complete path from core network devices to end computers.

Steps:

  1. Create Query:

    • Click "Create Query" button
    • Enter query name: "network-computer-topology"
    • Enter display name: "Network Computer Topology"
    • Select query group
  2. Add CI Types:

    • Find the following CI types in the type tree and add them as query nodes:
      • Network Device: Drag to canvas twice, rename to "Network Device 1" and "Network Device 2" (set "Network Device 1" as root node)
      • Network Interface: Drag to canvas three times, rename to "Network Interface 1", "Network Interface 2", and "Network Interface 3"
      • Computer: Drag to canvas once, rename to "Computer"
      • Network Adapter: Drag to canvas once, rename to "Network Adapter"
  3. Create Relationships:

    • Drag from Network Device 1 to Network Interface 1, select contains relationship
    • Drag from Network Interface 1 to Network Interface 2, select connects to relationship
    • Drag from Network Device 2 to Network Interface 2, select contains relationship
    • Drag from Network Device 1 to Network Interface 3, select contains relationship
    • Drag from Computer to Network Adapter, select contains relationship
    • Drag from Network Adapter to Interface 3, select connects to relationship
  4. Configure Link Conditions:

    • Select all nodes, set each relationship's condition type to Exists
    • Ensure topology path is complete
  5. Configure Return Attributes:

    • Select simple mode, return all attributes
    • Set each node to include subtypes
  6. Preview Results:

    • Click "Preview" button to view query results
    • Switch to graph view to see the complete network topology

Expected Result: Query returns the complete network topology including core network devices, interface connections, and the complete path to end computers.

TQL Structure:

  • Node count: 7
  • Relationship count: 6
  • Root node: Network Device 1

Comparison of Both Queries

FeatureComputer InventoryNetwork Topology
Root NodeComputerNetwork Device 1
Node Count97
Relationship Count86
Relationship CharacteristicMostly optionalAll exists (required)
Business PurposeIT asset statistics, software complianceNetwork architecture visualization, fault troubleshooting

Notes

Pre-save Checklist

Before saving a query, ensure:

  • ✓ No isolated nodes in the query graph
  • ✓ All relationships have link conditions configured
  • ✓ Attribute filter condition syntax is correct
  • ✓ Return attribute configuration is complete
  • ✓ Type filter rules are set correctly

Performance Optimization Tips

  1. Use attribute filters wisely: Add filter conditions to reduce returned data volume
  2. Configure return attributes precisely: Return only needed attributes, avoid returning too many fields
  3. Control query scope: Use type filters to precisely control the CI type range of the query
  4. Avoid circular dependencies: Be careful not to create circular dependency relationships
  5. Use preview to validate: Use preview to verify query results before saving

System Limits

  • Query name max length is 100 characters
  • Attribute filter and link condition nesting cannot exceed 5 levels