After actually looking into the docs, I decided to keep the example, since
the description explicitely states, that in such a case the where() clause
will automatically be folded into match():

The where()-step can take either a BiPredicate (first example below) or a
> Traversal (second example below). Using MatchWhereStrategy, where()-clauses
> can be automatically folded into match() and thus, subject to match()-steps
> budget-match algorithm.
>

The sample then shows, that

g.V().match('a',
    __.as('a').out('created').as('b'),
    __.as('b').in('created').as('c')).
  where(__.as('a').out('knows').as('c')).
  select('a','c').by('name')


is - after the MatchWhereStrategy was applied (this is done automatically)
- in fact the same thing as:

g.V().match('a',
    __.as('a').out('created').as('b'),
    __.as('a').out('knows').as('c'),
    __.as('b').in('created').as('c')).
  select('a','c').by('name')

....

Cheers,
Daniel


On Wed, Jun 17, 2015 at 10:47 PM, Daniel Kuppitz <[email protected]> wrote:

> You're right. It's actually a pretty good example for where(), but not
> for match()/where(). I will remove it and make sure that we have
> something similar in the where() sample section. Something like:
>
> g.V().as("a").out("created").as("b").in("created").as("c").
>     where(__as("a").out("knows").as("c")).select().by("name")
>
>
> Cheers,
> Daniel
>
>
> On Wed, Jun 17, 2015 at 8:43 PM, Matthias Broecheler <[email protected]>
> wrote:
>
>> Hi guys,
>>
>> looking at the second example in the following section of the docs I
>> noticed a semantic overlap between match and where:
>> http://www.tinkerpop.com/docs/3.0.0-SNAPSHOT/#using-where-with-match
>>
>> traversal = g.V().match('a', __.as('a').out('created').as('b'), __.as('b'
>> ).in('created').as('c')). where(__.as('a').out('knows').as('c')).
>> select('a'
>> ,'c').by('name');
>>
>> The provided where clause could also have been folded into the actual
>> traversal to yield the same result.
>> I wonder:
>> 1) Is there a way to avoid this ambiguity?
>> 2) or should we simply not promote it in the docs. As the docs are
>> currently written I am worried that users might get confused as to how
>> match steps are supposed to be written.
>>
>> Thanks,
>> Matthias
>>
>
>

Reply via email to