6.9.3.3 Working with Property Graph Objects

You can view all the property graph objects existing in your database schema by expanding PG Objects under the Property Graph node in the Connections navigator.

You can run PGQL queries for a property graph object in a PGQL Worksheet. Note that you can execute only one PGQL query at a time in the worksheet.

The following steps show a few examples for creating, updating and dropping a property graph object using SQL Developer.

  1. Right-click the Property Graph node and select Open PGQL Worksheet.
    PGQL Worksheet opens in a new tab and it contains the Run Query icon for executing PGQL queries.
  2. Create a property graph object by running a CREATE PROPERTY GRAPH statement in the PGQL Worksheet. For example:

    Figure 6-8 Creating a Property Graph Object

    Description of Figure 6-8 follows
    Description of "Figure 6-8 Creating a Property Graph Object"

    The result of the query execution is displayed in the bottom pane of the Editor. On successful query execution, you can right-click and refresh the PG Objects node to view the newly created graph under PG Objects.

  3. Click on the newly created graph.
    This opens a PGQL Worksheet in a new tab with the following default query:
    SELECT id(e), id(v), id(n) FROM MATCH (v)-[e]-(n) ON <graph_name> LIMIT 100
  4. Run any PGQL update query like performing an INSERT or an UPDATE operation against a property graph object.
    For example, the following shows the execution of a PGQL UPDATE query:

    Figure 6-9 Updating a Property Graph Object

    Description of Figure 6-9 follows
    Description of "Figure 6-9 Updating a Property Graph Object"

    The related edge is updated in the graph.

  5. Run a PGQL SELECT query to view the newly updated edge as shown:

    Figure 6-10 Running a PGQL SELECT Query

    Description of Figure 6-10 follows
    Description of "Figure 6-10 Running a PGQL SELECT Query"
  6. Delete the Property Graph Object as shown:

    Figure 6-11 Dropping a Property Graph Object

    Description of Figure 6-11 follows
    Description of "Figure 6-11 Dropping a Property Graph Object"

    The graph is dropped.