Skip to main content

Graph Database for everyday use

Project description

This program is alpha becarful

Kesako?!

Ajgu is graph database backed by Oracle Berkeley Database key/value store aka. bsddb. It’s meant to be an easy to use, just works persistent graph for people that want to experiment with graph databases. SQLite for graphs.

The other purpose of Ajgu is to be able to create meta-graph or graph-proxy where some part of the graph are computed on the fly and cached in the database. This can be done at the application level, but not so much when you want your application data to be always fresh. If the data is required by several other applications, it leads to complicated problems that could be solved directly in the graph. This part is not written yet.

Development happens @ https://git.framasoft.org/python-graphiti-love-story/AjguGraphDB

Todo

  • Add a memory storage
  • Create documentation website
  • Make compatible with networkx
  • Add multithread/multiprocess with pypy
  • Add acid backend
  • Create wiredtiger cffi bindings for acid

ChangeLog

15.06.21

  • ajgu: storage: Add File based backend
  • ajgu: storage: Add Transaction less bsddb3 backend
  • examples: Add conceptnet load script
  • examples: Start mini microblog app

15.06.15

Important changes:

  • Several API changes
  • Transaction support was fully broken, please upgrade if you require transactions.

Details:

  • move to unittest.TestCase
  • use uuid4 for identifier generation
  • move Element, Vertex and Edge class to elements.py module
  • rework to implement Storage based backend to make future work on multiple backends easier
  • rework Element.properties() now it’s Element.properties and Element.props with new API (with tests)
  • implement Transaction.edge & Transaction.vertex API via manager classes (cf. manager.py). Same API as before but element specific. Now you create a vertex with txn.vertex.create('software'), and retrieve an edge with txn.edge.get(ajgu_depends_bsddb).
  • add txn.*.slice
  • index elements by labels to speed up txn.*.label queries.
  • several cleanups, removed old index/query code (uzelmumu module still works)
  • fix pypi example to work with new API

15.06.10

  • add example app
  • better error when magic keys is used but fails
  • fix bug where edge and vertex weren’t not saved
  • fix import error in tests

Getting started

Dependencies:

  • python3
  • bsddb3
  • msgpack

bsddb3 must be installed on you system. Dependending on the distribution it’s called db or bdb. If you have a python3-bsddb3 package use that one.

You can use python setup.py develop or pip install ajgu but you will need python 3 and bsddb headers.

Documentation

See:

A few pointers:

  • from ajgu import Storage
  • from ajgu import GraphDatabase
  • Everything happens in a transaction
  • So storage.Transaction is very important. Mind the fact that you never instanciate it directly. Instead, use with GraphDatabase.transaction() as txn.
  • Use txn.vertex.create and txn.edge.create to create elements.Vertex and elements.Edge objects.
  • Use Vertex.outgoings and Vertex.incomings to jump to edges
  • Edge.start() and Edge.end() to jump to vertices
  • Properties can be get and set using the dict syntax over Element.props
  • Magic properties work, so that you can access an element property with my_vertex.props.key instead of my_vertex.props['key']
  • For client/server have a look at ajgu/client.py and server.py.
  • They are a few tests in ajgu/database.py file
  • They are a others tests in ajgu/* files, they are not supposed to work :)

Contact

Feel free to contact me at amirouche+dev@hypermove.net if you need suppport or want to discuss matters related to graph databases.

FAQ

  1. What ajgu means?

    ajgu is a beam used in house construction in amazigh language.

  2. Why not use SQLite instead of bsddb3?

    I prefer data to be safe than software fast.

  3. Where can I find a graph server with multi *thread* and *python querying*?

    GraphitiDB I never used it for the real. It’s relying on old version of Tinkerpop.

  4. Are GraphDBs useful beyond prototyping?

    You tell me!

  5. GraphDBs are awesome, where can I learn more?

Project details


Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page