Hi,
I did a lot of work around Graph Strategies in the M4-M6 releases but stopped due to it dramatically changing. I'm now just getting back into it and have some questions.
We have a simple use case (prototype) around versioning. When we create a new vertex, edge or vertex property (Element) we add a "created" timestamp property. We have a custom traversal strategy that essentially manipulates the Gremlin traversal (specifically AddV, AddE, Property, steps etc.) buy appending the "created" property to the property set passed in at creation - almost identical to how PartitionStrategy does it with partitions. We add a "removed" timestamp when an element is deleted and replace the "Drop" step in the traversal with setting the "removed" property value. When a property value is updated we use VertexProperty functionality by created a new key/value pair and again assigning a "created" timestamp. This is all basic stuff and inserting/replacing the steps is hidden from the user (BTW, what happened to "~" for hiding properties?).
When querying, to be more expressive I would like to add a custom Gremlin step (both implicitly and explicitly) called "at" that takes a timestamp to filter elements based on time. If the "at" step is not explicitly specified in the traversal the traversal strategy will insert it with the current timestamp to get currently active elements. For example:-
g.V().at(1234) // lets vertices active at time 1234 pass through
I now see that the custom DSL section has been removed from GA docs and wondered if this is supported and how best to do it? I did see Neo4jGraphStep and assume this is the best approach? Also, I really don't need a custom DSL - I just need to add one custom step to the standard DSL.
I understand that I can probably represent the above using standard steps ("has" with conditions) but am using this as more of a learning exercise than anything else. So if there is a more elegant way to do it and I'm missing functionality please let me know.
Lastly, I'm assuming that the basic graph API methods "addVertex", "addEdge" etc. are not affected by the traversal strategy and hence AddV, AddE steps etc. must be used?
Thanks,
Dave