Project Description

PyRDB2RDF provides RDFLib with an interface to relational databases as
RDFstores. The underlying data is accessed via SQLAlchemy. It is
mapped to RDF according to the specifications of RDB2RDF. The
corresponding RDF graph is represented as an RDFLib graph.

Translating from relational data to RDF via direct mapping is
currently supported. Translating in the other direction and mapping
with R2RML are planned but not yet implemented.

Installation

pip install rdb2rdf

Examples

Serializing a database as N-Triples

Suppose the local PostgreSQL database test_dm contains data that
we want to translate to RDF and serialize as N-Triples. The following
code achieves that.