Graph Edit

Updated at:

The Graph Compute iGraph graph model supports data tables of various index types, including KV, KKV, and inverted index.

Graph Edit

The left-side menu on the Graph Edit page contains Graph Edit, Graph Operations, and Graph Query. The canvas in the center displays the graph model, such as the vertices user_a and user_b, and a directed edge named know. The Graph Information panel on the right displays the graph name, description, publishing status, current editing version, active online version, and version history.

  • Publish: Publishes the current graph model and its data configurations. This action starts a data backflow task and creates a new version of the graph model with each publication.

  • Add Node and Add Edge: Use to add, modify, or delete vertices and edges.

  • Zoom (+/-) and Reset View: Use to zoom in or out on the graph and adjust the canvas view.

Create a vertex

  • Step 1: Click Add Node in the canvas toolbar. This adds a new vertex to the canvas.

The canvas displays an example graph model: user vertices form a self-referencing relationship through a relation edge.

  • Step 2: In the panel, enter a name for the vertex and click OK to create the vertex.

  • Step 3: Expand the details panel on the right to configure the data. You must add at least two fields.

Configuration options include: data source (with options for API update, MaxCompute data source, or MaxCompute data source + API update), index type (with options for KV, KKV, or inverted index), field structure (where for each field, you must set the field name, specify if it is a primary key, set its type, and provide a default value), data TTL (defaulting to 604800 seconds), and the scan .done partition switch. When you are finished, click Submit.

Create an edge

You can add an edge in two ways:

  • Step 1: Add an edge.

    • Recommended method: On the canvas, right-click an existing vertex, such as user_a, and select Add Edge from the context menu.

  • Step 2: In the panel, enter a name for the edge and click OK to create the edge.

  • Step 3: In the data configuration panel for the edge, complete the configuration. An edge must have at least three fields.

    Configuration options include Edge Name, Start Vertex Name, End Vertex Name, data source (with options for API update, MaxCompute data source, or MaxCompute data source + API update), field structure (where for each field, you must set the data type and select the checkboxes to designate the start field and end field), data TTL, and the scan .done partition switch. When you are finished, click Submit.

Data configuration

Select a vertex or an edge on the canvas and click Data Configuration in the lower-right corner to open the data configuration page.

Basic information

In this example, enter person for Label, select MaxCompute data source for data source, enter igraph_mock for Source Project, and enter thinkerpop_person for Source Table Name.

  • Label: The name of the selected vertex or edge.

  • Data source:

    • API update: Incremental data updates through SWIFT.

      • All data comes from the SWIFT message queue. After data backflow, the online system consumes messages in real time to enable real-time data updates.

        Mechanism: During data backflow, the build process pulls data from SWIFT to build indexes. The build task continues to run, periodically pulling update messages and building incremental index versions. Simultaneously, the online system consumes update messages in real time.

        Requirements and notes:

        • Records in an iGraph table that use SWIFT as a data source have a TTL, after which they automatically expire.

        • The TTL should not exceed 7 days. A longer period can be supported for specific business needs.

        • The engine supports persistent storage. If an index file is damaged or a write exception renders the index unavailable, you can restore data to a specified version.

    • MaxCompute data source: Full data updates.

      • Data is sourced from MaxCompute and fully updated through data backflow. During this process, the build task pulls data from MaxCompute to build indexes.

        Requirements and notes:

        • A new data backflow completely replaces the data from the previous backflow.

        • The corresponding MaxCompute partition must have at least one record.

        • The MaxCompute partition corresponding to the online data must exist.

        • Data from a MaxCompute data source does not require TTL management.

    • MaxCompute data source + API update: A combination of full and incremental data updates.

      • This option combines the two data source types above. The build process pulls data from both MaxCompute and SWIFT to build indexes. It supports the features of both data sources, meaning that full updates can run while incremental versions are continuously built, and the online system consumes updates in real time.

        Requirements and notes:

        • You must perform full data backflow periodically. The new full dataset must include all previous incremental data.

        • The data TTL is unlimited in this mode.

        • This timestamp marks the cutoff point for data included in the full dataset, establishing a starting point for subsequent incremental updates.

Index type and field structure

  • Index type

    • KV: You must specify a primary key field. A minimum of two fields is required.

    For example, add three STRING fields: pk, name, and lang. Then, select the Primary Key checkbox for the pk field to designate it as the primary key.

    • KKV: You must specify a start field and an end field. A minimum of three fields is required.

    For example, configure a pk field (type string, designated as the start field), a sk field (type string, designated as the end field), and a weight field (type DOUBLE). This configuration has three fields, meeting the minimum requirement.

    • Inverted index: You must configure index fields and a primary key field.

    For example, after selecting the inverted index index type, in the Field Structure area, add the fields id (type STRING) and component_id (type STRING, default value 0). Then, in the Index Fields area, add an index for each field and select the Primary Key checkbox for the id field to set it as the primary key.

  • Field structure

    • Defines the field attributes for the data table.

    • Import Fields:

      • If you use a MaxCompute data source, you must grant read permissions in advance. For more information, see Grant permissions on offline storage to Graph Compute.

Data TTL and .done partition

In this example, data TTL is set to 94608000, and scan .done partition is turned on.

  • Data TTL: The lifecycle of data.

    • If you use API update (for an incremental table), you must enter an appropriate TTL.

  • Scan .done partition

    • Select Yes. After a data partition is generated, a corresponding .done partition is also created. Graph Compute proactively scans for this .done partition to confirm that the partition is ready for data backflow.

    • Select No. After a data partition is generated, you must call the Graph Compute API to trigger data backflow for that partition.

Graph information

Version information

  • The basic version information for the graph model includes: publishing status, current editing version, active online version, and historical versions.

  • Switching versions only changes the graph model's configuration. To apply the changes, you must click Publish.

Graph information

This section displays the graph name and description. Only the description can be modified.