Skip to main content

PyRDB2RDF

Project description

PyRDB2RDF provides RDFLib with an interface to relational databases as RDF stores, accessed via SQLAlchemy, and mapped to RDF according to the specifications of RDB2RDF.

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

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

dm_db = _sqla.create_engine('postgresql://test:test@localhost/test_dm')
dm_graph = _rdf.Graph('rdb2rdf_dm')
dm_graph.open(dm_db)

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

Changelog

Project details


Download files

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

Source Distribution

rdb2rdf-0.1.1.tar.gz (28.8 kB view details)

Uploaded Source

Built Distributions

rdb2rdf-0.1.1-py2.7.egg (16.3 kB view details)

Uploaded Egg

rdb2rdf-0.1.1-py2-none-any.whl (20.9 kB view details)

Uploaded Python 2

File details

Details for the file rdb2rdf-0.1.1.tar.gz.

File metadata

  • Download URL: rdb2rdf-0.1.1.tar.gz
  • Upload date:
  • Size: 28.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rdb2rdf-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e4048f1e50d005dc33dad23623527e59f02afc23c814f4fd5986bad26d6341fb
MD5 2448e733a7f30ca3710beca9106f8ff0
BLAKE2b-256 0c27781316d632ac268569997d6828f66f70d2653af17349ea2e3d1e22e45a91

See more details on using hashes here.

File details

Details for the file rdb2rdf-0.1.1-py2.7.egg.

File metadata

  • Download URL: rdb2rdf-0.1.1-py2.7.egg
  • Upload date:
  • Size: 16.3 kB
  • Tags: Egg
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for rdb2rdf-0.1.1-py2.7.egg
Algorithm Hash digest
SHA256 d55da26a7c165ab54dcc070df9c4c99d760a152ba6c9a5f3e18688e0c6b81e32
MD5 930b462ad76f3d07769a100035613816
BLAKE2b-256 4731dea801446c1745843c60f5cad61e57971231920a6609115254071b19a42f

See more details on using hashes here.

File details

Details for the file rdb2rdf-0.1.1-py2-none-any.whl.

File metadata

File hashes

Hashes for rdb2rdf-0.1.1-py2-none-any.whl
Algorithm Hash digest
SHA256 88133bbb05ec35a07c92d605ba89ceea3f9f0be7744ec3fd6cbe0c158c06c96f
MD5 3894994219fcbc9812f1d2fae64213f4
BLAKE2b-256 c7d6b0410fe953298a5ecc40c03ab017b9169af97f4a55cdf43b8a08503c3705

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page