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.
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
Built Distributions
File details
Details for the file rdb2rdf-0.1.3.tar.gz
.
File metadata
- Download URL: rdb2rdf-0.1.3.tar.gz
- Upload date:
- Size: 29.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fa1c488f06cda256f6ca25f27e63a02a540a879946116c382a20ec81032793c2 |
|
MD5 | d69bcf4b170f576966093d2cf9be6d40 |
|
BLAKE2b-256 | 0420ec65e461969abbe4955d2bdef070872f895706af09d07f730f811ff6ee16 |
File details
Details for the file rdb2rdf-0.1.3-py2.7.egg
.
File metadata
- Download URL: rdb2rdf-0.1.3-py2.7.egg
- Upload date:
- Size: 16.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 09b83d3b4eb43ee318a84790b3e543ca7a7e3473f83f60fa5e706df132534ff5 |
|
MD5 | 860581d86f7a024302d73e1d1ab44be8 |
|
BLAKE2b-256 | d8a8cd58bbc4dd49b35efa23eae902ab545aefbc9529797035f2705a18e756a9 |
File details
Details for the file rdb2rdf-0.1.3-py2-none-any.whl
.
File metadata
- Download URL: rdb2rdf-0.1.3-py2-none-any.whl
- Upload date:
- Size: 21.4 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3e3e657392109a3899b92badb9d725964cd52c2fe574e3e82cf2f7490a57d9ae |
|
MD5 | ce3238cfd2e6278684632dceba8a0f9a |
|
BLAKE2b-256 | 08edce8575b9bdf9c38e7c86fb2f2c672db3161e6b7398902663be175f794269 |