sql-gremlin
sql-gremlin copied to clipboard
Provides a SQL interface to your TinkerPop enabled graph db
SQL-Gremlin
The SQL-Gremlin compiler turns your SQL queries into Gremlin traversals and runs them against your favorite TinkerPop 3 enabled graph database.
Motivation
Many projects face the inevitable reporting/business intelligence requirement. This has motivated the creation of the SQL-Gremlin compiler.
Usage
To use this, build the module as a shadowJar (run package). From there you must collect the schema of your graph before you can enter sql statments. Basic usage is shown below:
void executeSqlStatement(final String sql, final GraphTraversalSource g) throws SQLException {
final GremlinSchema gremlinSchema = SqlSchemaGrabber.getSchema(g, SqlSchemaGrabber.ScanType.All);
final SqlConverter converter = new SqlConverter(gremlinSchema, g);
final SqlGremlinQueryResult sqlGremlinQueryResult = converter.executeSql(sql);
}
The project is currently under rapid development and interfaces may change quickly with no notice.
Roadmap
Current priorities include:
- Further SQL support
- Increase testing
- Enhancements to schema collection
Please refer to https://github.com/twilmes/sql-gremlin/issues for the most up to date list of outstanding issues.
Acknowledgements
Special thanks goes to the http://tinkerpop.incubator.apache.org/[Apache TinkerPop] and https://calcite.apache.org/[Apache Calcite] teams. The depth and breadth of both of these projects is truly astounding. Also, thanks to Daniel Kuppitz. His work on https://github.com/dkuppitz/sparql-gremlin[SPARQL-Gremlin] served as a model and inspiration for SQL-Gremlin.