C Known Issues for Graph Studio

You can learn about the issues you may encounter when using Graph Studio and how to work around them.

Syntax error not thrown for a missing closing parenthesis ")" in a Java paragraph in Notebook

Syntax error must be thrown when executing a %java-pgx paragraph containing an incomplete Java statement due to a missing closing parenthesis. However, the Java interpreter in notebook, returns a Successful execution: No result returned message, which is incorrect. For example:

%java-pgx
out.println("This line is problematic";
<small><i>Successful execution: No result returned.</i></small>

This is because internally the paragraphs are interpreted through JShell which considers the incomplete command statement to be of multiple lines. Until a command termination using the closing parenthesis is executed, any other execution of %java-pgx in the subsequent paragraphs inside the notebook are considered as continuation of the incomplete statement and therefore will produce incorrect results. For example, executing the following paragraph after running the preceding code does not retrieve the graph configurations as expected:

%java-pgx
PgxGraph g = session.getGraph("BANK_GRAPH")
<small><i>Successful execution: No result returned.</i></small>

Workaround

To work around this problem, you can use one of the following options:

  • Restore the notebook environment to the normal state by performing the following steps:
    1. Execute a closing parenthesis statement in a new %java-pgx paragraph to mark the termination of the incomplete statement as shown:
      %java-pgx
      )
      Error:
      ')' expected
      out.println("This line is problematic";
                                            ^

      Running the code displays the error message.

    2. Fix the incorrect statement to include the closing parenthesis and re-execute the statement.
      %java-pgx
      out.println("This line is problematic");
      This line is problematic
  • Restart the environment. See Manually Manage the Compute Environment for more information to restart the environment.

After implementing one of the workaround options, any execution of %java-pgx paragraphs in the notebook will produce the desired results. For example:

%java-pgx
PgxGraph g = session.getGraph("BANK_GRAPH")

PgxGraph[name=BANK_GRAPH,N=1000,E=5001,created=1628583419041]