Enable Visible Graph Mode

Visible Graph mode allows you to store your visible graph along with any graph manipulation actions in a variable. You can later use this variable in your further queries.

To enable visible graph mode and to use the visible graph mode variable:

  1. Click Settings on the Visualization panel.
    This opens the Settings dialog.
  2. Click the General tab.
  3. Switch on the Enable Visible Graph Mode toggle in the Visible Graph Sharing section.
  4. Optionally, change the default name of the variable in the Global Variable Name field.
  5. Click the clipboard_icon icon to copy the visible graph mode variable name to the clipboard.
  6. Click X on the top-right to close the Settings dialog.

    The graph data gets stored in the variable. You can now query the vertices and edges of the graph using the variable as shown:

    • Vertices: <visible_graph_mode_variable_name>.get("V")
    • Edges: <visible_graph_mode_variable_name>.get("E")
  7. Use the variable in your further queries.

    The following example creates a prepared statement for a query. The visible graph mode variable is used in the setArray method to set the bind variable to an array of values.

    %java-pgx
    var prepared_stmnt = graph.preparePgql("SELECT * FROM MATCH (v) WHERE v.acct_id IN ?");
    prepared_stmnt.setArray(1, visible_graph.get("E"));
    var r = prepared_stmnt.executeQuery();
    out.println(prepared_stmnt.executeQuery());