Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
On this page

Show all

Visual Query

Updated on 2024-11-04 GMT+08:00

In the graph editor, you can create graph query statements by dragging and dropping vertices and edges, and preview the query results without writing any code.

Procedure

  1. In the left pane of the graph editor, click the Visual Query tab.
    Figure 1 Visual query
  2. Add a vertex to the canvas.
    1. In the Add Vertex Pattern tab, all vertex labels and edge labels of the graph are displayed. Each label is displayed as a card that can be dragged to the canvas. Select a vertex label and drag it to the canvas.
      The Cypher query statement below changes with your operations.
      NOTE:

      These vertex labels and edge labels are the same as those in the metadata list in Editing Schema.

    2. Drag the labels you want to use for the query to the canvas and click Execute Query. The graph result is displayed on the right of the canvas.
      You can view the running records of the Cypher query statement in the Running Record tab below the canvas. Click Query Result to view the result.
      Figure 2 Query result
      NOTE:
      Query results can be displayed only when there is only one submap pattern on the canvas. If there are multiple disconnected submaps or isolated vertices, you must add edges to connect the submaps or isolated vertices. You can also set multiple labels to reconstruct your query mode. Otherwise, when you click Query, the system displays a message indicating that there are multiple submap patterns.
      Figure 3 Multiple submap patterns
  3. Add a vertex filter.
    Click a vertex in the canvas. The Filter tab page is displayed in the left pane. On the Filter tab, specify labels, vertex ID, and property search criteria to search for the vertex labels you want to view on the canvas.
    Figure 4 Adding a vertex search criterion
    • Vertex V1: Cypher variable ID (vertex identifier in the Cypher query statement below the canvas), which is named based on the sequence in which vertices are dragged to the canvas, for example, V1, V2, and more alike.
    • Label: Set one or more labels to search for target vertices. The logical operator between each two labels is OR.
    • Vertex ID: It is equivalent to a filter criterion. After adding a vertex ID to a vertex label, you can click Query to query the vertex labels with the same vertex ID.
    • Constraints: Specify a property contained in the vertex label. Currently, a property with multiple values is not supported.
      • Property: Property contained in the label.
      • Operator: Comparison operators (>,>=,<,<=,=,<>), null judgment operators (is null, is not null), and string comparison operators (starts with, ends with, contains) are supported.
        NOTE:

        starts with searches for a property that starts with a specified string; ends with searches for a property that ends with a specified string; contains searches for a property that contains a specified string.

      • Value: Property value. The attribute value type must be the same as that in the metadata. If the attribute value is of the character type, you need to use single quotation marks ('').
      • : Delete the constraint.
    • + button: Add a criterion.
    • Delete: Delete the added criterion.

    Click Execute Query in the canvas again. The query result is displayed on the right of the canvas.

  4. Add an edge (connect two vertices on the canvas):

    Double-click a vertex. After the border of the vertex turns gray (do not move the cursor out of the gray border), click and drag a line from the vertex to another vertex.

    The Cypher query statement below changes with your operations.

    Figure 5 Gray border of a vertex
    Figure 6 Adding an edge
  5. Add an edge filter.

    Click an edge in the canvas. The Filter tab page is displayed in the left pane. On the Filter tab, specify labels, direction, hops, and property search criteria to search for the edge labels you want to view on the canvas.

    Figure 7 Adding an edge filter
    • Edge e2: Cypher variable ID, which is named based on the sequence in which edges are added to the canvas, for example, e1, e2, and more alike.
    • Label: Set one or more labels to search for target edges. The logical operator between each two labels is OR.
    • Direction: Select the direction contained in the edge label.

      When the slider is toggled on, the edge is a directed one. When the slider is toggled off, the edge is undirected (or called bidirectional).

      If the edge is directed, the arrow on the canvas indicates the direction of the edge. You can click Change Direction to change the direction of the selected edge on the canvas.

    • Hops: The default value is 1. The value range is [0, 20). You can specify a number or a range.
      • If you enter an integer, it will be used as the number of hops in the edge pattern.
      • If you enter two integers in the format of minHops..maxHops, for example, 2..3, the number of hops in the edge pattern is within the range of [2,3].
    • Constraints: Specify a property contained in the edge label. Currently, a property with multiple values is not supported.
      • Property: Property contained in the label.
      • Operator: Comparison operators (>,>=,<,<=,=,<>), null judgment operators (is null, is not null), and string comparison operators (starts with, ends with, contains) are supported.
        NOTE:

        starts with searches for a property that starts with a specified string; ends with searches for a property that ends with a specified string; contains searches for a property that contains a specified string.

      • Value: Property value. The attribute value type must be the same as that in the metadata. If the attribute value is of the character type, you need to use single quotation marks ('').
      • : Delete the constraint.
    • + button: Add a criterion.

      If there is more than one criterion, click next to AND to set the logical operator (AND or OR).

      Figure 8 Selecting a logical operator
      NOTE:

      The priority of AND is higher than OR. The suggested calculation sequence is as follows:

      1. Arrange all AND operations first.
      2. Then, perform all OR operations.

      In the following example, the edge search criterion is userid < 100 AND gender = 'male' OR userid > 50 AND age = '18-24'.

      The operation sequence is:

      (userid < 100 AND gender = 'male') and (userid > 50 AND age = '18-24') are operated first, and result1 and result2 are recorded respectively.

      Then, result1 OR result2 is operated.

      • Delete: Delete the added criterion.

      Click Execute Query in the canvas again. The query result is displayed on the right of the canvas.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback