https://github.com/incatools/rdf-sql-bulkloader
https://github.com/incatools/rdf-sql-bulkloader
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/incatools/rdf-sql-bulkloader
- Owner: INCATools
- Created: 2022-08-30T00:50:12.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2023-03-02T21:37:24.000Z (over 3 years ago)
- Last Synced: 2025-03-01T06:39:18.058Z (over 1 year ago)
- Language: Python
- Size: 115 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# rdf-sql-bulkloader
Bulk load of SQL table from RDF in Python
## Install
```bash
pip install rdf-sql-bulkloader
```
## Usage (Command Line)
```
rdf-sql-bulkloader load-sqlite -o cl.db cl.owl
```
Note: currently only sqlite supported
## Usage (Programmatic)
See tests
## Core table
```
CREATE TABLE statement (
id TEXT,
subject TEXT,
predicate TEXT,
object TEXT,
value TEXT,
datatype TEXT,
language TEXT,
graph TEXT
);
```
## Prefixes
this uses the merged prefixmap from [prefixmaps](https://github.com/linkml/prefixmaps) by default
This can be overridden programmatically when instantiating a loader, e.g
Explicit map:
```python
loader = SqliteBulkloader(path=path, prefix_map={...})
```
Using pre-registered:
```python
loader = SqliteBulkloader(path=path, named_prefix_maps=["obo", "prefixcc"])
```
- TODO: add override from CLI
## Acknowledgements
This work was entirely inspired by James Overton's [rdftab.rs](https://github.com/ontodev/rdftab.rs)
This [cookiecutter](https://cookiecutter.readthedocs.io/en/stable/README.html) project was developed from the [sphintoxetry-cookiecutter](https://github.com/hrshdhgd/sphintoxetry-cookiecutter) template and will be kept up-to-date using [cruft](https://cruft.github.io/cruft/).