6.9.3.2 Working with Property Graph Views

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

You can run PGQL queries for a property graph view 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 view 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 view by running a CREATE PROPERTY GRAPH statement in the PGQL Worksheet. For example:

    Figure 6-5 Create a Property Graph View

    Description of Figure 6-5 follows
    Description of "Figure 6-5 Create a Property Graph View"

    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 Views object to view the newly created graph under PG Views.

  3. Click on the newly created graph.
    This opens a PGQL Worksheet in a new tab with the following default query:
    SELECT e, v, 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 view.
    For example, the following shows the execution of a PGQL INSERT query:

    Figure 6-6 Running a PGQL INSERT Query

    Description of Figure 6-6 follows
    Description of "Figure 6-6 Running a PGQL INSERT Query"

    The vertices and edges are added to the graph.

  5. Run a PGQL SELECT query to view the newly inserted vertices and edges as shown:

    Figure 6-7 Running a PGQL SELECT Query

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

    Figure 6-8 Dropping a Property Graph View

    Description of Figure 6-8 follows
    Description of "Figure 6-8 Dropping a Property Graph View"

    The graph is dropped.