I think that bothE() == union(outE(),inE()) and outE().count() +
inE().count() == bothE().count().  If you don't want the self-referencing
edge to be returned twice, then either make it a unidirected edge (if
supported) so that it would still satisfy the two previous condition or
dedup(). In either case, it's left to the user to determine what edges are
returned.

Also, I think it makes sense that g.E() == g.V().outE().  It should not be
g.V().inE() due to potential for unidirected edges.


Robert Dale

On Wed, Oct 25, 2017 at 9:32 AM, Daniel Kuppitz <m...@gremlin.guru> wrote:

> IMO it should return the edge only once.
>
> Cheers,
> Daniel
>
>
> On Wed, Oct 25, 2017 at 5:47 AM, Stephen Mallette <spmalle...@gmail.com>
> wrote:
>
> > The test suite doesn't seem to enforce behavior related to self-relating
> > edges. TinkerGraph does this:
> >
> > gremlin> g = TinkerGraph.open().traversal()
> > ==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
> > gremlin> g.addV().as('a').addE('self').to('a')
> > ==>e[1][0-self->0]
> > gremlin> g.E()
> > ==>e[1][0-self->0]
> > gremlin> g.V().bothE().count()
> > ==>2
> >
> > Should bothE() return 2 in this case or 1? I think that we've said in the
> > past that g.E() is the same as g.V().outE() or g.V().inE(), but not
> > necessarily g.V().bothE().  Thoughts?
> >
>

Reply via email to