PGQLをトランスレートして生成したSQLをレポートのソースとした、Oracle APEXのアプリケーションを作成したことがあります。
PGQLの2層モードで生成されるSQLをAPEXのレポートに組み込む4.1.5 Granting System and Object Privileges for SQL Property Graphs
GRANT CREATE PROPERTY GRAPH, CREATE ANY PROPERTY GRAPH,
ALTER ANY PROPERTY GRAPH, DROP ANY PROPERTY GRAPH,
READ ANY PROPERTY GRAPH TO APEXDEV;
[oracle@apex ~]$ sqlplus system/********@localhost/freepdb1
SQL*Plus: Release 23.0.0.0.0 - Developer-Release on Fri Apr 7 15:34:54 2023
Version 23.2.0.0.0
Copyright (c) 1982, 2023, Oracle. All rights reserved.
Last Successful login time: Fri Apr 07 2023 15:34:44 +09:00
Connected to:
Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release
Version 23.2.0.0.0
SQL> GRANT CREATE PROPERTY GRAPH, CREATE ANY PROPERTY GRAPH,
ALTER ANY PROPERTY GRAPH, DROP ANY PROPERTY GRAPH,
READ ANY PROPERTY GRAPH TO APEXDEV; 2 3
Grant succeeded.
SQL> exit
Disconnected from Oracle Database 23c Free, Release 23.0.0.0.0 - Developer-Release
Version 23.2.0.0.0
[oracle@apex ~]$
テスト・データより、送金元と送金先が同じ行を削除します。
delete from sqlcl_bank_txns where from_acct_id = to_acct_id;
select acct_id, count(*) as NumDeposits
from graph_table(sqlcl_bank_graph
match
(m is account) -[e is transfer] ->(v is account)
columns (v.acct_id)
)
group by acct_id
order by NumDeposits desc
fetch first :P2_ROWS rows only;
5 SQL GRAPH_TABLE Queries
select from_acct_id, amount, to_acct_id, description
from graph_table(sqlcl_bank_graph
match
(s is account where s.acct_id member of apex_string.split_numbers(:P3_ACCT_IDS,',')) -[e is transfer]->(d is account)
columns (s.acct_id as from_acct_id, e.amount as amount, d.acct_id as to_acct_id, e.description as description)
);