adapted changes from graphdb