Semantica Polyglot Graph Storage Options: Supported Backends and Unified APIs
Semantica supports interchangeable RDF triple stores (Oxigraph, Blazegraph, Apache Jena, RDF4J) and Labeled Property Graph databases (Neo4j, FalkorDB, Apache AGE, Amazon Neptune) through unified GraphStore and TripletStore APIs that require zero code modifications when switching backends.
The semantica-agi/semantica framework implements a polyglot persistence layer that abstracts diverse graph storage technologies behind consistent Python interfaces. This architecture allows developers to prototype with lightweight embedded databases and migrate to production-grade distributed systems by modifying only connection parameters. Understanding the full range of Semantica polyglot graph storage options enables optimal backend selection for semantic web workloads, high-performance traversals, and vector-augmented retrieval.
Graph Models and Supported Backends
Semantica distinguishes between two major graph storage paradigms, each with multiple swappable implementations.
RDF Triple Store Options
For semantic-web queries and SPARQL-driven analytics, Semantica supports:
- Oxigraph – Embedded, zero-configuration store ideal for development and testing
- Blazegraph – High-performance SPARQL endpoint for production analytics
- Apache Jena – Mature Java-based triple store with comprehensive ontology support
- Eclipse RDF4J – Flexible SPARQL engine with broad standard compliance
These backends handle ontology-centric workloads and complex inferencing tasks through the TripletStore abstraction.
Labeled Property Graph (LPG) Databases
For graph traversals and relationship-rich analytics, the GraphStore API supports:
- Neo4j – Production-grade graph database using the Cypher query language
- FalkorDB – Redis-backed ultra-low-latency graph for real-time applications
- Apache AGE – PostgreSQL extension that exposes Cypher over relational storage
- Amazon Neptune – Managed AWS graph service supporting OpenCypher
These options excel at recommendation engines, pathfinding, and real-time relationship queries.
Vector Storage Extensions
Semantica optionally integrates vector stores including PGVector, FAISS, and Qdrant for storing dense embeddings. This enables similarity search and semantic retrieval capabilities alongside traditional graph storage.
Implementing Polyglot Storage with GraphStore
The semantica.graph_store.GraphStore class presents a single, unified interface to all LPG backends. Instantiation requires only the backend parameter and connection-specific arguments.
Connecting to Neo4j
from semantica.graph_store import GraphStore
neo = GraphStore(
backend="neo4j",
uri="bolt://localhost:7687",
user="neo4j",
password="password",
)
neo.connect()
neo.create_node(labels=["Person"], properties={"name": "Alice"})
neo.close()
Connecting to FalkorDB
falkor = GraphStore(
backend="falkordb",
host="localhost",
port=6379,
graph_name="semantica",
)
falkor.connect()
falkor.create_node(labels=["Person"], properties={"name": "Bob"})
falkor.close()
Connecting to Apache AGE
age = GraphStore(
backend="age", # or "apache_age"
connection_string="host=localhost dbname=agedb user=postgres password=secret",
graph_name="semantica",
)
age.connect()
age.create_node(labels=["Person"], properties={"name": "Charlie"})
age.close()
Connecting to Amazon Neptune
neptune = GraphStore(
backend="neptune", # or "amazon_neptune"
endpoint="my-cluster.neptune.amazonaws.com",
port=8182,
region="us-east-1",
iam_auth=True,
)
neptune.connect()
neptune.create_node(labels=["Person"], properties={"name": "Dana"})
neptune.close()
Each implementation supports the connect(), create_node(), and close() methods with identical signatures, ensuring consistent behavior across vendors.
SPARQL-Ready RDF Storage with TripletStore
For RDF-centric workloads, the semantica.triplet_store.TripletStore class automatically selects the appropriate triple-store implementation based on the backend parameter.
from semantica.triplet_store import TripletStore
ts = TripletStore(backend="oxigraph") # or "blazegraph", "jena", "rdf4j"
ts.connect()
ts.add_triplet("<http://example.org/Alice>", "rdf:type", "foaf:Person")
results = ts.query("SELECT ?s WHERE { ?s a foaf:Person }")
ts.close()
This abstraction handles SPARQL query translation and triple serialization regardless of whether the underlying engine is embedded (Oxigraph) or remote (Blazegraph).
Architecture and Source Code Organization
The polyglot capabilities are implemented through adapter patterns in specific modules:
semantica/graph_store/– Contains concrete LPG adapters includingNeo4jStore,FalkorDBStore,ApacheAgeStore, andAmazonNeptuneStoresemantica/triplet_store/– Implements RDF adapters includingOxigraphStore,BlazegraphStore,JenaStore, andRDF4JStore
Documentation for these implementations resides in:
docs/reference/graph_store.md– Defines the unifiedGraphStoreAPI and backend configurationsdocs/reference/triplet_store.md– Describes RDF abstractions and engine-specific parametersREADME.md– Provides high-level polyglot storage concepts and quick-start guides
Zero-Code Migration Between Backends
Because all backends share identical method signatures, migrating from development to production requires only configuration changes. Switching from Oxigraph (local) to Blazegraph (production) involves changing only the backend argument and connection parameters—no source-code modifications are necessary.
Similarly, LPG migrations between Neo4j, FalkorDB, or Amazon Neptune rely solely on updating the GraphStore initialization dictionary. This polyglot approach decouples application logic from storage infrastructure, allowing teams to optimize for performance, licensing, or operational requirements without refactoring queries or data models.
Summary
- Semantica supports eight primary graph backends across RDF and LPG models, plus optional vector stores
GraphStoreunifies Neo4j, FalkorDB, Apache AGE, and Amazon Neptune behind identical Python methodsTripletStoreabstracts Oxigraph, Blazegraph, Apache Jena, and RDF4J for SPARQL workflows- Backend adapters live in
semantica/graph_store/andsemantica/triplet_store/modules - Zero-code migration is possible because only configuration parameters differ between implementations
Frequently Asked Questions
What backends does Semantica support for property graph storage?
Semantica supports Neo4j, FalkorDB, Apache AGE, and Amazon Neptune through the unified GraphStore API. These backends cover local development (Neo4j Desktop), ultra-low-latency caching (FalkorDB on Redis), PostgreSQL-compatible deployments (Apache AGE), and fully managed cloud infrastructure (Amazon Neptune).
How do I switch from a local development backend to production in Semantica?
Change only the backend parameter and connection arguments when instantiating GraphStore or TripletStore. For example, replace backend="oxigraph" with backend="blazegraph" and update the endpoint URI. All method calls—including connect(), create_node(), and query()—remain identical, requiring no application code changes according to the semantica-agi/semantica source code.
Does Semantica support vector storage for embeddings?
Yes, Semantica optionally integrates vector stores including PGVector, FAISS, and Qdrant for dense embedding storage and similarity search. These vector capabilities complement the graph storage layer for semantic retrieval workflows, though they operate as optional extensions rather than core graph backends.
Where are the backend adapter implementations located in the Semantica codebase?
Concrete adapter implementations reside in semantica/graph_store/ for LPG backends (Neo4jStore, FalkorDBStore, ApacheAgeStore, AmazonNeptuneStore) and semantica/triplet_store/ for RDF backends (OxigraphStore, BlazegraphStore, JenaStore, RDF4JStore). API documentation is maintained in docs/reference/graph_store.md and docs/reference/triplet_store.md.
Have a question about this repo?
These articles cover the highlights, but your codebase questions are specific. Give your agent direct access to the source. Share this with your agent to get started:
curl -s "https://instagit.com/install.md" Maintain an open-source project? Get it listed too →