Help Center > > User Guide> Getting Started with GES> Querying and Analyzing Graphs

Querying and Analyzing Graphs

Updated at: Mar 13, 2020 GMT+08:00

This section describes how to use GES to query and analyze the sample graph data. The process is as follows:

Step 1: Creating a Graph

Step 2: Accessing the Graph

Step 3: Querying and Analyzing the Graph

Step 4: Viewing the Analysis Result

Step 1: Creating a Graph

  1. Log in to the GES management console and click Create Graph. The Create Graph page is displayed.
  2. Configure the following parameters:
    • Set the Region.

      Region: Area where a graph works. You can select the region from the drop-down list in the upper left corner of the page.

    • Set the graph name and software version.
      Figure 1 Graph name and software version
      • Specify the Graph Name, for example, demo, or use the default name in the system.

        The graph name must comply with the following rules:

        • Contain 4 to 64 characters and start with a letter.
        • Letters are case-insensitive.
        • Only letters, digits, hyphens (-), and underscores (_) are allowed.
      • Select the GES Software Version as required.

        Currently, only the default version can be selected.

    • Specify the network information, including the VPC, Subnet, Security Group, and Public Network Access.
      Figure 2 Network information
      • VPC: A Virtual Private Cloud (VPC) is a secure, isolated, and logical network environment.

        Select the VPC for which you want to create the graph and click View VPC to view the name and ID of the VPC.

        If no VPC is available, create one.

      • Subnet: A subnet provides dedicated network resources that are logically isolated from other networks, improving network security.

        Select the subnet for which you want to create the graph to enter the VPC and view the name and ID of the subnet.

      • Security Group: A security group is a logical group. It provides access control policies for the ECSs that are mutually trusted and have the same security protection requirements in a VPC.
        • Click Learn how to configure a security group. to learn how to configure a security group.
        • Click View Security Group to learn security group details.
      • Select the Public Network Access mode as required. Possible values are Do not use, Buy now, and Specify.
        • Do not use: A graph instance without an elastic IP (EIP) cannot be accessed over the Internet. However, the graph instance can be accessed through ECSs deployed on a private network.
        • Buy now: GES automatically allocates an EIP with exclusive bandwidth to the graph instance so that the graph instance can be accessed over the Internet using the EIP. In addition, GES uses the tenant permission to create an agency with the prefix of ges_agency_default automatically in the project to support EIP binding.
        • Specify: An EIP allows the graph instance to be accessed over the Internet.

          Click Create EIP to access the VPC management console and create an EIP.

    • Set graph parameters.
      Figure 3 Graph parameters
      • Cross-AZ HA: This option is disabled by default. If you enable this option, the graph can be used across AZs.
      • Purpose: Select Enterprise production or Developer learning.
        • Enterprise production: Supports high reliability and concurrency, suitable for enterprise production and large-scale application.
        • Developer learning: Offers complete function experience, suitable for developer learning.
      • Graph Size (Edges): Based on a user's current quota, the system displays the numbers of graphs and edges that can be created. The unit is edge. Enterprise production and Developer learning have different graph specifications.
        • Enterprise production: Currently, Million-edge, Ten-million-edge, Hundred-million-edge, Billion-edge, Ten-billion-edge, and One-hundred-billion-edge are supported.
        • Developer learning: Currently, only Ten-thousand-edge is supported.
      • Initial Data Required: This option is disabled by default. If it is enabled, you need to configure the following parameters.
        • Metadata: Indicates the graph metadata information. If no metadata is available, click Create Metadata File. For details about how to create a metadata file, see Metadata Management.
        • Edge Data: Describes edges that form the graph, including information about the edge structures, labels, and properties.
        • Vertex Data: Describes vertices that form the graph, including information about all vertex IDs, labels, and properties. If you leave it blank, the vertices in the Edge Data set are used as the source of Vertex Data.
        • The edge and vertex data sets can only be stored in English paths and folders.
        • The sequence of labels in the selected edge or vertex data set and the sequence of properties in the labels must be the same as those in the selected metadata file. Otherwise, The edge/vertex data file does not match the metadata file is prompted in the upper right corner and the graph fails to be created. For details about the data formats of GES graph data, see Graph Data Formats.
        • Log Storage Path: Stores vertex and edge data sets that do not comply with the metadata definition, as well as detailed logs during graph import. Storage on OBS may incur fees, so delete the data in a timely time if you do not need to use it any more.
        • Edge Processing: Includes Allow repetitive edges, Ignore subsequent repetitive edges, Overwrite previous repetitive edges, and Ignore labels on repetitive edges.

          Repetitive edges have the same source vertex and target vertex. When labels are considered, repetitive edges must have the same source and target vertices and the same labels.

          Allow repetitive edges: Multiple edges may exist between a source vertex and a target vertex.

          Ignore subsequent repetitive edges: If there are multiple edges between a source vertex and a target vertex, only the first edge read is retained.

          Overwrite previous repetitive edges: If there are multiple edges between a source vertex and a target vertex, only the last edge read is retained.

          Ignore labels on repetitive edges: If labels are ignored, edges with the source vertex and target vertex are repetitive edges.

        • Currently, you can import the edge and vertex data sets only from OBS. Therefore, store data files on OBS in advance.
        • Import the graph data (including the metadata file, and edge and vertex data sets) in the format specified in the corresponding template. The template contains a copy of movie data. You can click Download to download and import it.
  3. Click Next. The Confirm page is displayed.
  4. Confirm the information and click Submit to create the graph.
  5. After the submission is successful, the Finish page is displayed. You can click Back to Task Center to view the status and running result of the created graph.

Step 2: Accessing the Graph

  1. On the Graph Management page, locate the row containing the graph to be accessed, for example, demo created in the previous steps, and click Access in the Operation column.
  2. Enter the displayed graph editor, and query and analyze the current graph. For details, see Step 3: Querying and Analyzing the Graph.

Step 3: Querying and Analyzing the Graph

  • Queries using Gremlin commands
    1. Enter the query command in the Gremlin text box in the lower part of the page, for example, g.V().limit(100).

      To prevent the system queries from being time-consuming due to a large amount of returned data, you are advised to add the limit parameter and set it to less than 1,000 for a better display effect.

      Figure 4 Gremlin query
    2. Press Enter to run the Gremlin command. The query result is displayed in both the drawing area and result area.
      Figure 5 Gremlin query result
  • Analysis by selecting algorithms and configuring parameters
    1. The algorithms supported by GES are displayed in the left pane of the graph editor. Select the target analysis algorithm from the list.
      Figure 6 Algorithm list
    2. Select the algorithm to be used, Click to expand its parameter configuration, and input corresponding values based on the required range. Take PageRank as an example. alpha indicates the weight coefficient, and its value is 0.85. convergence is the convergence coefficient, and its value is 0.00001. max_iterations indicates the maximum iterations and its value is 1,000. directed indicates whether to consider the edge direction and the default value is true.
      Figure 7 Setting PageRank algorithm parameters
    3. Execute the algorithm by clicking . The analysis result is displayed in both the drawing area and result area.
      Figure 8 Analysis result

Step 4: Viewing the Analysis Result

You can view the running record and query result in the result area or click the Export button on the right to download the analysis result.

Did you find this page helpful?

Submit successfully!

Thank you for your feedback. Your feedback helps make our documentation better.

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel