This page defines the stability contract for the pg_ripple public API, effective from v0.20.0.
pg_ripple functions and tables are divided into three tiers:
Tier Schema prefix Contract
Stable pg_ripple.*Will not change in any incompatible way within the 1.x release series.
Internal _pg_ripple.*Private implementation detail. May change at any minor version. Do not depend on it in application code.
Experimental Marked -- EXPERIMENTAL in source Subject to change without notice.
The following functions are stable as of v0.20.0 and will be maintained without incompatible change through v1.x:
Function Signature Notes
insert_triple(s text, p text, o text) → bigintReturns the statement ID (SID).
delete_triple(s text, p text, o text) → bigintReturns deleted row count.
find_triples(s text, p text, o text) → setof jsonbNULL = wildcard.
triple_count() → bigintTotal explicit triples in default graph.
load_ntriples(data text) → bigintBulk load from N-Triples string.
load_turtle(data text) → bigintBulk load from Turtle string.
load_rdf_xml(data text) → bigintBulk load from RDF/XML string.
Function Signature Notes
sparql(query text) → setof jsonbSPARQL 1.1 SELECT. Returns one JSONB object per row.
sparql_ask(query text) → booleanSPARQL 1.1 ASK.
sparql_construct(query text) → setof jsonbSPARQL 1.1 CONSTRUCT.
sparql_describe(query text, strategy text) → setof jsonbSPARQL 1.1 DESCRIBE.
sparql_update(update text) → bigintSPARQL 1.1 Update. Returns affected triple count.
sparql_explain(query text, analyze boolean) → textQuery plan / execution trace.
Function Signature Notes
encode_term(value text, kind smallint) → bigintEncode a term to dictionary ID.
decode_id(id bigint) → textDecode a dictionary ID to its string form.
encode_triple(s text, p text, o text) → bigintEncode a quoted triple to dictionary ID.
decode_triple(id bigint) → jsonbDecode a quoted-triple ID to {s, p, o}.
dictionary_stats() → jsonbStatistics about the dictionary table.
vacuum_dictionary() → bigintRemove orphaned dictionary entries.
Function Signature Notes
load_shacl(shapes text) → bigintParse and store a SHACL shapes graph.
validate() → jsonbRun offline validation. Returns {conforms, violations}.
list_shapes() → setof recordEnumerate stored shapes.
drop_shape(shape_iri text) → bigintRemove a shape.
process_validation_queue() → bigintProcess the async validation queue.
dead_letter_queue() → setof recordItems that failed validation processing.
Function Signature Notes
load_rules(rules text, rule_set text DEFAULT 'custom') → bigintParse and store a Datalog rule set.
load_rules_builtin(name text) → bigintLoad a built-in rule set ('rdfs' or 'owl-rl').
add_rule(rule_set text, rule_text text) → bigintAdd a single rule; returns new rule catalog ID.
remove_rule(rule_id bigint) → bigintRemove a rule by ID; returns triples retracted.
drop_rules(rule_set text) → bigintDrop all rules in a named rule set.
infer(rule_set text DEFAULT 'custom') → bigintMaterialise inferences; returns triple count.
infer_with_stats(rule_set text DEFAULT 'custom') → jsonbSemi-naive inference with statistics.
infer_goal(rule_set text, goal text) → jsonbGoal-directed magic-sets inference.
retract_inferred(rule_set text) → bigintDelete all materialised triples for a rule set.
list_rules() → jsonbList all stored rules with metadata.
list_rule_sets() → tableList all named rule sets with rule counts.
Function Signature Notes
vacuum() → bigintRemove stale tombstones and orphaned delta rows.
reindex() → bigintRebuild VP table indices.
promote_rare_predicates() → bigintPromote predicates from vp_rare to dedicated VP tables.
trigger_merge() → voidSignal the background merge worker to run immediately.
get_statement(sid bigint) → jsonbRetrieve a triple by its statement ID.
Function Signature Notes
insert_triple_graph(s text, p text, o text, g text) → bigintInsert into a named graph.
delete_triple_graph(s text, p text, o text, g text) → bigintDelete from a named graph.
find_triples_graph(s text, p text, o text, g text) → setof jsonbQuery a named graph.
Function Signature Notes
enable_graph_rls() → voidEnable graph-level Row-Level Security.
grant_graph(graph_iri text, role text) → voidGrant RLS SELECT access to a graph for a role.
revoke_graph(graph_iri text, role text) → voidRevoke RLS access for a role.
grant_graph_access(graph_iri text, role text, privilege text DEFAULT 'SELECT') → voidGrant with explicit privilege level.
revoke_graph_access(graph_iri text, role text) → voidRevoke access (detailed).
Function Signature Notes
fts_index(predicate text) → bigintAdd a predicate to the FTS index.
fts_search(query text) → setof jsonbFull-text search over indexed literals.
Function Signature Notes
export_ntriples() → textExport all triples as N-Triples.
export_turtle() → textExport as Turtle.
export_jsonld() → jsonbExport as JSON-LD.
Function Signature Notes
plan_cache_stats() → jsonbHit/miss statistics for the SPARQL plan cache.
plan_cache_reset() → voidFlush the plan cache.
Tables, sequences, and functions in the _pg_ripple schema are private implementation details . They may be renamed, restructured, or removed at any minor version.
Do not write application code that queries _pg_ripple.* tables directly. Use the pg_ripple.* API instead.
Examples of internal objects (non-exhaustive):
_pg_ripple.dictionary — the term encoding table
_pg_ripple.predicates — the VP table catalog
_pg_ripple.vp_rare — the rare-predicate consolidation table
_pg_ripple.vp_{id}_main, _pg_ripple.vp_{id}_delta, _pg_ripple.vp_{id}_tombstones — HTAP partition tables
_pg_ripple.statement_id_seq — the global SID sequence
_pg_ripple.shacl_shapes, _pg_ripple.validation_queue, _pg_ripple.dead_letter_queue — SHACL internals
The following GUCs are part of the stable public API:
GUC Default Type
pg_ripple.dictionary_cache_size65536integer
pg_ripple.vp_promotion_threshold1000integer
pg_ripple.merge_threshold10000integer
pg_ripple.shacl_mode'async'enum: 'async', 'sync', 'off'
pg_ripple.enforce_constraints'warn'enum: 'error', 'warn', 'off'
pg_ripple.rls_bypassoffboolean
pg_ripple.federation_timeout_ms5000integer
pg_ripple.enable_plan_cacheonboolean
Internal GUCs (names starting with pg_ripple._) may change without notice.
pg_ripple provides a SQL migration script for every minor release (sql/pg_ripple--X.Y.Z--X.Y.(Z+1).sql). Upgrading is always possible via:
ALTER EXTENSION pg_ripple UPDATE;
No data migration is ever required for stable API changes. If a future release modifies the _pg_ripple.* schema, the migration script handles it automatically.