Many projects face the inevitable reporting/business intelligence requirement. This has motivated the creation of the SQL-Gremlin compiler.
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.
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.
Special thanks goes to the Apache TinkerPop and Apache Calcite teams. The depth and breadth of both of these projects is truly astounding. Also, thanks to Daniel Kuppitz. His work on SPARQL-Gremlin served as a model and inspiration for SQL-Gremlin.