pg_ripple Blog

Note: Blog posts were written with AI assistance (GitHub Copilot / Claude) as a way to explore LLM-generated technical writing for a niche systems engineering topic. The technical content has been reviewed for accuracy, but treat posts as drafts rather than officially reviewed documentation.

The full blog lives in the repository under blog/. Individual posts are linked below.


Core Concepts & Architecture

PostSummary
Why RDF Inside PostgreSQL?The case for a triple store that lives where your data already is — no ETL pipeline, no separate cluster, no impedance mismatch.
Vertical Partitioning: One Table Per PredicateInside pg_ripple's VP storage model and why it beats a single (s, p, o) table by 10–100× for selective queries.
Everything Is an IntegerDictionary encoding with XXH3-128: why string comparisons in a triple store are a performance bug.
How SPARQL Becomes a PostgreSQL Query PlanThe translation pipeline from SPARQL text to spargebra algebra to SQL to SPI execution.

Storage & Performance

PostSummary
HTAP for Triples: Reads and Writes at the Same TimeThe delta/main/tombstone split that lets pg_ripple handle concurrent OLTP writes and analytical SPARQL queries without locking.
Leapfrog Triejoin: When Triangle Queries Meet Optimal JoinsWorst-case optimal joins compiled into PostgreSQL — what a 10–100× speedup looks like in practice.
Property Paths Are Just Recursive CTEsSPARQL property paths compiled to WITH RECURSIVE … CYCLE using PostgreSQL 18's hash-based cycle detection.

Reasoning & Inference

PostSummary
Datalog Inside PostgreSQLAutomatic fact derivation from rules — RDFS, OWL RL, transitive closure, all running as SQL.
Magic Sets: Ask a Question, Infer Only What You NeedGoal-directed inference: the difference between 2 million inferred triples and 47.
owl:sameAs Without the ExplosionEntity canonicalization at query time using union-find over owl:sameAs chains.
The Four Built-in Rule SetsWhat RDFS, OWL RL, OWL EL, and OWL QL actually do — every rule explained with examples.
Well-Founded SemanticsWhy stratified negation isn't always enough, and how well-founded semantics handles recursive negation.
OWL Property Chain AxiomsCompiling owl:propertyChainAxiom to recursive SQL joins.

Data Quality & Validation

PostSummary
SHACL: Schema Validation for the Schema-LessHow pg_ripple compiles SHACL shapes into DDL constraints and async validation pipelines.
PostSummary
Vector + SPARQL Hybrid SearchCombining pgvector approximate nearest-neighbour search with SPARQL graph traversal.
Natural Language to SPARQLLLM-powered NL→SPARQL translation with few-shot prompting.
GraphRAG Knowledge ExportExporting pg_ripple graphs for Microsoft's GraphRAG pipeline.
Neuro-Symbolic Entity ResolutionCombining ML embeddings with Datalog rules for record linkage.

Integrations & Operations

PostSummary
CDC → Knowledge GraphStreaming relational change events into the RDF graph via logical replication.
Citus Shard Pruning for SPARQLHow the SERVICE clause dispatches federated SPARQL queries to the right shard.
IVM with pg-trickle IntegrationIncremental view maintenance over CDC streams.
Semantic Hub: pg-tide RelayHub-and-spoke topology for multi-instance RDF synchronisation.
GDPR Right to ErasureImplementing GDPR article 17 — cascading triple deletion with provenance tracking.
Multi-Tenant Knowledge GraphsNamed-graph isolation, row-level security, and per-tenant dictionaries.

Advanced Features

PostSummary
CONSTRUCT Views: Live TransformationsSPARQL CONSTRUCT rules as materialised views with automatic delta propagation.
JSON-LD Framing and Nested JSONTurning a flat triple store into structured nested JSON documents on demand.
JSON-LD Reverse MappingWriting RDF changes back to relational tables via JSON-LD contexts.
R2RML: Relational to GraphMapping relational tables to RDF using the W3C R2RML standard.
RDF-star: Statements About StatementsAnnotating individual triples for provenance, confidence, and temporal metadata.
Temporal Graph SnapshotsPoint-in-time named graphs for audit trails and time-travel queries.
Temporal Time-Travel QueriesQuerying historical states of the knowledge graph.
Allen's Interval RelationsTemporal reasoning using Allen's thirteen interval relations in Datalog.
GeoSPARQL + PostGISSpatial queries over RDF geometry literals using the GeoSPARQL 1.1 extension.
SKOS Knowledge OrganizationManaging thesauri, concept schemes, and taxonomies with SKOS in pg_ripple.
Graph Analytics with PageRankDatalog-native PageRank with incremental view maintenance, WCOJ, and Prometheus gauges.
Probabilistic DatalogUncertain knowledge: noisy-OR, confidence propagation, and soft constraints.
Provenance Tracking with PROV-ORecording data lineage using the W3C PROV-O ontology.
Ontology Mapping and AlignmentBridging heterogeneous vocabularies with owl:equivalentClass and SPARQL CONSTRUCT rules.
SPARQL Federation: Local + RemoteMixing local VP table scans with remote SPARQL endpoints in a single query.
EXPLAIN SPARQL: Query PlansReading pg_ripple's query plan output to diagnose slow SPARQL queries.
Rule Library FederationPublishing and subscribing to shared Datalog rule libraries across pg_ripple instances.
Federation Circuit BreakersResilient federated queries with circuit breakers, timeouts, and fallback graphs.
DCTERMS, Schema.org, and FOAF BundlesBuilt-in vocabulary bundles for common ontologies.
Uncertain KnowledgeProbabilistic Datalog in PostgreSQL: representing and querying uncertain facts.