Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

PyRDB2RDF

Project Description

PyRDB2RDF provides RDFLib with an interface to relational databases as RDF stores. 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.

import rdflib as _rdf
import sqlalchemy as _sqla

db_str = 'postgresql://testuser:testpasswd@localhost/testdb'
db = _sqla.create_engine(db_str)
graph = _rdf.Graph('rdb2rdf_dm')
graph.open(db)

print(graph.serialize(format='nt'))

Changelog

0.1.2

  • Updated references to Spruce projects (lang, iri, types) and Goose Types.
  • Improved the setup script.
  • Improved documentation.

0.1.1

  • Added a missing installation dependency.

0.1.0

First public release.

Release History

Release History

This version
History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
rdb2rdf-0.1.3-py2.7.egg (16.7 kB) Copy SHA256 Checksum SHA256 2.7 Egg Nov 24, 2014
rdb2rdf-0.1.3-py2-none-any.whl (21.4 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Nov 24, 2014
rdb2rdf-0.1.3.tar.gz (29.9 kB) Copy SHA256 Checksum SHA256 Source Nov 24, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting