https://github.com/maxlath/couchdb-blazegraph-sync
[unstable] Keep a CouchDB database and a BlazeGraph namespace in sync
https://github.com/maxlath/couchdb-blazegraph-sync
blazegraph couchdb sync
Last synced: 11 months ago
JSON representation
[unstable] Keep a CouchDB database and a BlazeGraph namespace in sync
- Host: GitHub
- URL: https://github.com/maxlath/couchdb-blazegraph-sync
- Owner: maxlath
- Created: 2019-01-17T20:31:57.000Z (over 7 years ago)
- Default Branch: main
- Last Pushed: 2023-11-30T14:18:50.000Z (over 2 years ago)
- Last Synced: 2025-08-04T23:58:09.016Z (12 months ago)
- Topics: blazegraph, couchdb, sync
- Language: JavaScript
- Homepage:
- Size: 24.4 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# couchdb-blazegraph-sync
Keep a CouchDB database and a BlazeGraph namespace in sync.
:warning: **Do not use for loading a full database**, as that would be way less performant than just sending a dump to BlazeGraph
## Summary
- [Install](#install)
- [Add config](#add-config)
- [Set last seq](#set-last-seq)
- [Start](#start)
- [Add to systemd](#add-to-systemd)
- [License](#license)
## Install
```sh
git clone https://github.com/maxlath/couchdb-blazegraph-sync
cd couchdb-blazegraph-sync
npm install --production
```
## Add config
```sh
cp ./configs/example.js ./configs/my_db.js
```
Then customize `./configs/my_db` to your needs
## Set last seq
The sync will restart from the last known seq, which is persisted in a file per database: `./data/my_db.last_seq`
**This tool isn't designed to load a full database**, rather to keep up with the changes, so first make sure you to import a dump directly
```sh
# Use your serializer to generate a dump of your CouchDB database, this is out of the scope of this tool
curl http://my-blazegraph:8080/bigdata/namespace/kb/dataloader -H 'Content-Type: application/x-turtle' -d@./my_db.ttl
# Set the current last seq
curl "http://username:password@localhost:5984/my_db" | jq '.update_seq' > ./data/my_db.last_seq
# Or set an arbitrary point to start from
printf '1079700' > ./data/my_db.last_seq
```
## Start
```sh
npm start
```
## Add to systemd
```sh
# From the project root, assumes that you need sudo rights
npm run add-to-systemd
# Start the process
sudo systemctl start couchdb-blazegraph-sync
# Start following the logs
journalctl -fan 100 -u couchdb-blazegraph-sync
```
## License
[AGPL-3.0](https://www.gnu.org/licenses/agpl-3.0.en.html)