Handling IDs generically via TinkerPop is difficult for 2 reasons:
- There is no way to retrieve the Id types (1 for vertex, 1 for edge) of the underlying graph.
- TinkerGraph allows mixed types, meaning one vertex's Id might be a Long and another a String.
This is especially annoying when going to/from JSON, as the type of every single Id must be serialized to ensure that it can be properly recreated later.
I believe all the implementations except TinkerGraph restrict Ids to a single type per graph. I see this flexibility as more of a nuisance than a feature - at least at the moment
Here is my request:
- Graphs should restrict IDs to a single type. (This would only be a modification to TinkerGraph, I think.)
- Graph should provide a getter for retrieving the type of it's Ids.
TinkerGraph would obviously still need to support any type as an Id, but I think this could be handled lazily by setting the Id type when the first vertex and edge is created.