Interop layer between Gun and LevelGraph via levelgraph-jsonld
Conversion to JsonLd format is super flexible and works!
The following default functions need to be fixed however:
- Tweak default
addContext,graphIdandreferenceNodefunctions:- add valid JsonLd
@contexton each node - add valid JsonLd
@idon each node - make sure valid references
- add valid JsonLd
npm i -S gun-levelgraphSee docs:
A lot of useful insight can be gathered from answers to my questions on this levelgraph-jsonld issue
How it will help you as well!
Some helpful resources:
The locking error is because levelup is not multi user by default. So indeed you must have another process with the db opened. As long as you don't have important data in it then deleting is an option. Killing zombie processes which might have the file locked is another (maybe best to take the habit of doing that instead of a delete...).
When debugging it's useful to see what LevelGraph directly returns (after putting with db.json.ld.put()) using : db.get({}, console.log);
More Gun chain utility functions are available via:
- chain-gun - misc
- future-gun - Promise
- water-gun - Observable/CSP
npm i -g ava
Try ava test
- Test LevelGraph save functions
- Load JsonLd object into Gun graph for a full cycle
- Fix
addContextandgraphIdfunctions to:- add valid JsonLd
@contexton each node - add valid JsonLd
@idon each node
- add valid JsonLd
MIT Kristian Mandrup 2017