Skip to content


Subversion checkout URL

You can clone with
Download ZIP
A Relaxed Schema Graph Database Management System
JavaScript Python HTML CSS Shell
Branch: develop

README.rst Code Health


Sylva is a Relaxed-Schema Graph Database Management System.


Just in case, first thing you need is to have installed pip and virtualenv in your machine:

$ sudo apt-get install python-pip python-dev build-essential python-profiler libpq-dev
$ sudo pip install --upgrade pip
$ sudo pip install --upgrade virtualenv

Then, it's a good option to use virtualenvwrapper:

$ sudo pip install virtualenvwrapper

In the instructions given on virtualenvwrapper, you should to set the working directory for your virtual environments. So, you could add it in the end of your .bashrc file (newer versions of virtualenvwrapper don't require this):

$ mkdir -p ~/.venvs
export WORKON_HOME=~/.venvs
source /usr/local/bin/

And finally, create a virtualenv for the project:

$ mkvirtualenv sylva --no-site-packages

After you setup your virtual environment, you should be able to enable and disable it. The system propmt must change where you have it enable:

$ workon sylva
$ deactivate

Now, if you didn't get the project yet, clone it in your desired location:

$ cd $HOME
$ git clone git/sylva

Enter in the new location and update the virtual environment previously created:

$ cd git/sylva/
$ workon sylva
$ pip install -U -r requirements.txt

Relational Database

Now you have installed the Django project and almost ready to run it. Before that, you must create a database. In developing stage, we use SQLite:

$ cd $HOME
$ cd sylva/sylva
$ python syncdb --noinput
$ python migrate
$ python createsuperuser

And that is. If you run the project using the standalone development server of Django, you could be able to access to the URL http://localhost:8000/:

$ python runserver localhost:8000
$ xdg-open http://localhost:8000/

Graph Database

The last piece to make Sylva works is the Neo4j graph database. You can download the most current version (only branch 1.9.x is supported, 1.9.9 as today). After downloading, we need to unzip and setup some parameters:

$ cd git/sylva
$ wget
$ tar -zxvf neo4j-community-1.9.9-unix.tar.gz
$ mv neo4j-community-1.9.9-unix neo4j

Now, as indicated in in section GRAPHDATABASES, you need to edit the file neo4j/conf/ and set the next properies (the default configuration is reserved for testing client libraries):


And then you are ready to run the Neo4j server:

$ ./neo4j/bin/neo4j console


The analytics feature is only available for Neo4j backend, and only supportyed in 64-bits machines due to a limitiation in GraphLab. To enable them, set the next variable to True in your local


Analytics are run as Celery tasks, so you need a broker and a backend. Of popular choice is to install Redis as the results backend, and RabbitMQ as the broker. But in order to simplify the process, just the broker is needed when using RabbitMQ.

There are many ways to install RabbitMQ, we recommend a system installation, although a local installation might be better for development:

$ wget
$ tar xvf rabbitmq-server-generic-unix-3.3.1.tar.gz
$ ./rabbitmq_server-3.3.1/sbin/rabbitmq-server start

That should expose the URL amqp://guest@localhost// listening for requests, which is the default BROKER_URL in the settings. But if you are using a different broker or result backend, don't forget to configure those in your local settings:

BROKER_URL = "amqp://user:pass@hostname/app/"
CELERY_RESULT_BACKEND = "redis://:password@hostname:port/db"

Then export the settings if it's not the regular file:

$ export DJANGO_SETTINGS_MODULE=sylva.your_settings

And finally run Celery:

$ celery -A sylva.celery worker -l info

You can also run it in daemon mode by passing the argument multi:

$ celery multi start w1 w2 -A sylva.celery -l info

To disable prefork pool prefetch, simply add -Ofair at the end of the celery command.


Sylva now supports generation of reports based on queries plot into charts. To enable, just add:


And remember to add the celery beat:

$ celery --beat -A sylva.celery worker -l info

When in daemon mode, be sure to only run the beat once, otherwise you'll have duplicated tasks:

$ celery multi start w1 --beat -A sylva.celery -l info
$ celery multi start w2 -A sylva.celery -l info
Something went wrong with that request. Please try again.