Docker Deployment

Batteries-Included Image

The ghcr.io/trickle-labs/pg-ripple:<version> image bundles six extensions in a single container:

ExtensionPurpose
pg_rippleRDF triple store with native SPARQL
PostGISGeospatial queries via GeoSPARQL
pgvectorVector similarity search for hybrid SPARQL + semantic
pg_trickleIncremental materialised SPARQL views
pg_tideRelay, outbox, and inbox subsystem for change-data capture

No additional setup is needed — simply start the container and CREATE EXTENSION.

Quick Start

docker run --rm -p 5432:5432 \
  -e POSTGRES_PASSWORD=ripple \
  ghcr.io/trickle-labs/pg-ripple:0.127.0
psql -h localhost -U postgres -c "CREATE EXTENSION pg_ripple CASCADE;"
psql -h localhost -U postgres \
  -c "SELECT pg_ripple.load_ntriples('<https://example.org/s> <https://example.org/p> <https://example.org/o> .');"

Enable optional extensions:

CREATE EXTENSION postgis;   -- GeoSPARQL functions
CREATE EXTENSION vector;    -- hybrid vector + SPARQL search

Docker Compose

The repository ships a docker-compose.yml that starts pg_ripple and the SPARQL HTTP service together:

docker compose up -d
curl http://localhost:7878/health
curl -G http://localhost:7878/sparql \
  --data-urlencode "query=SELECT * WHERE { ?s ?p ?o } LIMIT 10"

Pre-Installed Extension Versions

ExtensionVersionNotes
pg_ripple0.127.0RDF triple store with native SPARQL
PostGIS3.5.6Geospatial queries via GeoSPARQL
pgvector0.8.2Vector similarity search for hybrid SPARQL + semantic
pg_trickle0.57.0Incremental materialised SPARQL views
pg_tide0.33.0Relay, outbox, and inbox for CDC

Environment Variables

VariableDefaultDescription
POSTGRES_PASSWORD(required)Superuser password
POSTGRES_DBpostgresDatabase to create
POSTGRES_USERpostgresSuperuser name

The SPARQL HTTP service (pg_ripple_http) also accepts:

VariableDefaultDescription
PG_RIPPLE_HTTP_PG_URLpostgresql://postgres:…@localhost/postgresConnection string
PG_RIPPLE_HTTP_PORT7878Listening port
PG_RIPPLE_HTTP_POOL_SIZE8Connection pool size
PG_RIPPLE_HTTP_CORS_ORIGINS*CORS allowed origins

Example: GeoSPARQL Query

CREATE EXTENSION postgis;

-- Load a geo triple
SELECT pg_ripple.load_ntriples(
  '<https://example.org/Berlin> <http://www.opengis.net/ont/geosparql#asWKT> "POINT(13.405 52.52)"^^<http://www.opengis.net/ont/geosparql#wktLiteral> .'
);

-- Query via SPARQL
SELECT * FROM pg_ripple.sparql(
  'SELECT ?city ?wkt WHERE { ?city <http://www.opengis.net/ont/geosparql#asWKT> ?wkt }'
);
CREATE EXTENSION vector;

-- Create an embedding for a resource
INSERT INTO _pg_ripple.embeddings (subject_id, embedding)
SELECT id, '[0.1, 0.2, ...]'::vector
FROM _pg_ripple.dictionary
WHERE value = 'https://example.org/Berlin';

-- Hybrid search: semantic similarity + SPARQL filter
SELECT * FROM pg_ripple.hybrid_search(
  query_embedding := '[0.1, 0.2, ...]'::vector,
  sparql_filter   := '?s <http://schema.org/type> <http://schema.org/City>',
  k               := 10
);

Publishing to GHCR

Every release is automatically published to GitHub Container Registry via the release GitHub Actions workflow. You can also build the batteries-included image locally:

docker build --tag my-pg-ripple:local .