An open API service indexing awesome lists of open source software.

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

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)