4.4.2 Javaを使用したグラフ構成の定義
グラフをOracle Databaseからロードするには、まずGraphConfigBuilderクラスを使用してグラフ構成オブジェクトを定義してから、グラフをグラフ・サーバー(PGX)に読み込みます。
例4-4 GraphConfigBuilder
を使用したグラフ・サーバー(PGX)へのグラフの読込み
GraphConfig cfg = GraphConfigBuilder.forPropertyGraphRdbms()
.setJdbcUrl("jdbc:oracle:thin:@<host>:<port>/<sid>")
.setUsername("<username>")
.setPassword("<password>")
.setName("bank_graph_analytics")
.addVertexProperty("id",PropertyType.INTEGER)
.addEdgeProperty("amount",PropertyType.INTEGER)
.setPartitionWhileLoading(PartitionWhileLoading.BY_LABEL)
.setLoadVertexLabels(true)
.setLoadEdgeLabel(true)
.build();
PgxGraph "bank_graph_analytics" = session.readGraphWithProperties(cfg);
詳細は、Oracle Databaseのプロパティ・グラフ・スキーマ・オブジェクトを参照してください。