Storing graph data in a database (sqlite)