g.V().hasLabel('A').in_().not_(__.hasLabel('B')).count()--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/7693bdba-8b0c-4a53-9c0b-d0f2acc7bb3b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
g.V().hasLabel('A').in_().hasLabel(neq('B')).count().next()
--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/9c7be277-71a9-413f-ad2e-33110bd22580%40googlegroups.com.
Unfortunately that did not work. The output now consists of a list such as:[][['V'], ['hasLabel', 'internet', [...I am expecting a simple number - the output of Count().
On Mon, Apr 29, 2019 at 6:55 PM <kelvin....@gmail.com> wrote:
Hi Mark, when you use Gremlin from one of the GLV clients you either need to statically import the "__" (double under bar) class or use it explicitly when you have an anonymous traversal (one not dot connected to a prior step). So you could write your query as:--g.V().hasLabel('A').in_().not_(__.hasLabel('B')).count()
CheersKelvin
On Monday, April 29, 2019 at 6:47:07 PM UTC-5, Mark Novak wrote:I have a the following working line in groovy (trying to find how many vertices connect to vertex with label A that are not labeled B:g.V().hasLabel('A').in().not(hasLabel('B')).count()When I switch to gremlin-python, however, and try this:g.V().hasLabel('A').in_().not_(hasLabel('B')).count()I get an error: NameError: name 'hasLabel' is not defined.How do I restate the query so it works in Python?
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremli...@googlegroups.com.
Note, that the query can be simplified to:g.V().hasLabel('A').in_().hasLabel(neq('B')).count().next()Cheers,Daniel
On Mon, Apr 29, 2019 at 4:47 PM Mark Novak <mr.ma...@gmail.com> wrote:
I have a the following working line in groovy (trying to find how many vertices connect to vertex with label A that are not labeled B:--g.V().hasLabel('A').in().not(hasLabel('B')).count()When I switch to gremlin-python, however, and try this:g.V().hasLabel('A').in_().not_(hasLabel('B')).count()I get an error: NameError: name 'hasLabel' is not defined.How do I restate the query so it works in Python?
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremli...@googlegroups.com.