pgRDF: RDF in your Postgres

Opinion
Data Integration
Semantic Web
pgRDF is a Rust Postgres extension that stores RDF as a hexastore, a virtual-graph route when master data cannot live in RDF. Compared with Ontop.
Published

May 15, 2026

Illustration: pgRDF: RDF in your Postgres

Having your master data in RDF is often not an option and this is where a hazardous search for ETL/sync/materialization starts. I wrote before about YARRRML, maplib, RML, Morph-KG, LinkML and similar tools. Here I’d like to highlight the virtual graph approach: pulling SQL via SPARQL and turning Postgres into a triple store via extensions.

pgRDF is a Rust-native Postgres extension built on pgrx that stores RDF as a dictionary-encoded hexastore. The benchmarks are unusually ambitious, SHACL validator and an OWL 2 RL reasoner. Quite impressive. The catch is the single dev and maturity of the project.

Ontop is a popular and reliable option and has been integrated into GraphDB as a data virtualization solution. It’s solid. Caveats live in some specific needs like heavy usage of OPTIONAL, aggregation heavy queries and highly dynamic data.

rdf_fdw is a Postgres foreign data wrapper that enables seamless integration with RDF triplestores via SPARQL endpoints. It supports querying RDF data using SQL, somewhat like ontop. Here as well, I’d be careful with using a Github project that has not proven itself.

The more enterprisey option involves messaging (Kafka) and workflows (Kestra, Prefect…) with the added advantage that it gives you a company-wide integration rather than a one-to-one pipeline. Plus, this works with other relational DBs, not just Postgres.

Did I overlook a major/magical option?