Hi Sebastian,
That's a cool idea. I have a precursor to SQL-Gremlin that we're using with Titan 0.4.4 that goes SQL to essentially a bunch of MultiQuery calls. It has the concept of these primitive "vertex" tables but also two extensions that provide another level of abstraction.
Taking your friends-of-friends up to distance 3 example, we have a special type of bridge/associations table with the following columns: out_id, in_id, depth, direction. To get the friends within distance 3, you'd do something like this:
select * from person as p1
inner join friends as f on f.out_id = p1.person_id
inner join person as p2 on f.in_id = p2.person_id
where direction = 'OUT' and depth <= 3
The 2nd graph "view" that we expose is based upon the regular old star schema fact table. In this case, we have a bunch of time series data across many different time series that we need to make reporting friendly. Our fact tables are setup via some simple json configuration that specifies fact table names, their columns, and how to preprocess each column (eg. do we want an average, raw value, most recent value in time period?) You end up with tables that have 2 dimensions ( a foreign key to a dimension table like company, store, etc. and a time dimension). Then the rest of your columns are your time series values. Say we were collecting sensor data from a bunch of grocery stores, it'd look something like this:
store_id, tstamp, temp_sensor, humidity_sensor, temp_sensor_deli, temp_sensor_freezer
This is all sitting over a time series model that would be very verbose to query at the vertex level so the tool provides that nice translation that makes it easy to plug into Jasper, Pentaho, etc.
Long story short, I'd like to add these sorts of facilities into SQL-Gremlin and I'm looking forward to hearing further ideas from folks on how expose the more graph-type operations via SQL.
Thanks,
Ted