Migrating PGQL Property Graphs to SQL Property Graphs

You can call the migrate_pgql_to_sql function to migrate a PGQL property graph to SQL property graph.

The migrate_pgql_to_sql function accepts the following parameters:

Note: PGQL property graphs based on database views cannot be migrated.

Example: Migrating a PGQL Property Graph to SQL Property Graph

The following example assumes that the PGQL property graph FRIENDS exists in Oracle AI Database 26ai.

opg4j> var jdbcUrl="jdbc:oracle:thin:@<host_name>:<port>/<db_service>"
opg4j> var conn = DriverManager.getConnection(jdbcUrl,"<username>","<password>")
opg4j> PgqlConnection pgqlConn = PgqlConnection.getConnection(conn)
opg4j> PgqlStatement pgqlStmt = pgqlConn.createStatement()
opg4j> pgqlStmt.execute("CALL pg.migrate_pgql_to_sql('GRAPHUSER', 'FRIENDS', 'GRAPHUSER', 'FRIENDS_SQL_GRAPH')")
$9 ==> false
Connection conn = DriverManager.getConnection(<jdbcUrl>, <username>, <password>);
PgqlConnection pgqlConn = PgqlConnection.getConnection(conn);
PgqlStatement pgqlStmt = pgqlConn.createStatement();
pgqlStmt.execute("CALL pg.migrate_pgql_to_sql('GRAPHUSER', 'FRIENDS', 'GRAPHUSER', 'FRIENDS_SQL_GRAPH')");
>>> pgql_conn = opg4py.pgql.get_connection("<username>","<password>", "jdbc:oracle:thin:@<host_name>:<port>/<db_service>")
>>> pgql_statement = pgql_conn.create_statement()
>>> pgql_statement.execute("CALL pg.migrate_pgql_to_sql('GRAPHUSER', 'FRIENDS', 'GRAPHUSER', 'FRIENDS_SQL_GRAPH')")
$4 ==> false