Build a Graph Manually

You can choose to manually create a property graph in Graph Studio using the database tables you selected in the Select Tables step of the property graph wizard.

See Create a Property Graph from Existing Relational Tables for instructions on getting started with the property graph wizard, selecting the source database tables, and choosing to create a graph in manual mode.

You can then build the graph manually inside the Designer tab at the Define Graph step of the graph creation workflow. The following figure shows the Designer tab panel.



You can perform any of the following manual actions in this panel.

  • Add, edit, or delete graph vertices or edges based on the selected database tables.
  • Configure labels, keys, and properties for the graph vertices or edges.
  • Add new edges between two vertex tables visually through drag and drop action.

In the preceding figure, the Vertices and Edges sections in the left pane display the graph's vertices and edges, respectively. The property graph is visually represented in the right pane.

The following steps enable you to build a graph manually. The instructions assume that you are at the Define Graph step of the property graph wizard.

  1. Create a vertex.
    1. Click + in the Vertices section in the left pane.
      Alternatively, you can click Create Vertex in the right pane.

      The Create Vertex slider opens as shown:


      Description of create_vertex_manually.png follows
      Description of the illustration create_vertex_manually.png

    2. Select the Vertex Table.
      The list of choices for the vertex table is obtained from the input tables selected in the Select Tables step of the property graph wizard.
    3. Select the Vertex Table.
    4. Select the Vertex Key.
      Note that the key column must be unique (primary) key.
    5. Optionally, enter the Vertex Label.
    6. Optionally, select the Vertex Properties.
      You can choose any combination of the columns of the vertex table as vertex properties. By default, these vertex properties will automatically be assigned the name of the column. If you wish to add all the columns of the vertex table, then you can simply click Add all properties.
    7. Click Create Vertex.
    Repeat this step to add as many vertices as required.

    The newly added vertices are listed in the left pane under Vertices and also visually displayed in the right pane as shown.


    Description of vertices_section.png follows
    Description of the illustration vertices_section.png

    Optionally, you can choose to perform any of the following actions on a vertex:

    • Click on a vertex in the right pane to view the vertex properties.
    • Click the edit icon in a vertex row in the left pane to edit the vertex label or properties values.
    • Click the delete icon in a vertex row in the left pane to remove the vertex.

    All vertices added, updated, or deleted in the Designer tab will be reflected in the CREATE PROPERTY GRAPH statement in the Source tab and also in the Editor tab.

  2. Create an edge.
    1. Click + in the Edges section in the left pane.

      Alternatively, click Create Edge in the right pane to activate the mode to add a new edge visually. In this mode, starting a drag action from a vertex will start drawing an arrow (depicting an edge) from the source vertex until it is released on the destination vertex. Drag an arrow from the desired source vertex and drop it on the target destination vertex to add a new edge.

      The Create Edge slider opens as shown:


      Description of create_edge_slider.png follows
      Description of the illustration create_edge_slider.png

    2. Select the Source and Destination vertex tables.
      Skip this step if you created the edge using visual mode.
    3. Select the Edge Table.
      The list of choices for the edge table is obtained from the input tables selected in the Select Tables step of the property graph wizard.
    4. Select the Edge Source key and Edge Destination key.
    5. Select the source and destination vertex keys using the References source vertex key and References destination vertex key drop-downs respectively.
      Note that these key columns must correspond to a unique (foreign) key of the source and destination vertex tables.
    6. Enter the Edge Label.
    7. Optionally, select the Edge Properties.
      You can choose any combination of the columns of the vertex table as vertex properties. By default, these vertex properties will automatically be assigned the name of the column. If you wish to add all the columns of the vertex table, then you can simply click Add all properties.
    8. Click Create Edge.
    Repeat this step to add as many edges as required.

    The newly added edges are listed in the left pane under Edges and also visually displayed in the right pane. For example:


    Description of des_tab_edge_section.png follows
    Description of the illustration des_tab_edge_section.png

    Optionally, you can choose to perform any of the following actions on an edge:

    • Click on an edge in the right pane to view the edge properties.
    • Click the edit icon in an edge row in the left pane to update the edge.
    • Click the delete icon in an edge row in the left pane to remove the edge.

    All edges added, updated, or deleted in the Designer tab will be reflected in the CREATE PROPERTY GRAPH statement in the Source tab and also in the Editor tab.

  3. Proceed to complete the graph creation following the instructions from step-9 onwards as explained in Create a Property Graph from Existing Relational Tables.