I have a question about the Direction argument in FramedGraph.frame(Edge, Direction, Class). It looks like that argument is only used by the @Domain and @Range annotations, and defines which side of the framed-edge is supposed to be the domain vs. the range. I don't understand why this has to be decided for each instance of an edge-frame. It seems to me that this is fixed per class, not per instance of that class. For example given the following edge-frame for a Person-owns-Pet relation:
interface OwnsPet {
@Domain Person getOwner();
@Range Animal getPet();
}
You can naturally only have instances of OwnsPet in one direction, calling framedGraph.frame with the wrong direction will just result in runtime errors.
But maybe I'm overlooking something?
If not I would suggest to drop the Direction argument from the FramedGraph.frame method, and therefore also from the AnnotationHandler interface. It could be replaced by a direction field on the Domain and Range annotations, but I think it's more logical to have those just use the natural direction of the edge. I can prepare a pull-request for this, it's a simple, but API breaking change.
Making this can also simplify some other improvements inside Frames, e.g. have @GremlinGroovy also support edge results out of a pipeline (currently it's vertex only).
Thanks