Create a Property Graph from Scratch

You can create graphs from scratch by using the CREATE PROPERTY GRAPH statement in the Query Playground page.

To create a graph from scratch:
  1. Click Graphs on the left navigation menu and navigate to the Graphs page.
  2. Click </> Query in the Property Graph tab and navigate to the Query Playground page.
  3. Enter a CREATE PROPERTY GRAPH statement to create a graph. For example:
    CREATE PROPERTY GRAPH BANK_GRAPH
      VERTEX TABLES (
        bank_accounts
          KEY ( id )
          LABEL Accounts PROPERTIES ( id, name )
      )
      EDGE TABLES (
        bank_txns
          SOURCE KEY ( from_acct_id ) REFERENCES bank_accounts (id)
          DESTINATION KEY ( to_acct_id ) REFERENCES bank_accounts (id)
          LABEL transfers PROPERTIES ( amount, description, from_acct_id, to_acct_id, txn_id )
      )OPTIONS (PG_PGQL)
  4. Click Run.

    This creates a graph of type PGQL Property Graph. It is essentially a property graph view over data that is stored in the relational database tables.