Skip to content

PlumpMath/gun-levelgraph

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gun-levelgraph

Interop layer between Gun and LevelGraph via levelgraph-jsonld

Status

Conversion to JsonLd format is super flexible and works!

The following default functions need to be fixed however:

  • Tweak default addContext, graphId and referenceNode functions:
    • add valid JsonLd @context on each node
    • add valid JsonLd @id on each node
    • make sure valid references

Install

npm i -S gun-levelgraph

Usage

See docs:

FAQ

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:

Db errors & locks

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...).

Debugging

When debugging it's useful to see what LevelGraph directly returns (after putting with db.json.ld.put()) using : db.get({}, console.log);

Gun utility functions

More Gun chain utility functions are available via:

Run Tests

npm i -g ava

Try ava test

TODO

  • Test LevelGraph save functions
  • Load JsonLd object into Gun graph for a full cycle

Save Gun node to LevelGraph

  • Fix addContext and graphId functions to:
    • add valid JsonLd @context on each node
    • add valid JsonLd @id on each node

Licence

MIT Kristian Mandrup 2017

About

Gun LevelGraph interop layer using levelgraph-jsonld

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • JavaScript 100.0%