Driver:
psycopg2
Apache AGE is a PostgreSQL extension that adds graph database functionality, enabling you to run openCypher queries alongside traditional SQL. This backend lets Semantica use AGE as a property graph store with the same interface as Neo4j and FalkorDB.
Prerequisites
Apache AGE must be compiled and installed into your PostgreSQL instance. See the AGE installation guide.
Quick Start
- Unified Facade
- Direct (ApacheAgeStore)
Use
GraphStore(backend="age", …): the same interface as Neo4j and FalkorDB:Configuration
Environment Variables
Programmatic Configuration
Connection & Initialization
Onconnect(), the store performs idempotent setup: safe to call repeatedly:
1
Load the extension
CREATE EXTENSION IF NOT EXISTS age;2
Activate AGE in the session
LOAD 'age';3
Set the search path
SET search_path = ag_catalog, "$user", public;4
Create the graph
Creates the named graph if it does not already exist.
ID Handling
Apache AGE auto-generates internal vertex/edge IDs (large integers). These are not the same as any semantic or application-level ID you may want to assign.Label Handling
AGE supports exactly one label per vertex. Semantica handles this transparently:labels[0]→ used as the primary AGE vertex label.labels[1:]→ stored in alabelsproperty array on the vertex.
Cypher Query Execution
All Cypher queries are executed via AGE’s SQL wrapper:Parameter Substitution
AGE does not support$param style binding inside cypher() calls. The store safely converts parameters to Cypher literals with proper escaping:
Column Specification
For custom queries, pass thecols option to specify the AS clause:
RETURN clause.
Transactions
The store uses explicit PostgreSQL transactions:- Success →
COMMIT - Exception →
ROLLBACK, then re-raise asProcessingError - No silent failures
