bluetape4k-graph-age
Latest stable Based on Graph release 0.5.1
Before you run
Section titled “Before you run”AGE keeps graph data inside PostgreSQL and executes Cypher through SQL. Choose it when PostgreSQL ownership, backup, and transaction boundaries are required. Avoid it when the workload requires Bolt-native behavior, vendor-specific procedures, or a uniform superset of Neo4j capabilities. The adapter is AgeGraphOperations.kt.
Execution mode: release-fixture linked. The snippet shows the essential service setup; the complete test fixture starts PostgreSQL AGE, creates DataSource/Exposed state and ops, and closes operations, DataSource, and container in that order.
dependencies { implementation(platform("io.github.bluetape4k:bluetape4k-dependencies:<ecosystem-version>")) implementation("io.github.bluetape4k:bluetape4k-graph-age")}val dataSource = HikariDataSource(HikariConfig().apply { jdbcUrl = "jdbc:postgresql://localhost:5432/postgres" username = "postgres" password = "password" connectionInitSql = "LOAD 'age'; SET search_path = ag_catalog, \"\$user\", public;"})Database.connect(dataSource)val ops = AgeGraphOperations("social")ops.createGraph("social")val a = ops.createVertex("Person", mapOf("name" to "Alice"))val b = ops.mergeVertex("Person", mapOf("email" to "b@example.com"), mapOf("name" to "Bob"))ops.createEdge(a.id, b.id, "KNOWS")check(ops.neighbors(a.id, NeighborOptions(edgeLabel = "KNOWS")).single().id == b.id)Expected result
Section titled “Expected result”Expected: AGE returns numeric element IDs and the outgoing traversal finds Bob.
Semantics and capability boundary
Section titled “Semantics and capability boundary”AGE relies on Exposed/JDBC transaction context. transaction { } shares the PostgreSQL atomic boundary; pooled connections must run LOAD 'age' and set search_path. Merge is translated for AGE and must be verified with AgeGraphMergeOperationsTest.kt. Schema behavior is narrower than a generic graph DDL surface; inspect AgeGraphSchemaManager.kt.
The caller owns HikariDataSource. Closing operations does not replace data-source shutdown.
Operations checklist
Section titled “Operations checklist”- Record server/image version and selected graph/database.
- Watch connection-pool pressure and query latency.
- Verify transaction rollback and schema capability separately.
- Close operations before caller-owned Driver/DataSource.
Failure and recovery
Section titled “Failure and recovery”Symptom: SQL/agtype resolution fails before graph assertions. Evict the bad pooled connection, restore LOAD 'age' and search_path, verify the graph exists, then rerun on a fresh connection.
A missing graph, absent extension, stale search_path, or connection borrowed without initialization usually fails as SQL/agtype resolution before a domain assertion. Check PostgreSQL logs, pool acquisition, locks, SQLSTATE, graph name, and AGE version. Property conversion is bounded by AgeTypeParser.kt.
./gradlew :bluetape4k-graph-age:test --tests '*AgeGraphOperationsTest' --tests '*AgeGraphMergeOperationsTest'Expected: the Testcontainers AGE fixture creates, merges, traverses, and rolls back correctly. Retry-only success needs a connection-initialization or container-readiness note.
Complete release example
Section titled “Complete release example”The pinned AgeGraphOperationsTest defines the fixture values and is the complete executable release example. Run:
./gradlew :bluetape4k-graph-age:test --tests '*AgeGraphOperationsTest'Expected: the fixture starts, assertions pass, and owned resources close in the documented order.
Non-goals and related guides
Section titled “Non-goals and related guides”See Apache AGE guide, backend selection, and schema and transactions. This module does not manage PostgreSQL, hide AGE type limits, or promise Bolt/Cypher parity.
Release diagrams
Section titled “Release diagrams”These diagrams are loaded directly from README assets published with the 0.5.1 release and pinned to its immutable commit. They describe this manual’s released structure and runtime flows, not later Snapshot changes. Select a preview to open the SVG at the same release commit.
Module Layer Structure diagram
Section titled “Module Layer Structure diagram”Release README: graph/graph-age/README.md
Apache AGE diagram
Section titled “Apache AGE diagram”Release README: graph/graph-age/README.ko.md
agtype diagram
Section titled “agtype diagram”Release README: graph/graph-age/README.ko.md
graph age Architecture 12 diagram
Section titled “graph age Architecture 12 diagram”Release README: graph/graph-age/README.ko.md
AgeGraphOperations diagram
Section titled “AgeGraphOperations diagram”Release README: graph/graph-age/README.ko.md
AgeSql diagram
Section titled “AgeSql diagram”Release README: graph/graph-age/README.ko.md
AgeTypeParser diagram
Section titled “AgeTypeParser diagram”Release README: graph/graph-age/README.ko.md
createVertex diagram
Section titled “createVertex diagram”Release README: graph/graph-age/README.ko.md
createEdge diagram
Section titled “createEdge diagram”Release README: graph/graph-age/README.ko.md
shortestPath diagram
Section titled “shortestPath diagram”Release README: graph/graph-age/README.ko.md
neighbors () diagram
Section titled “neighbors () diagram”Release README: graph/graph-age/README.ko.md
HikariCP diagram
Section titled “HikariCP diagram”Release README: graph/graph-age/README.ko.md











