Re: [DISCUSS] S-Type

2016-06-15 Thread Daniel Kuppitz
I wouldn't say that I like it, cause code as a String will always be very
error prone, but still, it's likely the only way to get lambdas working in
all language variants. Hence: "cool".

Cheers,
Daniel


On Thu, Jun 16, 2016 at 12:03 AM, Marko Rodriguez 
wrote:

> Hi,
>
> What do people think of this idea:
>
> https://gist.github.com/okram/df6a104bde51a4f4f6f0da11f46909d5 <
> https://gist.github.com/okram/df6a104bde51a4f4f6f0da11f46909d5>
>
> If you pass a lambda/closure/anonymousFunction/etc. in the respective
> language (during translation), it calls it to get the string
> representation. … ?
>
> Marko.
>
> http://markorodriguez.com
>
>
>
> > On Jun 15, 2016, at 10:50 AM, Marko Rodriguez 
> wrote:
> >
> > Hello,
> >
> > I think we should introduce an S object. It would stand for Script and
> would allow you to do:
> >
> > S.f(“{ it.length }”)
> >
> > Where does this come in handy? Language variants.
> >
> > Imagine using gremlin_python that will compile to Gremlin-Groovy for
> execution at GremlinServer.
> >
> >   g.V().out(“knows”)[0:2].name.map(f(“{ it.length }”))
> >
> > Next, imagine you are in Gremlin-Java and want to submit a traversal to
> GremlinServer, but it has a lambda. No worries, just use the
> GroovyTranslator and you have:
> >
> >   g.V().out(“knows”).limit(2).values(“name”).map(f(“{ it.length }”))
> >
> > We could also have:
> >
> >   S.s = supplier
> >   S.c = consumer
> >   S.f = function
> >   S.o = operator
> >
> > This gets to the general problem of being able to translate lambdas
> between different languages as well as being able to send lambdas over the
> wire.
> >
> > Thoughts?,
> > Marko.
> >
> > http://markorodriguez.com 
> >
> >
> >
>
>


Re: gremlin_python GLV

2016-06-15 Thread David Brown
By the error I expect you have the server configured for REST.
gremlinclient still only supports websockets.

On Wed, Jun 15, 2016 at 8:10 PM, David Brown  wrote:
> Are u using websocket or http?
>
> On Jun 15, 2016 17:09, "Marko Rodriguez"  wrote:
>>
>> Dar.
>>
>> >>> g.V().name.toList()
>> Traceback (most recent call last):
>>   File "", line 1, in 
>>   File
>> "/Users/marko/software/tinkerpop/gremlin-variant/src/main/jython/gremlin_python/gremlin_python.py",
>> line 107, in toList
>> return list(iter(self))
>>   File
>> "/Users/marko/software/tinkerpop/gremlin-variant/src/main/jython/gremlin_python/gremlin_python.py",
>> line 110, in next
>> self.results =
>> self.remote_connection.submit(self.translator.script_engine,
>> self.translator.traversal_script, self.bindings)
>>   File
>> "/Library/Python/2.7/site-packages/gremlinclient/tornado_client/remote_connection.py",
>> line 20, in submit
>> results = self._loop.run_sync(lambda:
>>   File "/Library/Python/2.7/site-packages/tornado/ioloop.py", line 453, in
>> run_sync
>> return future_cell[0].result()
>>   File "/Library/Python/2.7/site-packages/tornado/concurrent.py", line
>> 232, in result
>> raise_exc_info(self._exc_info)
>>   File "/Library/Python/2.7/site-packages/tornado/gen.py", line 1014, in
>> run
>> yielded = self.gen.throw(*exc_info)
>>   File
>> "/Library/Python/2.7/site-packages/gremlinclient/tornado_client/remote_connection.py",
>> line 27, in _execute
>> conn = yield self._pool.acquire()
>>   File "/Library/Python/2.7/site-packages/tornado/gen.py", line 1008, in
>> run
>> value = future.result()
>>   File "/Library/Python/2.7/site-packages/tornado/concurrent.py", line
>> 232, in result
>> raise_exc_info(self._exc_info)
>>   File "", line 3, in raise_exc_info
>> tornado.httpclient.HTTPError: HTTP 400: Bad Request
>>
>>
>>
>>
>> > On Jun 15, 2016, at 5:36 PM, David Brown  wrote:
>> >
>> > Nice Leif!
>> >
>> > I just added very basic support for the RemoteConnection interface in
>> > gremlinclient:
>> >
>> >
>> > http://gremlinclient.readthedocs.io/en/latest/usage.html#the-remoteconnection-object
>> >
>> > It needs more tests etc., but it seems to be working well. If you want
>> > to try it out, you can pip install gremlinclient from github:
>> >
>> > pip install git+https://github.com/davebshow/gremlinclient.git
>> >
>> > More tomorrow...
>> >
>> > On Wed, Jun 15, 2016 at 7:17 PM, Leifur Halldor Asgeirsson
>> >  wrote:
>> >> Thanks! I'll submit my PR in the morning.
>> >>
>> >> 
>> >> From: Marko Rodriguez 
>> >> Sent: June 15, 2016 6:13 PM
>> >> To: dev@tinkerpop.apache.org
>> >> Subject: Re: gremlin_python GLV
>> >>
>> >> Hi,
>> >>
>> >> That is a really good idea.
>> >>
>> >> Want to do a PR to the branch or do you want me to just take your
>> >> notes/gist and make it happen?
>> >>
>> >> Marko.
>> >>
>> >> http://markorodriguez.com
>> >>
>> >>
>> >>
>> >>> On Jun 15, 2016, at 3:55 PM, Leifur Halldor Asgeirsson
>> >>>  wrote:
>> >>>
>> >>> Hi all,
>> >>> I have a couple of suggestions for the GLV.
>> >>>
>> >>> Firstly, it would be useful to be able to inject arbitrary
>> >>> expressions, such as static constructors. For example, in an application
>> >>> that I'm currently working on, I use Titan's Geoshape property type. I 
>> >>> would
>> >>> like to be able to call one of the static constructors on the Geoshape 
>> >>> class
>> >>> in a script, passing it bound parameters. Something like
>> >>>
>> >>> "g.V().has('location', geoWithin(Geoshape.circle(lat, lon, radius)))"
>> >>> with bound parameters {'lat': 45, 'lon': 45, 'radius': '10'}
>> >>>
>> >>> I took an initial stab at this today, and this is what I came up with:
>> >>> https://gist.github.com/leifurhauks/5a843379183123dbed1134a92691a335
>> >>>
>> >>> With those changes, I can use that static constructor in a traversal
>> >>> as follows:
>> >>>
>> >> translator = GroovyTranslator('g')
>> >> g = PythonGraphTraversalSource(translator)
>> >> t = g.V().has('location', RawExpression('Geoshape.point(', B('lat',
>> >> 45), ', ', B('lon', 45), ')'))
>> >> str(t)
>> >>> 'g.V().has("location", Geoshape.point(lat, lon))'
>> >> t.bindings
>> >>> {'lon': 45, 'lat': 45}
>> >>>
>> >>> That raw expression isn't very readable, but a simple helper class can
>> >>> fix that:
>> >>>
>> >>> class Geoshape(object):
>> >>>   @staticmethod
>> >>>   def point(latitude, longitude, symbols=('lat', 'lon')):
>> >>>   return RawExpression(
>> >>>   'Geoshape.point(', B(symbols[0], latitude), ', ',
>> >>> B(symbols[1], longitude), ')')
>> >>>
>> >>> Now I can rewrite the previous traversal to be much clearer:
>> >>>
>> >>> t = g.V().has('location', Geoshape.point(45, 45))
>> >>>
>> >>>
>> >>> If this seems like a reasonable approach, I would be happy to submit a
>> >>> PR.
>> >>>
>> >>>
>> >>> I have one other suggestion, but this one is tiny. Because most of the
>> >>> steps on PythonGraphTravers

Re: gremlin_python GLV

2016-06-15 Thread David Brown
Are u using websocket or http?
On Jun 15, 2016 17:09, "Marko Rodriguez"  wrote:

> Dar.
>
> >>> g.V().name.toList()
> Traceback (most recent call last):
>   File "", line 1, in 
>   File
> "/Users/marko/software/tinkerpop/gremlin-variant/src/main/jython/gremlin_python/gremlin_python.py",
> line 107, in toList
> return list(iter(self))
>   File
> "/Users/marko/software/tinkerpop/gremlin-variant/src/main/jython/gremlin_python/gremlin_python.py",
> line 110, in next
> self.results =
> self.remote_connection.submit(self.translator.script_engine,
> self.translator.traversal_script, self.bindings)
>   File
> "/Library/Python/2.7/site-packages/gremlinclient/tornado_client/remote_connection.py",
> line 20, in submit
> results = self._loop.run_sync(lambda:
>   File "/Library/Python/2.7/site-packages/tornado/ioloop.py", line 453, in
> run_sync
> return future_cell[0].result()
>   File "/Library/Python/2.7/site-packages/tornado/concurrent.py", line
> 232, in result
> raise_exc_info(self._exc_info)
>   File "/Library/Python/2.7/site-packages/tornado/gen.py", line 1014, in
> run
> yielded = self.gen.throw(*exc_info)
>   File
> "/Library/Python/2.7/site-packages/gremlinclient/tornado_client/remote_connection.py",
> line 27, in _execute
> conn = yield self._pool.acquire()
>   File "/Library/Python/2.7/site-packages/tornado/gen.py", line 1008, in
> run
> value = future.result()
>   File "/Library/Python/2.7/site-packages/tornado/concurrent.py", line
> 232, in result
> raise_exc_info(self._exc_info)
>   File "", line 3, in raise_exc_info
> tornado.httpclient.HTTPError: HTTP 400: Bad Request
>
>
>
>
> > On Jun 15, 2016, at 5:36 PM, David Brown  wrote:
> >
> > Nice Leif!
> >
> > I just added very basic support for the RemoteConnection interface in
> > gremlinclient:
> >
> >
> http://gremlinclient.readthedocs.io/en/latest/usage.html#the-remoteconnection-object
> >
> > It needs more tests etc., but it seems to be working well. If you want
> > to try it out, you can pip install gremlinclient from github:
> >
> > pip install git+https://github.com/davebshow/gremlinclient.git
> >
> > More tomorrow...
> >
> > On Wed, Jun 15, 2016 at 7:17 PM, Leifur Halldor Asgeirsson
> >  wrote:
> >> Thanks! I'll submit my PR in the morning.
> >>
> >> 
> >> From: Marko Rodriguez 
> >> Sent: June 15, 2016 6:13 PM
> >> To: dev@tinkerpop.apache.org
> >> Subject: Re: gremlin_python GLV
> >>
> >> Hi,
> >>
> >> That is a really good idea.
> >>
> >> Want to do a PR to the branch or do you want me to just take your
> notes/gist and make it happen?
> >>
> >> Marko.
> >>
> >> http://markorodriguez.com
> >>
> >>
> >>
> >>> On Jun 15, 2016, at 3:55 PM, Leifur Halldor Asgeirsson <
> lasgeirs...@zerofail.com> wrote:
> >>>
> >>> Hi all,
> >>> I have a couple of suggestions for the GLV.
> >>>
> >>> Firstly, it would be useful to be able to inject arbitrary
> expressions, such as static constructors. For example, in an application
> that I'm currently working on, I use Titan's Geoshape property type. I
> would like to be able to call one of the static constructors on the
> Geoshape class in a script, passing it bound parameters. Something like
> >>>
> >>> "g.V().has('location', geoWithin(Geoshape.circle(lat, lon, radius)))"
> >>> with bound parameters {'lat': 45, 'lon': 45, 'radius': '10'}
> >>>
> >>> I took an initial stab at this today, and this is what I came up with:
> >>> https://gist.github.com/leifurhauks/5a843379183123dbed1134a92691a335
> >>>
> >>> With those changes, I can use that static constructor in a traversal
> as follows:
> >>>
> >> translator = GroovyTranslator('g')
> >> g = PythonGraphTraversalSource(translator)
> >> t = g.V().has('location', RawExpression('Geoshape.point(', B('lat',
> 45), ', ', B('lon', 45), ')'))
> >> str(t)
> >>> 'g.V().has("location", Geoshape.point(lat, lon))'
> >> t.bindings
> >>> {'lon': 45, 'lat': 45}
> >>>
> >>> That raw expression isn't very readable, but a simple helper class can
> fix that:
> >>>
> >>> class Geoshape(object):
> >>>   @staticmethod
> >>>   def point(latitude, longitude, symbols=('lat', 'lon')):
> >>>   return RawExpression(
> >>>   'Geoshape.point(', B(symbols[0], latitude), ', ',
> B(symbols[1], longitude), ')')
> >>>
> >>> Now I can rewrite the previous traversal to be much clearer:
> >>>
> >>> t = g.V().has('location', Geoshape.point(45, 45))
> >>>
> >>>
> >>> If this seems like a reasonable approach, I would be happy to submit a
> PR.
> >>>
> >>>
> >>> I have one other suggestion, but this one is tiny. Because most of the
> steps on PythonGraphTraversal have the same implementation, it would be
> possible to specify that implementation once in a function factory, like
> this:
> >>>
> >>> def simple_step(name):
> >>>   def step_method(self, *args):
> >>>   self.translator.addStep(self, name, *args)
> >>>   for arg in args:
> >>>   if type(arg) is B:
> >>>   self.bi

Re: gremlin_python GLV

2016-06-15 Thread Marko Rodriguez
Dar.

>>> g.V().name.toList()
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/Users/marko/software/tinkerpop/gremlin-variant/src/main/jython/gremlin_python/gremlin_python.py",
 line 107, in toList
return list(iter(self))
  File 
"/Users/marko/software/tinkerpop/gremlin-variant/src/main/jython/gremlin_python/gremlin_python.py",
 line 110, in next
self.results = self.remote_connection.submit(self.translator.script_engine, 
self.translator.traversal_script, self.bindings)
  File 
"/Library/Python/2.7/site-packages/gremlinclient/tornado_client/remote_connection.py",
 line 20, in submit
results = self._loop.run_sync(lambda:
  File "/Library/Python/2.7/site-packages/tornado/ioloop.py", line 453, in 
run_sync
return future_cell[0].result()
  File "/Library/Python/2.7/site-packages/tornado/concurrent.py", line 232, in 
result
raise_exc_info(self._exc_info)
  File "/Library/Python/2.7/site-packages/tornado/gen.py", line 1014, in run
yielded = self.gen.throw(*exc_info)
  File 
"/Library/Python/2.7/site-packages/gremlinclient/tornado_client/remote_connection.py",
 line 27, in _execute
conn = yield self._pool.acquire()
  File "/Library/Python/2.7/site-packages/tornado/gen.py", line 1008, in run
value = future.result()
  File "/Library/Python/2.7/site-packages/tornado/concurrent.py", line 232, in 
result
raise_exc_info(self._exc_info)
  File "", line 3, in raise_exc_info
tornado.httpclient.HTTPError: HTTP 400: Bad Request




> On Jun 15, 2016, at 5:36 PM, David Brown  wrote:
> 
> Nice Leif!
> 
> I just added very basic support for the RemoteConnection interface in
> gremlinclient:
> 
> http://gremlinclient.readthedocs.io/en/latest/usage.html#the-remoteconnection-object
> 
> It needs more tests etc., but it seems to be working well. If you want
> to try it out, you can pip install gremlinclient from github:
> 
> pip install git+https://github.com/davebshow/gremlinclient.git
> 
> More tomorrow...
> 
> On Wed, Jun 15, 2016 at 7:17 PM, Leifur Halldor Asgeirsson
>  wrote:
>> Thanks! I'll submit my PR in the morning.
>> 
>> 
>> From: Marko Rodriguez 
>> Sent: June 15, 2016 6:13 PM
>> To: dev@tinkerpop.apache.org
>> Subject: Re: gremlin_python GLV
>> 
>> Hi,
>> 
>> That is a really good idea.
>> 
>> Want to do a PR to the branch or do you want me to just take your notes/gist 
>> and make it happen?
>> 
>> Marko.
>> 
>> http://markorodriguez.com
>> 
>> 
>> 
>>> On Jun 15, 2016, at 3:55 PM, Leifur Halldor Asgeirsson 
>>>  wrote:
>>> 
>>> Hi all,
>>> I have a couple of suggestions for the GLV.
>>> 
>>> Firstly, it would be useful to be able to inject arbitrary expressions, 
>>> such as static constructors. For example, in an application that I'm 
>>> currently working on, I use Titan's Geoshape property type. I would like to 
>>> be able to call one of the static constructors on the Geoshape class in a 
>>> script, passing it bound parameters. Something like
>>> 
>>> "g.V().has('location', geoWithin(Geoshape.circle(lat, lon, radius)))"
>>> with bound parameters {'lat': 45, 'lon': 45, 'radius': '10'}
>>> 
>>> I took an initial stab at this today, and this is what I came up with:
>>> https://gist.github.com/leifurhauks/5a843379183123dbed1134a92691a335
>>> 
>>> With those changes, I can use that static constructor in a traversal as 
>>> follows:
>>> 
>> translator = GroovyTranslator('g')
>> g = PythonGraphTraversalSource(translator)
>> t = g.V().has('location', RawExpression('Geoshape.point(', B('lat', 45), 
>> ', ', B('lon', 45), ')'))
>> str(t)
>>> 'g.V().has("location", Geoshape.point(lat, lon))'
>> t.bindings
>>> {'lon': 45, 'lat': 45}
>>> 
>>> That raw expression isn't very readable, but a simple helper class can fix 
>>> that:
>>> 
>>> class Geoshape(object):
>>>   @staticmethod
>>>   def point(latitude, longitude, symbols=('lat', 'lon')):
>>>   return RawExpression(
>>>   'Geoshape.point(', B(symbols[0], latitude), ', ', B(symbols[1], 
>>> longitude), ')')
>>> 
>>> Now I can rewrite the previous traversal to be much clearer:
>>> 
>>> t = g.V().has('location', Geoshape.point(45, 45))
>>> 
>>> 
>>> If this seems like a reasonable approach, I would be happy to submit a PR.
>>> 
>>> 
>>> I have one other suggestion, but this one is tiny. Because most of the 
>>> steps on PythonGraphTraversal have the same implementation, it would be 
>>> possible to specify that implementation once in a function factory, like 
>>> this:
>>> 
>>> def simple_step(name):
>>>   def step_method(self, *args):
>>>   self.translator.addStep(self, name, *args)
>>>   for arg in args:
>>>   if type(arg) is B:
>>>   self.bindings[arg.symbol] = arg.value
>>>   return self
>>> return step_method
>>> 
>>> Then, on PythonGraphTraversal, all the step methods that use that 
>>> implementation could be declared like this:
>>> 
>>> class PythonGraphTraversal(object):
>>>   def __init__(self, translator,

Re: gremlin_python GLV

2016-06-15 Thread David Brown
Nice Leif!

I just added very basic support for the RemoteConnection interface in
gremlinclient:

http://gremlinclient.readthedocs.io/en/latest/usage.html#the-remoteconnection-object

It needs more tests etc., but it seems to be working well. If you want
to try it out, you can pip install gremlinclient from github:

pip install git+https://github.com/davebshow/gremlinclient.git

More tomorrow...

On Wed, Jun 15, 2016 at 7:17 PM, Leifur Halldor Asgeirsson
 wrote:
> Thanks! I'll submit my PR in the morning.
>
> 
> From: Marko Rodriguez 
> Sent: June 15, 2016 6:13 PM
> To: dev@tinkerpop.apache.org
> Subject: Re: gremlin_python GLV
>
> Hi,
>
> That is a really good idea.
>
> Want to do a PR to the branch or do you want me to just take your notes/gist 
> and make it happen?
>
> Marko.
>
> http://markorodriguez.com
>
>
>
>> On Jun 15, 2016, at 3:55 PM, Leifur Halldor Asgeirsson 
>>  wrote:
>>
>> Hi all,
>> I have a couple of suggestions for the GLV.
>>
>> Firstly, it would be useful to be able to inject arbitrary expressions, such 
>> as static constructors. For example, in an application that I'm currently 
>> working on, I use Titan's Geoshape property type. I would like to be able to 
>> call one of the static constructors on the Geoshape class in a script, 
>> passing it bound parameters. Something like
>>
>> "g.V().has('location', geoWithin(Geoshape.circle(lat, lon, radius)))"
>> with bound parameters {'lat': 45, 'lon': 45, 'radius': '10'}
>>
>> I took an initial stab at this today, and this is what I came up with:
>> https://gist.github.com/leifurhauks/5a843379183123dbed1134a92691a335
>>
>> With those changes, I can use that static constructor in a traversal as 
>> follows:
>>
> translator = GroovyTranslator('g')
> g = PythonGraphTraversalSource(translator)
> t = g.V().has('location', RawExpression('Geoshape.point(', B('lat', 45), 
> ', ', B('lon', 45), ')'))
> str(t)
>> 'g.V().has("location", Geoshape.point(lat, lon))'
> t.bindings
>> {'lon': 45, 'lat': 45}
>>
>> That raw expression isn't very readable, but a simple helper class can fix 
>> that:
>>
>> class Geoshape(object):
>>@staticmethod
>>def point(latitude, longitude, symbols=('lat', 'lon')):
>>return RawExpression(
>>'Geoshape.point(', B(symbols[0], latitude), ', ', B(symbols[1], 
>> longitude), ')')
>>
>> Now I can rewrite the previous traversal to be much clearer:
>>
>> t = g.V().has('location', Geoshape.point(45, 45))
>>
>>
>> If this seems like a reasonable approach, I would be happy to submit a PR.
>>
>>
>> I have one other suggestion, but this one is tiny. Because most of the steps 
>> on PythonGraphTraversal have the same implementation, it would be possible 
>> to specify that implementation once in a function factory, like this:
>>
>> def simple_step(name):
>>def step_method(self, *args):
>>self.translator.addStep(self, name, *args)
>>for arg in args:
>>if type(arg) is B:
>>self.bindings[arg.symbol] = arg.value
>>return self
>> return step_method
>>
>> Then, on PythonGraphTraversal, all the step methods that use that 
>> implementation could be declared like this:
>>
>> class PythonGraphTraversal(object):
>>def __init__(self, translator, remote_connection=None):
>># elided ...
>># top methods elided
>>has = simple_step('has')
>>hasId = simple_step('hasId')
>>hasKey = smple_step('hasKey')
>># and so on...
>>
>>
>> 
>> From: David Brown 
>> Sent: June 15, 2016 3:23 PM
>> To: dev@tinkerpop.apache.org
>> Subject: Re: gremlin_python GLV
>>
>> Ok Stephen I will. I can't claim to be an expert (especially when it
>> comes to the Java ecosystem), but I will definitely take a look.
>>
>> Also, Marko, Python doesn't really have primitives as such. The built
>> in function isinstance should work for everything in gremlin_python
>> e.g. ``isinstance(var, bool)``. I can take a look at this when I make
>> a PR if you'd like, but it really isn't a huge deal anyway.
>>
>> On Wed, Jun 15, 2016 at 3:16 PM, Stephen Mallette  
>> wrote:
>>> David, it would also be great to get your feedback on the
>>> packaging/deployment approach we have so far. I have some basic figured out
>>> for deployment to pypi over maven via twine, but it could use an experts
>>> eye. You probably don't need to check that part out now as you are already
>>> have some other stuff to look at, but I just wanted to mention that so that
>>> it was in your mind for later. Thanks for your help on this.
>>>
>>> On Wed, Jun 15, 2016 at 3:02 PM, Marko Rodriguez 
>>> wrote:
>>>
 Hello,

> I was reading through the gremlin_python GLV code this morning, and
> overall it looks like it should work pretty smoothly. Thanks for doing
> this Marko, really cool work! I just wanted to comment on a few things
> that popped out at me on my first reading.The major issu

Re: gremlin_python GLV

2016-06-15 Thread Leifur Halldor Asgeirsson
Thanks! I'll submit my PR in the morning.


From: Marko Rodriguez 
Sent: June 15, 2016 6:13 PM
To: dev@tinkerpop.apache.org
Subject: Re: gremlin_python GLV

Hi,

That is a really good idea.

Want to do a PR to the branch or do you want me to just take your notes/gist 
and make it happen?

Marko.

http://markorodriguez.com



> On Jun 15, 2016, at 3:55 PM, Leifur Halldor Asgeirsson 
>  wrote:
>
> Hi all,
> I have a couple of suggestions for the GLV.
>
> Firstly, it would be useful to be able to inject arbitrary expressions, such 
> as static constructors. For example, in an application that I'm currently 
> working on, I use Titan's Geoshape property type. I would like to be able to 
> call one of the static constructors on the Geoshape class in a script, 
> passing it bound parameters. Something like
>
> "g.V().has('location', geoWithin(Geoshape.circle(lat, lon, radius)))"
> with bound parameters {'lat': 45, 'lon': 45, 'radius': '10'}
>
> I took an initial stab at this today, and this is what I came up with:
> https://gist.github.com/leifurhauks/5a843379183123dbed1134a92691a335
>
> With those changes, I can use that static constructor in a traversal as 
> follows:
>
 translator = GroovyTranslator('g')
 g = PythonGraphTraversalSource(translator)
 t = g.V().has('location', RawExpression('Geoshape.point(', B('lat', 45), 
 ', ', B('lon', 45), ')'))
 str(t)
> 'g.V().has("location", Geoshape.point(lat, lon))'
 t.bindings
> {'lon': 45, 'lat': 45}
>
> That raw expression isn't very readable, but a simple helper class can fix 
> that:
>
> class Geoshape(object):
>@staticmethod
>def point(latitude, longitude, symbols=('lat', 'lon')):
>return RawExpression(
>'Geoshape.point(', B(symbols[0], latitude), ', ', B(symbols[1], 
> longitude), ')')
>
> Now I can rewrite the previous traversal to be much clearer:
>
> t = g.V().has('location', Geoshape.point(45, 45))
>
>
> If this seems like a reasonable approach, I would be happy to submit a PR.
>
>
> I have one other suggestion, but this one is tiny. Because most of the steps 
> on PythonGraphTraversal have the same implementation, it would be possible to 
> specify that implementation once in a function factory, like this:
>
> def simple_step(name):
>def step_method(self, *args):
>self.translator.addStep(self, name, *args)
>for arg in args:
>if type(arg) is B:
>self.bindings[arg.symbol] = arg.value
>return self
> return step_method
>
> Then, on PythonGraphTraversal, all the step methods that use that 
> implementation could be declared like this:
>
> class PythonGraphTraversal(object):
>def __init__(self, translator, remote_connection=None):
># elided ...
># top methods elided
>has = simple_step('has')
>hasId = simple_step('hasId')
>hasKey = smple_step('hasKey')
># and so on...
>
>
> 
> From: David Brown 
> Sent: June 15, 2016 3:23 PM
> To: dev@tinkerpop.apache.org
> Subject: Re: gremlin_python GLV
>
> Ok Stephen I will. I can't claim to be an expert (especially when it
> comes to the Java ecosystem), but I will definitely take a look.
>
> Also, Marko, Python doesn't really have primitives as such. The built
> in function isinstance should work for everything in gremlin_python
> e.g. ``isinstance(var, bool)``. I can take a look at this when I make
> a PR if you'd like, but it really isn't a huge deal anyway.
>
> On Wed, Jun 15, 2016 at 3:16 PM, Stephen Mallette  
> wrote:
>> David, it would also be great to get your feedback on the
>> packaging/deployment approach we have so far. I have some basic figured out
>> for deployment to pypi over maven via twine, but it could use an experts
>> eye. You probably don't need to check that part out now as you are already
>> have some other stuff to look at, but I just wanted to mention that so that
>> it was in your mind for later. Thanks for your help on this.
>>
>> On Wed, Jun 15, 2016 at 3:02 PM, Marko Rodriguez 
>> wrote:
>>
>>> Hello,
>>>
 I was reading through the gremlin_python GLV code this morning, and
 overall it looks like it should work pretty smoothly. Thanks for doing
 this Marko, really cool work! I just wanted to comment on a few things
 that popped out at me on my first reading.The major issue I see is
 that it is not currently Python 2/3 compatible. This is due to two
 things:
>>>
>>> Cool! Thank you for taking your time to review the work.
>>>
 1. The way iterators are implemented in Python 2/3 is different. This
 problem could be remedied by adding a method to
 ``PythonGraphTraversal``, something like:

 def __next__(self):
   return self.next()

 then, in the ``next`` method, changing line 113 to
 ``next(self.results)``, should take care of this problem.
>>>
>>> Updated.
>>>
 2. The ``GroovyTranslator`` class checks for type ``long``, 

Ogre 3.0.0.0-beta

2016-06-15 Thread Stephen Mallette
Ogre, the Clojure wrapper for Gremlin, has just released an official
version to work with TinkerPop 3.x. Specifically it is working with
TinkerPop 3.2.0-incubating.

https://github.com/clojurewerkz/ogre

This is a beta release that is meant to gather feedback on the API and to
smooth out some rough edges, but it is fully compliant with the TinkerPop
process test suite so all your Gremlin should translate nicely to it.
Here's a simple example of what it looks like:

clojurewerkz.ogre.core=> (def graph (open-graph))
#'clojurewerkz.ogre.core/graph
clojurewerkz.ogre.core=> (def g (traversal graph))
#'clojurewerkz.ogre.core/g
clojurewerkz.ogre.core=>
(org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory/generateModern
graph)
nil
clojurewerkz.ogre.core=> (traverse g V (match
#_=>   (__ (as :a) (out :created) (as :b))
#_=>   (__ (as :b) (has :name "lop"))
#_=>   (__ (as :b) (in :created) (as :c))
#_=>   (__ (as :c) (has :age 29)))
#_=>   (select :a :c) (by :name)
#_=>   (into-seq!))
({"a" "marko", "c" "marko"} {"a" "josh", "c" "marko"} {"a" "peter", "c"
"marko"})

The documentation still needs some a bit of work, but feel free to play
around. If you are familiar with Gremlin Java/Groovy/Scala, it should be
pretty easy to follow. Enjoy!


Re: gremlin_python GLV

2016-06-15 Thread Marko Rodriguez
Hi,

That is a really good idea.

Want to do a PR to the branch or do you want me to just take your notes/gist 
and make it happen?

Marko.

http://markorodriguez.com



> On Jun 15, 2016, at 3:55 PM, Leifur Halldor Asgeirsson 
>  wrote:
> 
> Hi all,
> I have a couple of suggestions for the GLV.
> 
> Firstly, it would be useful to be able to inject arbitrary expressions, such 
> as static constructors. For example, in an application that I'm currently 
> working on, I use Titan's Geoshape property type. I would like to be able to 
> call one of the static constructors on the Geoshape class in a script, 
> passing it bound parameters. Something like
> 
> "g.V().has('location', geoWithin(Geoshape.circle(lat, lon, radius)))"
> with bound parameters {'lat': 45, 'lon': 45, 'radius': '10'}
> 
> I took an initial stab at this today, and this is what I came up with:
> https://gist.github.com/leifurhauks/5a843379183123dbed1134a92691a335
> 
> With those changes, I can use that static constructor in a traversal as 
> follows:
> 
 translator = GroovyTranslator('g')
 g = PythonGraphTraversalSource(translator)
 t = g.V().has('location', RawExpression('Geoshape.point(', B('lat', 45), 
 ', ', B('lon', 45), ')'))
 str(t)
> 'g.V().has("location", Geoshape.point(lat, lon))'
 t.bindings
> {'lon': 45, 'lat': 45}
> 
> That raw expression isn't very readable, but a simple helper class can fix 
> that:
> 
> class Geoshape(object):
>@staticmethod
>def point(latitude, longitude, symbols=('lat', 'lon')):
>return RawExpression(
>'Geoshape.point(', B(symbols[0], latitude), ', ', B(symbols[1], 
> longitude), ')')
> 
> Now I can rewrite the previous traversal to be much clearer:
> 
> t = g.V().has('location', Geoshape.point(45, 45))
> 
> 
> If this seems like a reasonable approach, I would be happy to submit a PR.
> 
> 
> I have one other suggestion, but this one is tiny. Because most of the steps 
> on PythonGraphTraversal have the same implementation, it would be possible to 
> specify that implementation once in a function factory, like this:
> 
> def simple_step(name):
>def step_method(self, *args):
>self.translator.addStep(self, name, *args)
>for arg in args:
>if type(arg) is B:
>self.bindings[arg.symbol] = arg.value
>return self
> return step_method
> 
> Then, on PythonGraphTraversal, all the step methods that use that 
> implementation could be declared like this:
> 
> class PythonGraphTraversal(object):
>def __init__(self, translator, remote_connection=None):
># elided ...
># top methods elided
>has = simple_step('has')
>hasId = simple_step('hasId')
>hasKey = smple_step('hasKey')
># and so on...
> 
> 
> 
> From: David Brown 
> Sent: June 15, 2016 3:23 PM
> To: dev@tinkerpop.apache.org
> Subject: Re: gremlin_python GLV
> 
> Ok Stephen I will. I can't claim to be an expert (especially when it
> comes to the Java ecosystem), but I will definitely take a look.
> 
> Also, Marko, Python doesn't really have primitives as such. The built
> in function isinstance should work for everything in gremlin_python
> e.g. ``isinstance(var, bool)``. I can take a look at this when I make
> a PR if you'd like, but it really isn't a huge deal anyway.
> 
> On Wed, Jun 15, 2016 at 3:16 PM, Stephen Mallette  
> wrote:
>> David, it would also be great to get your feedback on the
>> packaging/deployment approach we have so far. I have some basic figured out
>> for deployment to pypi over maven via twine, but it could use an experts
>> eye. You probably don't need to check that part out now as you are already
>> have some other stuff to look at, but I just wanted to mention that so that
>> it was in your mind for later. Thanks for your help on this.
>> 
>> On Wed, Jun 15, 2016 at 3:02 PM, Marko Rodriguez 
>> wrote:
>> 
>>> Hello,
>>> 
 I was reading through the gremlin_python GLV code this morning, and
 overall it looks like it should work pretty smoothly. Thanks for doing
 this Marko, really cool work! I just wanted to comment on a few things
 that popped out at me on my first reading.The major issue I see is
 that it is not currently Python 2/3 compatible. This is due to two
 things:
>>> 
>>> Cool! Thank you for taking your time to review the work.
>>> 
 1. The way iterators are implemented in Python 2/3 is different. This
 problem could be remedied by adding a method to
 ``PythonGraphTraversal``, something like:
 
 def __next__(self):
   return self.next()
 
 then, in the ``next`` method, changing line 113 to
 ``next(self.results)``, should take care of this problem.
>>> 
>>> Updated.
>>> 
 2. The ``GroovyTranslator`` class checks for type ``long``, this no
 longer exists in Python 3. Determining what to submit as a Long might
 require some discussion, but this could be easily fixed by adding
 somethi

Re: [DISCUSS] S-Type

2016-06-15 Thread Marko Rodriguez
Hi,

What do people think of this idea:

https://gist.github.com/okram/df6a104bde51a4f4f6f0da11f46909d5 


If you pass a lambda/closure/anonymousFunction/etc. in the respective language 
(during translation), it calls it to get the string representation. … ? 

Marko.

http://markorodriguez.com



> On Jun 15, 2016, at 10:50 AM, Marko Rodriguez  wrote:
> 
> Hello,
> 
> I think we should introduce an S object. It would stand for Script and would 
> allow you to do:
> 
> S.f(“{ it.length }”)
> 
> Where does this come in handy? Language variants.
> 
> Imagine using gremlin_python that will compile to Gremlin-Groovy for 
> execution at GremlinServer.
> 
>   g.V().out(“knows”)[0:2].name.map(f(“{ it.length }”))
> 
> Next, imagine you are in Gremlin-Java and want to submit a traversal to 
> GremlinServer, but it has a lambda. No worries, just use the GroovyTranslator 
> and you have:
> 
>   g.V().out(“knows”).limit(2).values(“name”).map(f(“{ it.length }”))
> 
> We could also have:
> 
>   S.s = supplier
>   S.c = consumer
>   S.f = function
>   S.o = operator
> 
> This gets to the general problem of being able to translate lambdas between 
> different languages as well as being able to send lambdas over the wire.
> 
> Thoughts?,
> Marko.
> 
> http://markorodriguez.com 
> 
> 
> 



Re: gremlin_python GLV

2016-06-15 Thread Leifur Halldor Asgeirsson
Hi all,
I have a couple of suggestions for the GLV.

Firstly, it would be useful to be able to inject arbitrary expressions, such as 
static constructors. For example, in an application that I'm currently working 
on, I use Titan's Geoshape property type. I would like to be able to call one 
of the static constructors on the Geoshape class in a script, passing it bound 
parameters. Something like

"g.V().has('location', geoWithin(Geoshape.circle(lat, lon, radius)))"
with bound parameters {'lat': 45, 'lon': 45, 'radius': '10'}

I took an initial stab at this today, and this is what I came up with:
https://gist.github.com/leifurhauks/5a843379183123dbed1134a92691a335

With those changes, I can use that static constructor in a traversal as follows:

>>> translator = GroovyTranslator('g')
>>> g = PythonGraphTraversalSource(translator)
>>> t = g.V().has('location', RawExpression('Geoshape.point(', B('lat', 45), ', 
>>> ', B('lon', 45), ')'))
>>> str(t)
'g.V().has("location", Geoshape.point(lat, lon))'
>>> t.bindings
{'lon': 45, 'lat': 45}

That raw expression isn't very readable, but a simple helper class can fix that:

class Geoshape(object):
@staticmethod
def point(latitude, longitude, symbols=('lat', 'lon')):
return RawExpression(
'Geoshape.point(', B(symbols[0], latitude), ', ', B(symbols[1], 
longitude), ')')

Now I can rewrite the previous traversal to be much clearer:

t = g.V().has('location', Geoshape.point(45, 45))


If this seems like a reasonable approach, I would be happy to submit a PR.


I have one other suggestion, but this one is tiny. Because most of the steps on 
PythonGraphTraversal have the same implementation, it would be possible to 
specify that implementation once in a function factory, like this:

def simple_step(name):
def step_method(self, *args):
self.translator.addStep(self, name, *args)
for arg in args:
if type(arg) is B:
self.bindings[arg.symbol] = arg.value
return self
return step_method

Then, on PythonGraphTraversal, all the step methods that use that 
implementation could be declared like this:

class PythonGraphTraversal(object):
def __init__(self, translator, remote_connection=None):
# elided ...
# top methods elided
has = simple_step('has')
hasId = simple_step('hasId')
hasKey = smple_step('hasKey')
# and so on...



From: David Brown 
Sent: June 15, 2016 3:23 PM
To: dev@tinkerpop.apache.org
Subject: Re: gremlin_python GLV

Ok Stephen I will. I can't claim to be an expert (especially when it
comes to the Java ecosystem), but I will definitely take a look.

Also, Marko, Python doesn't really have primitives as such. The built
in function isinstance should work for everything in gremlin_python
e.g. ``isinstance(var, bool)``. I can take a look at this when I make
a PR if you'd like, but it really isn't a huge deal anyway.

On Wed, Jun 15, 2016 at 3:16 PM, Stephen Mallette  wrote:
> David, it would also be great to get your feedback on the
> packaging/deployment approach we have so far. I have some basic figured out
> for deployment to pypi over maven via twine, but it could use an experts
> eye. You probably don't need to check that part out now as you are already
> have some other stuff to look at, but I just wanted to mention that so that
> it was in your mind for later. Thanks for your help on this.
>
> On Wed, Jun 15, 2016 at 3:02 PM, Marko Rodriguez 
> wrote:
>
>> Hello,
>>
>> > I was reading through the gremlin_python GLV code this morning, and
>> > overall it looks like it should work pretty smoothly. Thanks for doing
>> > this Marko, really cool work! I just wanted to comment on a few things
>> > that popped out at me on my first reading.The major issue I see is
>> > that it is not currently Python 2/3 compatible. This is due to two
>> > things:
>>
>> Cool! Thank you for taking your time to review the work.
>>
>> > 1. The way iterators are implemented in Python 2/3 is different. This
>> > problem could be remedied by adding a method to
>> > ``PythonGraphTraversal``, something like:
>> >
>> > def __next__(self):
>> >return self.next()
>> >
>> > then, in the ``next`` method, changing line 113 to
>> > ``next(self.results)``, should take care of this problem.
>>
>> Updated.
>>
>> > 2. The ``GroovyTranslator`` class checks for type ``long``, this no
>> > longer exists in Python 3. Determining what to submit as a Long might
>> > require some discussion, but this could be easily fixed by adding
>> > something like:
>> >
>> > import sys
>> > if sys.version_info.major > 2:
>> >long = int
>> >
>> > to the top of the file.
>>
>> Updated.
>>
>> >
>> > Other than this, there are some minor details that could be cleaned
>> > up. Particularly:
>> >
>> > 1. Using ``isinstance`` instead of ``type`` to perform type checking.
>> > This will recognize subclasses and is the most Pythonic way to do
>> > this.
>>
>> Seems isinstanc

Re: Centrality Recipe

2016-06-15 Thread Kelvin Lawrence
Thanks! Your new text looks very good.

Kelvin

On Wednesday, June 15, 2016 at 3:50:13 PM UTC-5, Stephen Mallette wrote:
>
> Hi Kelvin, thanks for the feedback. I hope we can get some more recipes 
> out there (along with more tutorials) with these kinds of more advanced 
> Gremlin examples. 
>
> I didn't re-publish the docs, but I did make the change you suggested:
>
>
> https://github.com/apache/tinkerpop/commit/b67db0c59dab49a1f4d008d21446c9136e8cbf41
>
> it will publish the next time we throw a SNAPSHOT out there.
>
> Take care,
>
> Stephen
>
>
> On Wed, Jun 15, 2016 at 12:57 PM, Kelvin Lawrence  > wrote:
>
>> Hi Stephen, I found your write up extremely useful.
>>
>> As powerful as Gremlin is, a constant piece of feedback I get from people 
>> not as skilled in it as you are is that it is actually quite hard once you 
>> get beyond basic queries to (a) get the Gremlin figured out to perform a 
>> query and (b) come up with optimal Gremlin even if you do get something 
>> working. So I think guides like these have tremendous value.
>>
>> One small suggestion, in the Centrality example, you use multiple by() 
>> steps. I think it would be good to add text that explains what a by() with 
>> no parameters does. I don't think it is immediately obvious to the reader.
>>
>> Keep up the good work!
>>
>> Kelvin
>>
>>
>> On Monday, June 13, 2016 at 2:37:05 PM UTC-5, Stephen Mallette wrote:
>>>
>>> After a few rounds of review and tweaking with Marko and Kuppitz, I've 
>>> published a new Gremlin Recipe that shows different ways to use Gremlin to 
>>> calculate centrality:
>>>
>>> http://tinkerpop.apache.org/docs/3.2.1-SNAPSHOT/recipes/#centrality
>>>
>>> Even if you don't need to calculate centrality in your graph, it might 
>>> be worth your time reviewing this section as some of the traversals are 
>>> reasonably advanced and I did the best I could to pick them apart for your 
>>> learning pleasure. You might note some improved ways of doing things in 
>>> your own Gremlin-related work if you can take some time to dig into the 
>>> samples. Enjoy!
>>>
>>> Stephen
>>>
>>
>

Re: Centrality Recipe

2016-06-15 Thread Stephen Mallette
Hi Kelvin, thanks for the feedback. I hope we can get some more recipes out
there (along with more tutorials) with these kinds of more advanced Gremlin
examples.

I didn't re-publish the docs, but I did make the change you suggested:

https://github.com/apache/tinkerpop/commit/b67db0c59dab49a1f4d008d21446c9136e8cbf41

it will publish the next time we throw a SNAPSHOT out there.

Take care,

Stephen


On Wed, Jun 15, 2016 at 12:57 PM, Kelvin Lawrence <
kelvin.r.lawre...@gmail.com> wrote:

> Hi Stephen, I found your write up extremely useful.
>
> As powerful as Gremlin is, a constant piece of feedback I get from people
> not as skilled in it as you are is that it is actually quite hard once you
> get beyond basic queries to (a) get the Gremlin figured out to perform a
> query and (b) come up with optimal Gremlin even if you do get something
> working. So I think guides like these have tremendous value.
>
> One small suggestion, in the Centrality example, you use multiple by()
> steps. I think it would be good to add text that explains what a by() with
> no parameters does. I don't think it is immediately obvious to the reader.
>
> Keep up the good work!
>
> Kelvin
>
>
> On Monday, June 13, 2016 at 2:37:05 PM UTC-5, Stephen Mallette wrote:
>>
>> After a few rounds of review and tweaking with Marko and Kuppitz, I've
>> published a new Gremlin Recipe that shows different ways to use Gremlin to
>> calculate centrality:
>>
>> http://tinkerpop.apache.org/docs/3.2.1-SNAPSHOT/recipes/#centrality
>>
>> Even if you don't need to calculate centrality in your graph, it might be
>> worth your time reviewing this section as some of the traversals are
>> reasonably advanced and I did the best I could to pick them apart for your
>> learning pleasure. You might note some improved ways of doing things in
>> your own Gremlin-related work if you can take some time to dig into the
>> samples. Enjoy!
>>
>> Stephen
>>
>


Re: gremlin_python GLV

2016-06-15 Thread David Brown
Ok Stephen I will. I can't claim to be an expert (especially when it
comes to the Java ecosystem), but I will definitely take a look.

Also, Marko, Python doesn't really have primitives as such. The built
in function isinstance should work for everything in gremlin_python
e.g. ``isinstance(var, bool)``. I can take a look at this when I make
a PR if you'd like, but it really isn't a huge deal anyway.

On Wed, Jun 15, 2016 at 3:16 PM, Stephen Mallette  wrote:
> David, it would also be great to get your feedback on the
> packaging/deployment approach we have so far. I have some basic figured out
> for deployment to pypi over maven via twine, but it could use an experts
> eye. You probably don't need to check that part out now as you are already
> have some other stuff to look at, but I just wanted to mention that so that
> it was in your mind for later. Thanks for your help on this.
>
> On Wed, Jun 15, 2016 at 3:02 PM, Marko Rodriguez 
> wrote:
>
>> Hello,
>>
>> > I was reading through the gremlin_python GLV code this morning, and
>> > overall it looks like it should work pretty smoothly. Thanks for doing
>> > this Marko, really cool work! I just wanted to comment on a few things
>> > that popped out at me on my first reading.The major issue I see is
>> > that it is not currently Python 2/3 compatible. This is due to two
>> > things:
>>
>> Cool! Thank you for taking your time to review the work.
>>
>> > 1. The way iterators are implemented in Python 2/3 is different. This
>> > problem could be remedied by adding a method to
>> > ``PythonGraphTraversal``, something like:
>> >
>> > def __next__(self):
>> >return self.next()
>> >
>> > then, in the ``next`` method, changing line 113 to
>> > ``next(self.results)``, should take care of this problem.
>>
>> Updated.
>>
>> > 2. The ``GroovyTranslator`` class checks for type ``long``, this no
>> > longer exists in Python 3. Determining what to submit as a Long might
>> > require some discussion, but this could be easily fixed by adding
>> > something like:
>> >
>> > import sys
>> > if sys.version_info.major > 2:
>> >long = int
>> >
>> > to the top of the file.
>>
>> Updated.
>>
>> >
>> > Other than this, there are some minor details that could be cleaned
>> > up. Particularly:
>> >
>> > 1. Using ``isinstance`` instead of ``type`` to perform type checking.
>> > This will recognize subclasses and is the most Pythonic way to do
>> > this.
>>
>> Seems isinstance() isn’t a method on primitives — only objects. Thus, the
>> code got complex. Left it with type().
>>
>> >
>> > 2. Formatting - indents, and line spacing. Typically, Python methods
>> > are separated by a single line, and indents use four spaces. This is
>> > really just cosmetic for readability.
>>
>> Uh. The problem is that the source code is auto-generated from
>> GremlinPythonGenerator. If you want to tweak, please do so:
>>
>>
>> https://github.com/apache/tinkerpop/blob/TINKERPOP-1278/gremlin-variant/src/main/groovy/org/apache/tinkerpop/gremlin/python/GremlinPythonGenerator.groovy
>> <
>> https://github.com/apache/tinkerpop/blob/TINKERPOP-1278/gremlin-variant/src/main/groovy/org/apache/tinkerpop/gremlin/python/GremlinPythonGenerator.groovy
>> >
>>
>>
>> > 3. CamelCase vs. underscores. I understand that to emulate Gremlin,
>> > the traversal methods etc. should use CamelCase. But I wonder if the
>> > helper classes (Translators) should use the Python convention of using
>> > underscores to name methods. Python class names use camel case by
>> > convention.
>>
>>
>> I haven’t changed it. If you feel we should, please do. And yes, I think
>> its good to keep the Gremlin step names camelCase. For Gremlin-Ruby, we
>> will do out_e() style.
>>
>> > Finally, the implementation of the B class may need some work, but
>> > we'll have to play around with it a bit to figure out how the best
>> > approach to doing this.
>>
>>
>> Yea, thats all wrong. I overdosed on the introspection and then Kuppitz
>> was like “Why not just have it as….” (something much simpler — which I
>> forget what it was now).
>>
>> > I'm sure there are more improvements, but I just wanted to get a
>> > conversation going. I would be happy to make a PR with some of these
>> > changes.
>>
>> That’d be awesome. Its in TINKERPOP-1278 branch. In gremlin-variant/test
>> you will see PythonProcessStandardTest and PythonProcessComputerTest. Those
>> verify that the compilation is valid for all the standard and computer
>> tests.
>>
>> > Also, gremlinclient will soon support the RemoteConnection interface,
>> > I'll send out a link to the docs once I get everything up and running.
>>
>> So cool. Please do review the Python RemoteConnection class as again, I
>> just improv’d it.
>>
>> Thanks again David,
>> Marko.
>>
>> http://markorodriguez.com



-- 
David M. Brown
R.A. CulturePlex Lab, Western University


Re: gremlin_python GLV

2016-06-15 Thread Stephen Mallette
David, it would also be great to get your feedback on the
packaging/deployment approach we have so far. I have some basic figured out
for deployment to pypi over maven via twine, but it could use an experts
eye. You probably don't need to check that part out now as you are already
have some other stuff to look at, but I just wanted to mention that so that
it was in your mind for later. Thanks for your help on this.

On Wed, Jun 15, 2016 at 3:02 PM, Marko Rodriguez 
wrote:

> Hello,
>
> > I was reading through the gremlin_python GLV code this morning, and
> > overall it looks like it should work pretty smoothly. Thanks for doing
> > this Marko, really cool work! I just wanted to comment on a few things
> > that popped out at me on my first reading.The major issue I see is
> > that it is not currently Python 2/3 compatible. This is due to two
> > things:
>
> Cool! Thank you for taking your time to review the work.
>
> > 1. The way iterators are implemented in Python 2/3 is different. This
> > problem could be remedied by adding a method to
> > ``PythonGraphTraversal``, something like:
> >
> > def __next__(self):
> >return self.next()
> >
> > then, in the ``next`` method, changing line 113 to
> > ``next(self.results)``, should take care of this problem.
>
> Updated.
>
> > 2. The ``GroovyTranslator`` class checks for type ``long``, this no
> > longer exists in Python 3. Determining what to submit as a Long might
> > require some discussion, but this could be easily fixed by adding
> > something like:
> >
> > import sys
> > if sys.version_info.major > 2:
> >long = int
> >
> > to the top of the file.
>
> Updated.
>
> >
> > Other than this, there are some minor details that could be cleaned
> > up. Particularly:
> >
> > 1. Using ``isinstance`` instead of ``type`` to perform type checking.
> > This will recognize subclasses and is the most Pythonic way to do
> > this.
>
> Seems isinstance() isn’t a method on primitives — only objects. Thus, the
> code got complex. Left it with type().
>
> >
> > 2. Formatting - indents, and line spacing. Typically, Python methods
> > are separated by a single line, and indents use four spaces. This is
> > really just cosmetic for readability.
>
> Uh. The problem is that the source code is auto-generated from
> GremlinPythonGenerator. If you want to tweak, please do so:
>
>
> https://github.com/apache/tinkerpop/blob/TINKERPOP-1278/gremlin-variant/src/main/groovy/org/apache/tinkerpop/gremlin/python/GremlinPythonGenerator.groovy
> <
> https://github.com/apache/tinkerpop/blob/TINKERPOP-1278/gremlin-variant/src/main/groovy/org/apache/tinkerpop/gremlin/python/GremlinPythonGenerator.groovy
> >
>
>
> > 3. CamelCase vs. underscores. I understand that to emulate Gremlin,
> > the traversal methods etc. should use CamelCase. But I wonder if the
> > helper classes (Translators) should use the Python convention of using
> > underscores to name methods. Python class names use camel case by
> > convention.
>
>
> I haven’t changed it. If you feel we should, please do. And yes, I think
> its good to keep the Gremlin step names camelCase. For Gremlin-Ruby, we
> will do out_e() style.
>
> > Finally, the implementation of the B class may need some work, but
> > we'll have to play around with it a bit to figure out how the best
> > approach to doing this.
>
>
> Yea, thats all wrong. I overdosed on the introspection and then Kuppitz
> was like “Why not just have it as….” (something much simpler — which I
> forget what it was now).
>
> > I'm sure there are more improvements, but I just wanted to get a
> > conversation going. I would be happy to make a PR with some of these
> > changes.
>
> That’d be awesome. Its in TINKERPOP-1278 branch. In gremlin-variant/test
> you will see PythonProcessStandardTest and PythonProcessComputerTest. Those
> verify that the compilation is valid for all the standard and computer
> tests.
>
> > Also, gremlinclient will soon support the RemoteConnection interface,
> > I'll send out a link to the docs once I get everything up and running.
>
> So cool. Please do review the Python RemoteConnection class as again, I
> just improv’d it.
>
> Thanks again David,
> Marko.
>
> http://markorodriguez.com


Re: gremlin_python GLV

2016-06-15 Thread Marko Rodriguez
Hello,

> I was reading through the gremlin_python GLV code this morning, and
> overall it looks like it should work pretty smoothly. Thanks for doing
> this Marko, really cool work! I just wanted to comment on a few things
> that popped out at me on my first reading.The major issue I see is
> that it is not currently Python 2/3 compatible. This is due to two
> things:

Cool! Thank you for taking your time to review the work.

> 1. The way iterators are implemented in Python 2/3 is different. This
> problem could be remedied by adding a method to
> ``PythonGraphTraversal``, something like:
> 
> def __next__(self):
>return self.next()
> 
> then, in the ``next`` method, changing line 113 to
> ``next(self.results)``, should take care of this problem.

Updated.

> 2. The ``GroovyTranslator`` class checks for type ``long``, this no
> longer exists in Python 3. Determining what to submit as a Long might
> require some discussion, but this could be easily fixed by adding
> something like:
> 
> import sys
> if sys.version_info.major > 2:
>long = int
> 
> to the top of the file.

Updated.

> 
> Other than this, there are some minor details that could be cleaned
> up. Particularly:
> 
> 1. Using ``isinstance`` instead of ``type`` to perform type checking.
> This will recognize subclasses and is the most Pythonic way to do
> this.

Seems isinstance() isn’t a method on primitives — only objects. Thus, the code 
got complex. Left it with type().

> 
> 2. Formatting - indents, and line spacing. Typically, Python methods
> are separated by a single line, and indents use four spaces. This is
> really just cosmetic for readability.

Uh. The problem is that the source code is auto-generated from 
GremlinPythonGenerator. If you want to tweak, please do so:


https://github.com/apache/tinkerpop/blob/TINKERPOP-1278/gremlin-variant/src/main/groovy/org/apache/tinkerpop/gremlin/python/GremlinPythonGenerator.groovy
 



> 3. CamelCase vs. underscores. I understand that to emulate Gremlin,
> the traversal methods etc. should use CamelCase. But I wonder if the
> helper classes (Translators) should use the Python convention of using
> underscores to name methods. Python class names use camel case by
> convention.


I haven’t changed it. If you feel we should, please do. And yes, I think its 
good to keep the Gremlin step names camelCase. For Gremlin-Ruby, we will do 
out_e() style.

> Finally, the implementation of the B class may need some work, but
> we'll have to play around with it a bit to figure out how the best
> approach to doing this.


Yea, thats all wrong. I overdosed on the introspection and then Kuppitz was 
like “Why not just have it as….” (something much simpler — which I forget what 
it was now).

> I'm sure there are more improvements, but I just wanted to get a
> conversation going. I would be happy to make a PR with some of these
> changes.

That’d be awesome. Its in TINKERPOP-1278 branch. In gremlin-variant/test you 
will see PythonProcessStandardTest and PythonProcessComputerTest. Those verify 
that the compilation is valid for all the standard and computer tests.

> Also, gremlinclient will soon support the RemoteConnection interface,
> I'll send out a link to the docs once I get everything up and running.

So cool. Please do review the Python RemoteConnection class as again, I just 
improv’d it.

Thanks again David,
Marko.

http://markorodriguez.com

[jira] [Commented] (TINKERPOP-1139) [Neo4JGraph] GraphTraversal with SubgraphStrategy removes addLabelStep (as("b"))

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15332272#comment-15332272
 ] 

ASF GitHub Bot commented on TINKERPOP-1139:
---

Github user dkuppitz commented on the issue:

https://github.com/apache/tinkerpop/pull/338
  
VOTE: +1


> [Neo4JGraph] GraphTraversal with SubgraphStrategy removes addLabelStep 
> (as("b"))
> 
>
> Key: TINKERPOP-1139
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1139
> Project: TinkerPop
>  Issue Type: Bug
>  Components: neo4j
>Affects Versions: 3.1.0-incubating
>Reporter: Martijn Maas
> Fix For: 3.1.3
>
>
> I am using the Neo4jGraph with the following SubgraphStrategy:
> {code}
> SubgraphStrategy.build().vertexCriterion(has("isLatest", true)).create();
> {code}
> I have 2 traversals. This one working works:
> {code}
> Map languageCounts =  
> searchResult.as("a").inE("isCreatedBy").outV().outE("hasWorkLanguage").inV().as("b").dedup("a",
>  "b")
>   .has("wwlanguage_name").groupCount()
> .by("wwlanguage_name").next();
> {code}
> This translates to:
> {code}
> [Neo4jGraphStep([],vertex)@[a], 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> VertexStep(IN,[isCreatedBy],edge), 
> TraversalFilterStep([AndStep([[EdgeVertexStep(IN), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])], [EdgeVertexStep(OUT), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])]])]), 
> EdgeVertexStep(OUT), TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> VertexStep(OUT,[hasWorkLanguage],edge), 
> TraversalFilterStep([AndStep([[EdgeVertexStep(IN), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])], [EdgeVertexStep(OUT), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])]])]), 
> EdgeVertexStep(IN)@[b], TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([PropertiesStep([wwlanguage_name],property)]), 
> DedupGlobalStep([a, b]), GroupCountStep(value(wwlanguage_name))]
> {code}
> This one fails:
> {code}
> Map languageCounts = 
> searchResult.as("a").in("isCreatedBy").out("hasWorkLanguage").as("b")
>.dedup("a", 
> "b").has("wwlanguage_name")
>   .groupCount().by("wwlanguage_name").next();
> {code}
> This translates to:
> {code}
> [Neo4jGraphStep([],vertex)@[a], 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> VertexStep(IN,[isCreatedBy],edge), 
> TraversalFilterStep([AndStep([[EdgeVertexStep(IN), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])], [EdgeVertexStep(OUT), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])]])]), 
> EdgeVertexStep(OUT), TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> VertexStep(OUT,[hasWorkLanguage],edge), 
> TraversalFilterStep([AndStep([[EdgeVertexStep(IN), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])], [EdgeVertexStep(OUT), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])]])]), EdgeVertexStep(IN), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([PropertiesStep([wwlanguage_name],property)]), 
> DedupGlobalStep([a, b]), GroupCountStep(value(wwlanguage_name))]
> {code}
> The failing query misses the '@[b]' of the last EdgeVertexStep(IN).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] tinkerpop issue #338: TINKERPOP-1139 Re-assigned step labels as appropriate ...

2016-06-15 Thread dkuppitz
Github user dkuppitz commented on the issue:

https://github.com/apache/tinkerpop/pull/338
  
VOTE: +1


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


gremlin_python GLV

2016-06-15 Thread David Brown
Hello everyone,

I was reading through the gremlin_python GLV code this morning, and
overall it looks like it should work pretty smoothly. Thanks for doing
this Marko, really cool work! I just wanted to comment on a few things
that popped out at me on my first reading.The major issue I see is
that it is not currently Python 2/3 compatible. This is due to two
things:

1. The way iterators are implemented in Python 2/3 is different. This
problem could be remedied by adding a method to
``PythonGraphTraversal``, something like:

def __next__(self):
return self.next()

then, in the ``next`` method, changing line 113 to
``next(self.results)``, should take care of this problem.

2. The ``GroovyTranslator`` class checks for type ``long``, this no
longer exists in Python 3. Determining what to submit as a Long might
require some discussion, but this could be easily fixed by adding
something like:

import sys
if sys.version_info.major > 2:
long = int

to the top of the file.

Other than this, there are some minor details that could be cleaned
up. Particularly:

1. Using ``isinstance`` instead of ``type`` to perform type checking.
This will recognize subclasses and is the most Pythonic way to do
this.

2. Formatting - indents, and line spacing. Typically, Python methods
are separated by a single line, and indents use four spaces. This is
really just cosmetic for readability.

3. CamelCase vs. underscores. I understand that to emulate Gremlin,
the traversal methods etc. should use CamelCase. But I wonder if the
helper classes (Translators) should use the Python convention of using
underscores to name methods. Python class names use camel case by
convention.

Finally, the implementation of the B class may need some work, but
we'll have to play around with it a bit to figure out how the best
approach to doing this.

I'm sure there are more improvements, but I just wanted to get a
conversation going. I would be happy to make a PR with some of these
changes.

Also, gremlinclient will soon support the RemoteConnection interface,
I'll send out a link to the docs once I get everything up and running.

Thanks again to everyone at TInkerpop for all the hard work!

Best,

Dave

-- 
David M. Brown
R.A. CulturePlex Lab, Western University


[jira] [Commented] (TINKERPOP-1139) [Neo4JGraph] GraphTraversal with SubgraphStrategy removes addLabelStep (as("b"))

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15332254#comment-15332254
 ] 

ASF GitHub Bot commented on TINKERPOP-1139:
---

Github user okram commented on the issue:

https://github.com/apache/tinkerpop/pull/338
  
VOTE +1.


> [Neo4JGraph] GraphTraversal with SubgraphStrategy removes addLabelStep 
> (as("b"))
> 
>
> Key: TINKERPOP-1139
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1139
> Project: TinkerPop
>  Issue Type: Bug
>  Components: neo4j
>Affects Versions: 3.1.0-incubating
>Reporter: Martijn Maas
> Fix For: 3.1.3
>
>
> I am using the Neo4jGraph with the following SubgraphStrategy:
> {code}
> SubgraphStrategy.build().vertexCriterion(has("isLatest", true)).create();
> {code}
> I have 2 traversals. This one working works:
> {code}
> Map languageCounts =  
> searchResult.as("a").inE("isCreatedBy").outV().outE("hasWorkLanguage").inV().as("b").dedup("a",
>  "b")
>   .has("wwlanguage_name").groupCount()
> .by("wwlanguage_name").next();
> {code}
> This translates to:
> {code}
> [Neo4jGraphStep([],vertex)@[a], 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> VertexStep(IN,[isCreatedBy],edge), 
> TraversalFilterStep([AndStep([[EdgeVertexStep(IN), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])], [EdgeVertexStep(OUT), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])]])]), 
> EdgeVertexStep(OUT), TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> VertexStep(OUT,[hasWorkLanguage],edge), 
> TraversalFilterStep([AndStep([[EdgeVertexStep(IN), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])], [EdgeVertexStep(OUT), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])]])]), 
> EdgeVertexStep(IN)@[b], TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([PropertiesStep([wwlanguage_name],property)]), 
> DedupGlobalStep([a, b]), GroupCountStep(value(wwlanguage_name))]
> {code}
> This one fails:
> {code}
> Map languageCounts = 
> searchResult.as("a").in("isCreatedBy").out("hasWorkLanguage").as("b")
>.dedup("a", 
> "b").has("wwlanguage_name")
>   .groupCount().by("wwlanguage_name").next();
> {code}
> This translates to:
> {code}
> [Neo4jGraphStep([],vertex)@[a], 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> VertexStep(IN,[isCreatedBy],edge), 
> TraversalFilterStep([AndStep([[EdgeVertexStep(IN), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])], [EdgeVertexStep(OUT), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])]])]), 
> EdgeVertexStep(OUT), TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> VertexStep(OUT,[hasWorkLanguage],edge), 
> TraversalFilterStep([AndStep([[EdgeVertexStep(IN), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])], [EdgeVertexStep(OUT), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])]])]), EdgeVertexStep(IN), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([PropertiesStep([wwlanguage_name],property)]), 
> DedupGlobalStep([a, b]), GroupCountStep(value(wwlanguage_name))]
> {code}
> The failing query misses the '@[b]' of the last EdgeVertexStep(IN).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] tinkerpop issue #338: TINKERPOP-1139 Re-assigned step labels as appropriate ...

2016-06-15 Thread okram
Github user okram commented on the issue:

https://github.com/apache/tinkerpop/pull/338
  
VOTE +1.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Closed] (TINKERPOP-1196) Calls to Result.one() might block indefinitely

2016-06-15 Thread stephen mallette (JIRA)

 [ 
https://issues.apache.org/jira/browse/TINKERPOP-1196?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

stephen mallette closed TINKERPOP-1196.
---
   Resolution: Fixed
Fix Version/s: 3.2.1

This PR was merged a while ago - forgot to close the issue.

> Calls to Result.one() might block indefinitely
> --
>
> Key: TINKERPOP-1196
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1196
> Project: TinkerPop
>  Issue Type: Bug
>  Components: driver
>Affects Versions: 3.1.1-incubating
>Reporter: stephen mallette
>Assignee: stephen mallette
> Fix For: 3.1.3, 3.2.1
>
>
> There are no reproduction steps for this but it does seem to happen from on 
> very rare occasion for some unknown reason.  Need to investigate more.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TINKERPOP-1139) [Neo4JGraph] GraphTraversal with SubgraphStrategy removes addLabelStep (as("b"))

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1139?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15332245#comment-15332245
 ] 

ASF GitHub Bot commented on TINKERPOP-1139:
---

GitHub user spmallette opened a pull request:

https://github.com/apache/tinkerpop/pull/338

TINKERPOP-1139 Re-assigned step labels as appropriate in SubgraphStrategy.

https://issues.apache.org/jira/browse/TINKERPOP-1139

Step labels were not being re-written to replaced steps or to the subgraph 
filter steps and so traversals using .as('a') and the like were failing.

Runs nicely with 'mvn clean install -DincludeNeo4j`

VOTE +1

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/tinkerpop TINKERPOP-1139

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/338.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #338


commit a41971eca60bbafbd2e32309385a3499cd61faad
Author: Stephen Mallette 
Date:   2016-06-15T18:15:53Z

Re-assigned step labels as appropriate in SubgraphStrategy.

Step labels were not being re-written to replaced steps or to the subgraph 
filter steps and so traversals using .as('a') and the like were failing.




> [Neo4JGraph] GraphTraversal with SubgraphStrategy removes addLabelStep 
> (as("b"))
> 
>
> Key: TINKERPOP-1139
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1139
> Project: TinkerPop
>  Issue Type: Bug
>  Components: neo4j
>Affects Versions: 3.1.0-incubating
>Reporter: Martijn Maas
> Fix For: 3.1.3
>
>
> I am using the Neo4jGraph with the following SubgraphStrategy:
> {code}
> SubgraphStrategy.build().vertexCriterion(has("isLatest", true)).create();
> {code}
> I have 2 traversals. This one working works:
> {code}
> Map languageCounts =  
> searchResult.as("a").inE("isCreatedBy").outV().outE("hasWorkLanguage").inV().as("b").dedup("a",
>  "b")
>   .has("wwlanguage_name").groupCount()
> .by("wwlanguage_name").next();
> {code}
> This translates to:
> {code}
> [Neo4jGraphStep([],vertex)@[a], 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> VertexStep(IN,[isCreatedBy],edge), 
> TraversalFilterStep([AndStep([[EdgeVertexStep(IN), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])], [EdgeVertexStep(OUT), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])]])]), 
> EdgeVertexStep(OUT), TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> VertexStep(OUT,[hasWorkLanguage],edge), 
> TraversalFilterStep([AndStep([[EdgeVertexStep(IN), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])], [EdgeVertexStep(OUT), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])]])]), 
> EdgeVertexStep(IN)@[b], TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([PropertiesStep([wwlanguage_name],property)]), 
> DedupGlobalStep([a, b]), GroupCountStep(value(wwlanguage_name))]
> {code}
> This one fails:
> {code}
> Map languageCounts = 
> searchResult.as("a").in("isCreatedBy").out("hasWorkLanguage").as("b")
>.dedup("a", 
> "b").has("wwlanguage_name")
>   .groupCount().by("wwlanguage_name").next();
> {code}
> This translates to:
> {code}
> [Neo4jGraphStep([],vertex)@[a], 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> VertexStep(IN,[isCreatedBy],edge), 
> TraversalFilterStep([AndStep([[EdgeVertexStep(IN), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])], [EdgeVertexStep(OUT), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])]])]), 
> EdgeVertexStep(OUT), TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> VertexStep(OUT,[hasWorkLanguage],edge), 
> TraversalFilterStep([AndStep([[EdgeVertexStep(IN), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])], [EdgeVertexStep(OUT), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])])]])]), EdgeVertexStep(IN), 
> TraversalFilterStep([HasStep([isLatest.eq(true)])]), 
> TraversalFilterStep([PropertiesStep([wwlanguage_name],property)]), 
> DedupGlobalStep([a, b]), GroupCountStep(value(wwlanguage_name))]
> {code}
> The failing query misses the '@[b]' of the last EdgeVertexSt

[GitHub] tinkerpop pull request #338: TINKERPOP-1139 Re-assigned step labels as appro...

2016-06-15 Thread spmallette
GitHub user spmallette opened a pull request:

https://github.com/apache/tinkerpop/pull/338

TINKERPOP-1139 Re-assigned step labels as appropriate in SubgraphStrategy.

https://issues.apache.org/jira/browse/TINKERPOP-1139

Step labels were not being re-written to replaced steps or to the subgraph 
filter steps and so traversals using .as('a') and the like were failing.

Runs nicely with 'mvn clean install -DincludeNeo4j`

VOTE +1

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/tinkerpop TINKERPOP-1139

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/338.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #338


commit a41971eca60bbafbd2e32309385a3499cd61faad
Author: Stephen Mallette 
Date:   2016-06-15T18:15:53Z

Re-assigned step labels as appropriate in SubgraphStrategy.

Step labels were not being re-written to replaced steps or to the subgraph 
filter steps and so traversals using .as('a') and the like were failing.




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


Re: Centrality Recipe

2016-06-15 Thread Kelvin Lawrence
Hi Stephen, I found your write up extremely useful.

As powerful as Gremlin is, a constant piece of feedback I get from people 
not as skilled in it as you are is that it is actually quite hard once you 
get beyond basic queries to (a) get the Gremlin figured out to perform a 
query and (b) come up with optimal Gremlin even if you do get something 
working. So I think guides like these have tremendous value.

One small suggestion, in the Centrality example, you use multiple by() 
steps. I think it would be good to add text that explains what a by() with 
no parameters does. I don't think it is immediately obvious to the reader.

Keep up the good work!

Kelvin

On Monday, June 13, 2016 at 2:37:05 PM UTC-5, Stephen Mallette wrote:
>
> After a few rounds of review and tweaking with Marko and Kuppitz, I've 
> published a new Gremlin Recipe that shows different ways to use Gremlin to 
> calculate centrality:
>
> http://tinkerpop.apache.org/docs/3.2.1-SNAPSHOT/recipes/#centrality
>
> Even if you don't need to calculate centrality in your graph, it might be 
> worth your time reviewing this section as some of the traversals are 
> reasonably advanced and I did the best I could to pick them apart for your 
> learning pleasure. You might note some improved ways of doing things in 
> your own Gremlin-related work if you can take some time to dig into the 
> samples. Enjoy!
>
> Stephen
>


[DISCUSS] S-Type

2016-06-15 Thread Marko Rodriguez
Hello,

I think we should introduce an S object. It would stand for Script and would 
allow you to do:

S.f(“{ it.length }”)

Where does this come in handy? Language variants.

Imagine using gremlin_python that will compile to Gremlin-Groovy for execution 
at GremlinServer.

g.V().out(“knows”)[0:2].name.map(f(“{ it.length }”))

Next, imagine you are in Gremlin-Java and want to submit a traversal to 
GremlinServer, but it has a lambda. No worries, just use the GroovyTranslator 
and you have:

g.V().out(“knows”).limit(2).values(“name”).map(f(“{ it.length }”))

We could also have:

S.s = supplier
S.c = consumer
S.f = function
S.o = operator

This gets to the general problem of being able to translate lambdas between 
different languages as well as being able to send lambdas over the wire.

Thoughts?,
Marko.

http://markorodriguez.com





[GitHub] tinkerpop issue #337: TINKERPOP-1332: Improve .explain() Dialogue

2016-06-15 Thread RussellSpitzer
Github user RussellSpitzer commented on the issue:

https://github.com/apache/tinkerpop/pull/337
  
I still think this is pretty verbose, but I'm happy with the inclusion of 
the 
```graphfilter[[VertexStep(OUT,edge)]]``` so +1 on that


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1332) Improve .explain() Dialogue

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15332039#comment-15332039
 ] 

ASF GitHub Bot commented on TINKERPOP-1332:
---

Github user RussellSpitzer commented on the issue:

https://github.com/apache/tinkerpop/pull/337
  
I still think this is pretty verbose, but I'm happy with the inclusion of 
the 
```graphfilter[[VertexStep(OUT,edge)]]``` so +1 on that


> Improve .explain() Dialogue 
> 
>
> Key: TINKERPOP-1332
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1332
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.0-incubating
>Reporter: Russell Alexander Spitzer
>Assignee: Marko A. Rodriguez
>Priority: Minor
>
> Currently the output of explain gives you a long list of strategies but no 
> details about their application
> {code}
> ==>Traversal Explanation
> 
> Original Traversal [GraphStep(vertex,[]), CountGlobalStep]
> HaltedTraverserStrategy  [D]   [GraphStep(vertex,[]), CountGlobalStep]
> ConnectiveStrategy   [D]   [GraphStep(vertex,[]), CountGlobalStep]
> VertexProgramStrategy[D]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> OrderLimitStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> IdentityRemovalStrategy  [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> FilterRankingStrategy[O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> IncidentToAdjacentStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> RangeByIsCountStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> AdjacentToIncidentStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> MatchPredicateStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> GraphFilterStrategy  [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> PathProcessorStrategy[O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> SparkInterceptorStrategy [P]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> SparkSingleIterationStrategy [P]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> ProfileStrategy  [F]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> LambdaRestrictionStrategy[V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> ComputerVerificationStrategy [V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> StandardVerificationStrategy [V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> Final Traversal
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> {code}
> It would be helpful if filter strategies for example would list the filters 
> used.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TINKERPOP-1298) Save OLAP results to file

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15332007#comment-15332007
 ] 

ASF GitHub Bot commented on TINKERPOP-1298:
---

Github user dkuppitz closed the pull request at:

https://github.com/apache/tinkerpop/pull/323


> Save OLAP results to file
> -
>
> Key: TINKERPOP-1298
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1298
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: io, process
>Reporter: Daniel Kuppitz
>Assignee: Daniel Kuppitz
>
> Provide a way to save (tabular) results to text files, just like Spark's 
> {{saveAsTextFile}}.
> I'm not sure about the best way to do it. 3 options come to my mind:
> # a new step.
> # a {{VertexProgram}}
> # a configuration option
> Things to consider / open questions:
> * Is it sufficient to simply {{toString()}} all values or should we allow 
> formatters / format stings?
> * [~jlewandowski] pointed out that it would be nice to have support for the 
> [parquet file format|https://parquet.apache.org/]. I guess now we're already 
> talking about support for different {{FileOutputFormats}} and not just 
> formatters.
> * Is that only relevant for OLAP?
> * Can we support arbitrary file systems?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] tinkerpop pull request #323: TINKERPOP-1298 Save OLAP results to file

2016-06-15 Thread dkuppitz
Github user dkuppitz closed the pull request at:

https://github.com/apache/tinkerpop/pull/323


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] tinkerpop issue #323: TINKERPOP-1298 Save OLAP results to file

2016-06-15 Thread dkuppitz
Github user dkuppitz commented on the issue:

https://github.com/apache/tinkerpop/pull/323
  
Closing the PR, but I'll keep the branch alive.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1298) Save OLAP results to file

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15332006#comment-15332006
 ] 

ASF GitHub Bot commented on TINKERPOP-1298:
---

Github user dkuppitz commented on the issue:

https://github.com/apache/tinkerpop/pull/323
  
Closing the PR, but I'll keep the branch alive.


> Save OLAP results to file
> -
>
> Key: TINKERPOP-1298
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1298
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: io, process
>Reporter: Daniel Kuppitz
>Assignee: Daniel Kuppitz
>
> Provide a way to save (tabular) results to text files, just like Spark's 
> {{saveAsTextFile}}.
> I'm not sure about the best way to do it. 3 options come to my mind:
> # a new step.
> # a {{VertexProgram}}
> # a configuration option
> Things to consider / open questions:
> * Is it sufficient to simply {{toString()}} all values or should we allow 
> formatters / format stings?
> * [~jlewandowski] pointed out that it would be nice to have support for the 
> [parquet file format|https://parquet.apache.org/]. I guess now we're already 
> talking about support for different {{FileOutputFormats}} and not just 
> formatters.
> * Is that only relevant for OLAP?
> * Can we support arbitrary file systems?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TINKERPOP-1320) GremlinGroovyScriptEngineFileSandboxTest throws error: URI is not hierarchical

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331847#comment-15331847
 ] 

ASF GitHub Bot commented on TINKERPOP-1320:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/336#discussion_r67174102
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java
 ---
@@ -131,7 +131,7 @@ public void writeVertexProperty(final OutputStream 
outputStream, final VertexPro
 public void writeProperty(final OutputStream outputStream, final 
Property p) throws IOException {
 final Output output = new Output(outputStream);
 writeHeader(output);
-kryo.writeObject(output, DetachedFactory.detach(p, true));
--- End diff --

cool - something doesn't make sense in that {{GryoWriter}} - very weird 
looking.


> GremlinGroovyScriptEngineFileSandboxTest throws error: URI is not hierarchical
> --
>
> Key: TINKERPOP-1320
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1320
> Project: TinkerPop
>  Issue Type: Bug
>  Components: test-suite
>Affects Versions: 3.2.0-incubating, 3.1.2-incubating
>Reporter: Jason Plurad
>Assignee: Jason Plurad
>Priority: Minor
> Fix For: 3.1.3, 3.2.1
>
>
> This is similar to TINKERPOP-1317. The differences here are
> * The {{TestHelper.generateTempFileFromResource()}} call to load the resource 
> is happening from the {{public static void init()}} method before a graph 
> instance is available.
> * A reference to {{GremlinGroovyScriptEngineFileSandboxTest.class}} is still 
> required to located the {{sandbox.yaml}} found in the {{gremlin-test.jar}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] tinkerpop pull request #336: TINKERPOP-1320 fix GremlinGroovyScriptEngineFil...

2016-06-15 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/336#discussion_r67174102
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java
 ---
@@ -131,7 +131,7 @@ public void writeVertexProperty(final OutputStream 
outputStream, final VertexPro
 public void writeProperty(final OutputStream outputStream, final 
Property p) throws IOException {
 final Output output = new Output(outputStream);
 writeHeader(output);
-kryo.writeObject(output, DetachedFactory.detach(p, true));
--- End diff --

cool - something doesn't make sense in that {{GryoWriter}} - very weird 
looking.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1319) several FeatureRequirement annotations are incorrect in gremlin-test

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331844#comment-15331844
 ] 

ASF GitHub Bot commented on TINKERPOP-1319:
---

Github user spmallette commented on the issue:

https://github.com/apache/tinkerpop/pull/335
  
VOTE +1 - pending update to upgrade docs


> several FeatureRequirement annotations are incorrect in gremlin-test
> 
>
> Key: TINKERPOP-1319
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1319
> Project: TinkerPop
>  Issue Type: Bug
>  Components: test-suite
>Affects Versions: 3.2.0-incubating, 3.1.2-incubating
>Reporter: Jason Plurad
>Assignee: Jason Plurad
>Priority: Minor
> Fix For: 3.1.3, 3.2.1
>
>
> Several {{@FeatureRequirement}} annotations are incorrect in these 
> {{gremlin-test}} tests
> * EdgeTest.java
> * FeatureSupportTest.java
> * GraphTest.java
> * PropertyTest.java
> * VertexPropertyTest.java
> * VertexTest.java
> I'll submit a patch for this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] tinkerpop issue #335: TINKERPOP-1319: fix incorrect FeatureRequirement annot...

2016-06-15 Thread spmallette
Github user spmallette commented on the issue:

https://github.com/apache/tinkerpop/pull/335
  
VOTE +1 - pending update to upgrade docs


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1332) Improve .explain() Dialogue

2016-06-15 Thread stephen mallette (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331811#comment-15331811
 ] 

stephen mallette commented on TINKERPOP-1332:
-

I sort of agree with [~rjbriody] about pushing formatting into the output. 
Maybe we should do a {{prettyPrint()}} method on {{TraversalExplanation}} that 
does some formatting or something and leave {{toString()}} alone. In the 
console we could probably detect a {{TraversalExplanation}} being eval'd out in 
the console and then call the {{prettyPrint()}} (i think). Perhaps that would 
solve the problem?

> Improve .explain() Dialogue 
> 
>
> Key: TINKERPOP-1332
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1332
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.0-incubating
>Reporter: Russell Alexander Spitzer
>Assignee: Marko A. Rodriguez
>Priority: Minor
>
> Currently the output of explain gives you a long list of strategies but no 
> details about their application
> {code}
> ==>Traversal Explanation
> 
> Original Traversal [GraphStep(vertex,[]), CountGlobalStep]
> HaltedTraverserStrategy  [D]   [GraphStep(vertex,[]), CountGlobalStep]
> ConnectiveStrategy   [D]   [GraphStep(vertex,[]), CountGlobalStep]
> VertexProgramStrategy[D]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> OrderLimitStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> IdentityRemovalStrategy  [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> FilterRankingStrategy[O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> IncidentToAdjacentStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> RangeByIsCountStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> AdjacentToIncidentStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> MatchPredicateStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> GraphFilterStrategy  [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> PathProcessorStrategy[O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> SparkInterceptorStrategy [P]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> SparkSingleIterationStrategy [P]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> ProfileStrategy  [F]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> LambdaRestrictionStrategy[V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> ComputerVerificationStrategy [V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> StandardVerificationStrategy [V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> Final Traversal
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> {code}
> It would be helpful if filter strategies for example would list the filters 
> used.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TINKERPOP-1332) Improve .explain() Dialogue

2016-06-15 Thread Bob Briody (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331802#comment-15331802
 ] 

Bob Briody commented on TINKERPOP-1332:
---

I don't like the idea of introducing word wrap here. That seems like something 
that should be left up to the view presenter (the terminal, another app, 
whatever). I realize that it's common to view this output in the terminal but 
1) this isn't something you can easily reverse when you don't want it and 2) It 
will only look good for the hard coded terminal size. If you do decide to keep 
it though, then width should be 80 characters. That's the standard default 
terminal character width. 

> It would be nice if this was set to the console window size in some way... :/ 
> ... any thoughts on how to make this more dynamic?

No, but again, we should be thinking about more than just terminal output.


> Improve .explain() Dialogue 
> 
>
> Key: TINKERPOP-1332
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1332
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.0-incubating
>Reporter: Russell Alexander Spitzer
>Assignee: Marko A. Rodriguez
>Priority: Minor
>
> Currently the output of explain gives you a long list of strategies but no 
> details about their application
> {code}
> ==>Traversal Explanation
> 
> Original Traversal [GraphStep(vertex,[]), CountGlobalStep]
> HaltedTraverserStrategy  [D]   [GraphStep(vertex,[]), CountGlobalStep]
> ConnectiveStrategy   [D]   [GraphStep(vertex,[]), CountGlobalStep]
> VertexProgramStrategy[D]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> OrderLimitStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> IdentityRemovalStrategy  [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> FilterRankingStrategy[O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> IncidentToAdjacentStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> RangeByIsCountStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> AdjacentToIncidentStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> MatchPredicateStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> GraphFilterStrategy  [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> PathProcessorStrategy[O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> SparkInterceptorStrategy [P]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> SparkSingleIterationStrategy [P]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> ProfileStrategy  [F]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> LambdaRestrictionStrategy[V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> ComputerVerificationStrategy [V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> StandardVerificationStrategy [V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> Final Traversal
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> {code}
> It would be helpful if filter strategies for example would list the filters 
> used.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] tinkerpop issue #315: Remove dashes from labels and property keys

2016-06-15 Thread spmallette
Github user spmallette commented on the issue:

https://github.com/apache/tinkerpop/pull/315
  
@analytically did you happen to see my previous comment about 
rebasing/fixing conflicts on this PR so that we can begin code review/testing 
on our end? is that something you have some time to come back to soon?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] tinkerpop pull request #335: TINKERPOP-1319: fix incorrect FeatureRequiremen...

2016-06-15 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/335#discussion_r67163346
  
--- Diff: 
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
 ---
@@ -587,7 +587,7 @@ public void 
shouldSupportRemoveEdgesIfEdgeCanBeRemoved() throws Exception {
 public void shouldSupportRemovePropertyIfAPropertyCanBeRemoved() 
throws Exception {
 try {
 final Vertex v = graph.addVertex();
-final Edge e = v.addEdge("self", v);
+final Edge e = v.addEdge("self", v, "name", "foo");
--- End diff --

In all your thinking on this PR, did you ever think of any way to "test our 
tests" for proper feature assignments? perhaps that's a bit advanced and 
impossible a thing to do, but anything else we could do to make this process of 
adding features less error prone? or do we just need to rely on good code 
reviews of tests to be sure features go in the right way?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1319) several FeatureRequirement annotations are incorrect in gremlin-test

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331772#comment-15331772
 ] 

ASF GitHub Bot commented on TINKERPOP-1319:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/335#discussion_r67163346
  
--- Diff: 
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
 ---
@@ -587,7 +587,7 @@ public void 
shouldSupportRemoveEdgesIfEdgeCanBeRemoved() throws Exception {
 public void shouldSupportRemovePropertyIfAPropertyCanBeRemoved() 
throws Exception {
 try {
 final Vertex v = graph.addVertex();
-final Edge e = v.addEdge("self", v);
+final Edge e = v.addEdge("self", v, "name", "foo");
--- End diff --

In all your thinking on this PR, did you ever think of any way to "test our 
tests" for proper feature assignments? perhaps that's a bit advanced and 
impossible a thing to do, but anything else we could do to make this process of 
adding features less error prone? or do we just need to rely on good code 
reviews of tests to be sure features go in the right way?


> several FeatureRequirement annotations are incorrect in gremlin-test
> 
>
> Key: TINKERPOP-1319
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1319
> Project: TinkerPop
>  Issue Type: Bug
>  Components: test-suite
>Affects Versions: 3.2.0-incubating, 3.1.2-incubating
>Reporter: Jason Plurad
>Assignee: Jason Plurad
>Priority: Minor
> Fix For: 3.1.3, 3.2.1
>
>
> Several {{@FeatureRequirement}} annotations are incorrect in these 
> {{gremlin-test}} tests
> * EdgeTest.java
> * FeatureSupportTest.java
> * GraphTest.java
> * PropertyTest.java
> * VertexPropertyTest.java
> * VertexTest.java
> I'll submit a patch for this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] tinkerpop issue #323: TINKERPOP-1298 Save OLAP results to file

2016-06-15 Thread okram
Github user okram commented on the issue:

https://github.com/apache/tinkerpop/pull/323
  
Given that this PR mixes constructs from different packages without 
generalizing the constructs -- e.g. InputFormat as a general "Writer" for 
Hadoop, TinkerGraph, etc. -- I think this ticket should be closed until such 
generalized interfaces are created. If you agree @dkuppitz, please close.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1298) Save OLAP results to file

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331752#comment-15331752
 ] 

ASF GitHub Bot commented on TINKERPOP-1298:
---

Github user okram commented on the issue:

https://github.com/apache/tinkerpop/pull/323
  
Given that this PR mixes constructs from different packages without 
generalizing the constructs -- e.g. InputFormat as a general "Writer" for 
Hadoop, TinkerGraph, etc. -- I think this ticket should be closed until such 
generalized interfaces are created. If you agree @dkuppitz, please close.


> Save OLAP results to file
> -
>
> Key: TINKERPOP-1298
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1298
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: io, process
>Reporter: Daniel Kuppitz
>Assignee: Daniel Kuppitz
>
> Provide a way to save (tabular) results to text files, just like Spark's 
> {{saveAsTextFile}}.
> I'm not sure about the best way to do it. 3 options come to my mind:
> # a new step.
> # a {{VertexProgram}}
> # a configuration option
> Things to consider / open questions:
> * Is it sufficient to simply {{toString()}} all values or should we allow 
> formatters / format stings?
> * [~jlewandowski] pointed out that it would be nice to have support for the 
> [parquet file format|https://parquet.apache.org/]. I guess now we're already 
> talking about support for different {{FileOutputFormats}} and not just 
> formatters.
> * Is that only relevant for OLAP?
> * Can we support arbitrary file systems?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TINKERPOP-1319) several FeatureRequirement annotations are incorrect in gremlin-test

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331746#comment-15331746
 ] 

ASF GitHub Bot commented on TINKERPOP-1319:
---

Github user pluradj commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/335#discussion_r67160705
  
--- Diff: 
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
 ---
@@ -587,7 +587,7 @@ public void 
shouldSupportRemoveEdgesIfEdgeCanBeRemoved() throws Exception {
 public void shouldSupportRemovePropertyIfAPropertyCanBeRemoved() 
throws Exception {
 try {
 final Vertex v = graph.addVertex();
-final Edge e = v.addEdge("self", v);
+final Edge e = v.addEdge("self", v, "name", "foo");
--- End diff --

Agreed. I started with all features set to `false` then started turning 
things on one at a time and in different combinations.


> several FeatureRequirement annotations are incorrect in gremlin-test
> 
>
> Key: TINKERPOP-1319
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1319
> Project: TinkerPop
>  Issue Type: Bug
>  Components: test-suite
>Affects Versions: 3.2.0-incubating, 3.1.2-incubating
>Reporter: Jason Plurad
>Assignee: Jason Plurad
>Priority: Minor
> Fix For: 3.1.3, 3.2.1
>
>
> Several {{@FeatureRequirement}} annotations are incorrect in these 
> {{gremlin-test}} tests
> * EdgeTest.java
> * FeatureSupportTest.java
> * GraphTest.java
> * PropertyTest.java
> * VertexPropertyTest.java
> * VertexTest.java
> I'll submit a patch for this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TINKERPOP-1332) Improve .explain() Dialogue

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331744#comment-15331744
 ] 

ASF GitHub Bot commented on TINKERPOP-1332:
---

GitHub user okram opened a pull request:

https://github.com/apache/tinkerpop/pull/337

TINKERPOP-1332: Improve .explain() Dialogue

https://issues.apache.org/jira/browse/TINKERPOP-1332

`TraversalExplanation.toString()` now supports word wrapping and 
`GraphFilter` information.

*First, here is word wrap in action*:

```
gremlin> g.V().out().out().out().out().count().explain()
==>Traversal Explanation

===
Original Traversal [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,vertex), 
CountGlobalStep]

ConnectiveStrategy   [D]   [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,vertex), 
CountGlobalStep]
RangeByIsCountStrategy   [O]   [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,vertex), 
CountGlobalStep]
IdentityRemovalStrategy  [O]   [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,vertex), 
CountGlobalStep]
IncidentToAdjacentStrategy   [O]   [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,vertex), 
CountGlobalStep]
AdjacentToIncidentStrategy   [O]   [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,edge), CountGlobalStep]
FilterRankingStrategy[O]   [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,edge), CountGlobalStep]
MatchPredicateStrategy   [O]   [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,edge), CountGlobalStep]
TinkerGraphStepStrategy  [P]   [TinkerGraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,edge), CountGlobalStep]
ProfileStrategy  [F]   [TinkerGraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,edge), CountGlobalStep]
StandardVerificationStrategy [V]   [TinkerGraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,edge), CountGlobalStep]

Final Traversal[TinkerGraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,edge), CountGlobalStep]
gremlin>
```

*Second, here is GraphFilter information in action.*

```
gremlin> g = TinkerFactory.createModern().traversal().withComputer()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], graphcomputer]
gremlin> g = g.withStrategies(GraphFilterStrategy.instance())
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], graphcomputer]
gremlin> g.V().out().out().out().out().count().explain()
==>Traversal Explanation

==
Original Traversal [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,vertex), 
CountGlobalStep]

VertexProgramStrategy[D]   
[TraversalVertexProgramStep([GraphStep(vertex,[]), VertexStep(OUT,vertex), 
VertexStep(OUT,vertex),
  VertexStep(OUT,vertex), 
VertexStep(OUT,vertex), CountGlobalStep],graphfilter[none]),
  ComputerResultStep]
ConnectiveStrategy   [D]   
[TraversalVertexProgramStep([GraphStep(vertex,[]), VertexStep(OUT,vertex), 
VertexStep(OUT,vertex),
  VertexStep(OUT,vertex), 
VertexStep(OUT,vertex), CountGlobalStep],graphfilter[none]),
  ComputerResult

[GitHub] tinkerpop pull request #335: TINKERPOP-1319: fix incorrect FeatureRequiremen...

2016-06-15 Thread pluradj
Github user pluradj commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/335#discussion_r67160705
  
--- Diff: 
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
 ---
@@ -587,7 +587,7 @@ public void 
shouldSupportRemoveEdgesIfEdgeCanBeRemoved() throws Exception {
 public void shouldSupportRemovePropertyIfAPropertyCanBeRemoved() 
throws Exception {
 try {
 final Vertex v = graph.addVertex();
-final Edge e = v.addEdge("self", v);
+final Edge e = v.addEdge("self", v, "name", "foo");
--- End diff --

Agreed. I started with all features set to `false` then started turning 
things on one at a time and in different combinations.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1319) several FeatureRequirement annotations are incorrect in gremlin-test

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331743#comment-15331743
 ] 

ASF GitHub Bot commented on TINKERPOP-1319:
---

Github user pluradj commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/335#discussion_r67160532
  
--- Diff: 
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
 ---
@@ -280,10 +280,9 @@ public void 
shouldHaveExceptionConsistencyWhenIdNotSupportedForAddEdge() throws
 }
 
 @Test
-@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-@FeatureRequirement(featureClass = VertexPropertyFeatures.class, 
feature = FEATURE_INTEGER_VALUES)
+@FeatureRequirement(featureClass = 
Graph.Features.VertexFeatures.class, feature = 
Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
 public void shouldHaveStandardStringRepresentation() {
-final Vertex v = graph.addVertex("name", "marko", "age", 34);
+final Vertex v = graph.addVertex();
--- End diff --

Yeah, I thought about just adding the `FEATURE_INTEGER_VALUES` annotation, 
but it seemed to me like the test didn't have anything to do with properties. I 
can add another test to test with `toString()` with properties.


> several FeatureRequirement annotations are incorrect in gremlin-test
> 
>
> Key: TINKERPOP-1319
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1319
> Project: TinkerPop
>  Issue Type: Bug
>  Components: test-suite
>Affects Versions: 3.2.0-incubating, 3.1.2-incubating
>Reporter: Jason Plurad
>Assignee: Jason Plurad
>Priority: Minor
> Fix For: 3.1.3, 3.2.1
>
>
> Several {{@FeatureRequirement}} annotations are incorrect in these 
> {{gremlin-test}} tests
> * EdgeTest.java
> * FeatureSupportTest.java
> * GraphTest.java
> * PropertyTest.java
> * VertexPropertyTest.java
> * VertexTest.java
> I'll submit a patch for this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] tinkerpop pull request #335: TINKERPOP-1319: fix incorrect FeatureRequiremen...

2016-06-15 Thread pluradj
Github user pluradj commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/335#discussion_r67160532
  
--- Diff: 
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
 ---
@@ -280,10 +280,9 @@ public void 
shouldHaveExceptionConsistencyWhenIdNotSupportedForAddEdge() throws
 }
 
 @Test
-@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-@FeatureRequirement(featureClass = VertexPropertyFeatures.class, 
feature = FEATURE_INTEGER_VALUES)
+@FeatureRequirement(featureClass = 
Graph.Features.VertexFeatures.class, feature = 
Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
 public void shouldHaveStandardStringRepresentation() {
-final Vertex v = graph.addVertex("name", "marko", "age", 34);
+final Vertex v = graph.addVertex();
--- End diff --

Yeah, I thought about just adding the `FEATURE_INTEGER_VALUES` annotation, 
but it seemed to me like the test didn't have anything to do with properties. I 
can add another test to test with `toString()` with properties.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] tinkerpop pull request #337: TINKERPOP-1332: Improve .explain() Dialogue

2016-06-15 Thread okram
GitHub user okram opened a pull request:

https://github.com/apache/tinkerpop/pull/337

TINKERPOP-1332: Improve .explain() Dialogue

https://issues.apache.org/jira/browse/TINKERPOP-1332

`TraversalExplanation.toString()` now supports word wrapping and 
`GraphFilter` information.

*First, here is word wrap in action*:

```
gremlin> g.V().out().out().out().out().count().explain()
==>Traversal Explanation

===
Original Traversal [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,vertex), 
CountGlobalStep]

ConnectiveStrategy   [D]   [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,vertex), 
CountGlobalStep]
RangeByIsCountStrategy   [O]   [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,vertex), 
CountGlobalStep]
IdentityRemovalStrategy  [O]   [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,vertex), 
CountGlobalStep]
IncidentToAdjacentStrategy   [O]   [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,vertex), 
CountGlobalStep]
AdjacentToIncidentStrategy   [O]   [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,edge), CountGlobalStep]
FilterRankingStrategy[O]   [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,edge), CountGlobalStep]
MatchPredicateStrategy   [O]   [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,edge), CountGlobalStep]
TinkerGraphStepStrategy  [P]   [TinkerGraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,edge), CountGlobalStep]
ProfileStrategy  [F]   [TinkerGraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,edge), CountGlobalStep]
StandardVerificationStrategy [V]   [TinkerGraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,edge), CountGlobalStep]

Final Traversal[TinkerGraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,edge), CountGlobalStep]
gremlin>
```

*Second, here is GraphFilter information in action.*

```
gremlin> g = TinkerFactory.createModern().traversal().withComputer()
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], graphcomputer]
gremlin> g = g.withStrategies(GraphFilterStrategy.instance())
==>graphtraversalsource[tinkergraph[vertices:6 edges:6], graphcomputer]
gremlin> g.V().out().out().out().out().count().explain()
==>Traversal Explanation

==
Original Traversal [GraphStep(vertex,[]), 
VertexStep(OUT,vertex), VertexStep(OUT,vertex), VertexStep(OUT,vertex),
  VertexStep(OUT,vertex), 
CountGlobalStep]

VertexProgramStrategy[D]   
[TraversalVertexProgramStep([GraphStep(vertex,[]), VertexStep(OUT,vertex), 
VertexStep(OUT,vertex),
  VertexStep(OUT,vertex), 
VertexStep(OUT,vertex), CountGlobalStep],graphfilter[none]),
  ComputerResultStep]
ConnectiveStrategy   [D]   
[TraversalVertexProgramStep([GraphStep(vertex,[]), VertexStep(OUT,vertex), 
VertexStep(OUT,vertex),
  VertexStep(OUT,vertex), 
VertexStep(OUT,vertex), CountGlobalStep],graphfilter[none]),
  ComputerResultStep]
RangeByIsCountStrategy   [O]   
[TraversalVertexProgramStep([GraphStep(vertex,[]), VertexStep(OUT,vertex), 
VertexStep(OUT,vertex),
  VertexStep(OUT,vertex), 
VertexStep(OUT,vertex), CountGlobalStep],graphfilter[no

[jira] [Commented] (TINKERPOP-1319) several FeatureRequirement annotations are incorrect in gremlin-test

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331737#comment-15331737
 ] 

ASF GitHub Bot commented on TINKERPOP-1319:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/335#discussion_r67159933
  
--- Diff: 
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
 ---
@@ -587,7 +587,7 @@ public void 
shouldSupportRemoveEdgesIfEdgeCanBeRemoved() throws Exception {
 public void shouldSupportRemovePropertyIfAPropertyCanBeRemoved() 
throws Exception {
 try {
 final Vertex v = graph.addVertex();
-final Edge e = v.addEdge("self", v);
+final Edge e = v.addEdge("self", v, "name", "foo");
--- End diff --

good bug fix - i guess we haven't run afoul of that because most graphs 
will support property removal on edge.


> several FeatureRequirement annotations are incorrect in gremlin-test
> 
>
> Key: TINKERPOP-1319
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1319
> Project: TinkerPop
>  Issue Type: Bug
>  Components: test-suite
>Affects Versions: 3.2.0-incubating, 3.1.2-incubating
>Reporter: Jason Plurad
>Assignee: Jason Plurad
>Priority: Minor
> Fix For: 3.1.3, 3.2.1
>
>
> Several {{@FeatureRequirement}} annotations are incorrect in these 
> {{gremlin-test}} tests
> * EdgeTest.java
> * FeatureSupportTest.java
> * GraphTest.java
> * PropertyTest.java
> * VertexPropertyTest.java
> * VertexTest.java
> I'll submit a patch for this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] tinkerpop pull request #335: TINKERPOP-1319: fix incorrect FeatureRequiremen...

2016-06-15 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/335#discussion_r67159933
  
--- Diff: 
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/FeatureSupportTest.java
 ---
@@ -587,7 +587,7 @@ public void 
shouldSupportRemoveEdgesIfEdgeCanBeRemoved() throws Exception {
 public void shouldSupportRemovePropertyIfAPropertyCanBeRemoved() 
throws Exception {
 try {
 final Vertex v = graph.addVertex();
-final Edge e = v.addEdge("self", v);
+final Edge e = v.addEdge("self", v, "name", "foo");
--- End diff --

good bug fix - i guess we haven't run afoul of that because most graphs 
will support property removal on edge.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1319) several FeatureRequirement annotations are incorrect in gremlin-test

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331730#comment-15331730
 ] 

ASF GitHub Bot commented on TINKERPOP-1319:
---

Github user spmallette commented on the issue:

https://github.com/apache/tinkerpop/pull/335
  
I would recommend adding something to the upgrade docs for graph providers, 
as this change will possibly open up some tests for folks and maybe introduce 
some breaks.


> several FeatureRequirement annotations are incorrect in gremlin-test
> 
>
> Key: TINKERPOP-1319
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1319
> Project: TinkerPop
>  Issue Type: Bug
>  Components: test-suite
>Affects Versions: 3.2.0-incubating, 3.1.2-incubating
>Reporter: Jason Plurad
>Assignee: Jason Plurad
>Priority: Minor
> Fix For: 3.1.3, 3.2.1
>
>
> Several {{@FeatureRequirement}} annotations are incorrect in these 
> {{gremlin-test}} tests
> * EdgeTest.java
> * FeatureSupportTest.java
> * GraphTest.java
> * PropertyTest.java
> * VertexPropertyTest.java
> * VertexTest.java
> I'll submit a patch for this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] tinkerpop issue #335: TINKERPOP-1319: fix incorrect FeatureRequirement annot...

2016-06-15 Thread spmallette
Github user spmallette commented on the issue:

https://github.com/apache/tinkerpop/pull/335
  
I would recommend adding something to the upgrade docs for graph providers, 
as this change will possibly open up some tests for folks and maybe introduce 
some breaks.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1319) several FeatureRequirement annotations are incorrect in gremlin-test

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331719#comment-15331719
 ] 

ASF GitHub Bot commented on TINKERPOP-1319:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/335#discussion_r67158389
  
--- Diff: 
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
 ---
@@ -280,10 +280,9 @@ public void 
shouldHaveExceptionConsistencyWhenIdNotSupportedForAddEdge() throws
 }
 
 @Test
-@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-@FeatureRequirement(featureClass = VertexPropertyFeatures.class, 
feature = FEATURE_INTEGER_VALUES)
+@FeatureRequirement(featureClass = 
Graph.Features.VertexFeatures.class, feature = 
Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
 public void shouldHaveStandardStringRepresentation() {
-final Vertex v = graph.addVertex("name", "marko", "age", 34);
+final Vertex v = graph.addVertex();
--- End diff --

This might be changing the semantics of the test a little. We want to 
validate that a vertex looks a certain way with `toString()`. By adding 
properties, it introduces some data to the vertex object and allows the test to 
validate that none of that state shows up in the `toString()`.  Maybe an 
off-chance of that happening I suppose. I guess the benefit is that we widen 
the test footprint for providers who don't support adding properties (but 
that's a really super basic thing). is there some other benefit? wdyt?


> several FeatureRequirement annotations are incorrect in gremlin-test
> 
>
> Key: TINKERPOP-1319
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1319
> Project: TinkerPop
>  Issue Type: Bug
>  Components: test-suite
>Affects Versions: 3.2.0-incubating, 3.1.2-incubating
>Reporter: Jason Plurad
>Assignee: Jason Plurad
>Priority: Minor
> Fix For: 3.1.3, 3.2.1
>
>
> Several {{@FeatureRequirement}} annotations are incorrect in these 
> {{gremlin-test}} tests
> * EdgeTest.java
> * FeatureSupportTest.java
> * GraphTest.java
> * PropertyTest.java
> * VertexPropertyTest.java
> * VertexTest.java
> I'll submit a patch for this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] tinkerpop pull request #335: TINKERPOP-1319: fix incorrect FeatureRequiremen...

2016-06-15 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/335#discussion_r67158389
  
--- Diff: 
gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/structure/VertexTest.java
 ---
@@ -280,10 +280,9 @@ public void 
shouldHaveExceptionConsistencyWhenIdNotSupportedForAddEdge() throws
 }
 
 @Test
-@FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
-@FeatureRequirement(featureClass = VertexPropertyFeatures.class, 
feature = FEATURE_INTEGER_VALUES)
+@FeatureRequirement(featureClass = 
Graph.Features.VertexFeatures.class, feature = 
Graph.Features.VertexFeatures.FEATURE_ADD_VERTICES)
 public void shouldHaveStandardStringRepresentation() {
-final Vertex v = graph.addVertex("name", "marko", "age", 34);
+final Vertex v = graph.addVertex();
--- End diff --

This might be changing the semantics of the test a little. We want to 
validate that a vertex looks a certain way with `toString()`. By adding 
properties, it introduces some data to the vertex object and allows the test to 
validate that none of that state shows up in the `toString()`.  Maybe an 
off-chance of that happening I suppose. I guess the benefit is that we widen 
the test footprint for providers who don't support adding properties (but 
that's a really super basic thing). is there some other benefit? wdyt?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1320) GremlinGroovyScriptEngineFileSandboxTest throws error: URI is not hierarchical

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331714#comment-15331714
 ] 

ASF GitHub Bot commented on TINKERPOP-1320:
---

Github user pluradj commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/336#discussion_r67157872
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java
 ---
@@ -131,7 +131,7 @@ public void writeVertexProperty(final OutputStream 
outputStream, final VertexPro
 public void writeProperty(final OutputStream outputStream, final 
Property p) throws IOException {
 final Output output = new Output(outputStream);
 writeHeader(output);
-kryo.writeObject(output, DetachedFactory.detach(p, true));
--- End diff --

Let me pull out this one change and open up a separate issue for it. I'll 
expand more in the issue on this one.


> GremlinGroovyScriptEngineFileSandboxTest throws error: URI is not hierarchical
> --
>
> Key: TINKERPOP-1320
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1320
> Project: TinkerPop
>  Issue Type: Bug
>  Components: test-suite
>Affects Versions: 3.2.0-incubating, 3.1.2-incubating
>Reporter: Jason Plurad
>Assignee: Jason Plurad
>Priority: Minor
> Fix For: 3.1.3, 3.2.1
>
>
> This is similar to TINKERPOP-1317. The differences here are
> * The {{TestHelper.generateTempFileFromResource()}} call to load the resource 
> is happening from the {{public static void init()}} method before a graph 
> instance is available.
> * A reference to {{GremlinGroovyScriptEngineFileSandboxTest.class}} is still 
> required to located the {{sandbox.yaml}} found in the {{gremlin-test.jar}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] tinkerpop pull request #336: TINKERPOP-1320 fix GremlinGroovyScriptEngineFil...

2016-06-15 Thread pluradj
Github user pluradj commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/336#discussion_r67157872
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java
 ---
@@ -131,7 +131,7 @@ public void writeVertexProperty(final OutputStream 
outputStream, final VertexPro
 public void writeProperty(final OutputStream outputStream, final 
Property p) throws IOException {
 final Output output = new Output(outputStream);
 writeHeader(output);
-kryo.writeObject(output, DetachedFactory.detach(p, true));
--- End diff --

Let me pull out this one change and open up a separate issue for it. I'll 
expand more in the issue on this one.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] tinkerpop pull request #336: TINKERPOP-1320 fix GremlinGroovyScriptEngineFil...

2016-06-15 Thread spmallette
Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/336#discussion_r67157460
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java
 ---
@@ -131,7 +131,7 @@ public void writeVertexProperty(final OutputStream 
outputStream, final VertexPro
 public void writeProperty(final OutputStream outputStream, final 
Property p) throws IOException {
 final Output output = new Output(outputStream);
 writeHeader(output);
-kryo.writeObject(output, DetachedFactory.detach(p, true));
--- End diff --

that's weird as a standalone issue - @pluradj  what did this change have to 
do with TINKERPOP-1320 ?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1320) GremlinGroovyScriptEngineFileSandboxTest throws error: URI is not hierarchical

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331706#comment-15331706
 ] 

ASF GitHub Bot commented on TINKERPOP-1320:
---

Github user spmallette commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/336#discussion_r67157460
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java
 ---
@@ -131,7 +131,7 @@ public void writeVertexProperty(final OutputStream 
outputStream, final VertexPro
 public void writeProperty(final OutputStream outputStream, final 
Property p) throws IOException {
 final Output output = new Output(outputStream);
 writeHeader(output);
-kryo.writeObject(output, DetachedFactory.detach(p, true));
--- End diff --

that's weird as a standalone issue - @pluradj  what did this change have to 
do with TINKERPOP-1320 ?


> GremlinGroovyScriptEngineFileSandboxTest throws error: URI is not hierarchical
> --
>
> Key: TINKERPOP-1320
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1320
> Project: TinkerPop
>  Issue Type: Bug
>  Components: test-suite
>Affects Versions: 3.2.0-incubating, 3.1.2-incubating
>Reporter: Jason Plurad
>Assignee: Jason Plurad
>Priority: Minor
> Fix For: 3.1.3, 3.2.1
>
>
> This is similar to TINKERPOP-1317. The differences here are
> * The {{TestHelper.generateTempFileFromResource()}} call to load the resource 
> is happening from the {{public static void init()}} method before a graph 
> instance is available.
> * A reference to {{GremlinGroovyScriptEngineFileSandboxTest.class}} is still 
> required to located the {{sandbox.yaml}} found in the {{gremlin-test.jar}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TINKERPOP-1320) GremlinGroovyScriptEngineFileSandboxTest throws error: URI is not hierarchical

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331676#comment-15331676
 ] 

ASF GitHub Bot commented on TINKERPOP-1320:
---

Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/336#discussion_r67155745
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java
 ---
@@ -131,7 +131,7 @@ public void writeVertexProperty(final OutputStream 
outputStream, final VertexPro
 public void writeProperty(final OutputStream outputStream, final 
Property p) throws IOException {
 final Output output = new Output(outputStream);
 writeHeader(output);
-kryo.writeObject(output, DetachedFactory.detach(p, true));
--- End diff --

Is there any way that this may lead to a serialization format that is not 
backwards compatible?


> GremlinGroovyScriptEngineFileSandboxTest throws error: URI is not hierarchical
> --
>
> Key: TINKERPOP-1320
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1320
> Project: TinkerPop
>  Issue Type: Bug
>  Components: test-suite
>Affects Versions: 3.2.0-incubating, 3.1.2-incubating
>Reporter: Jason Plurad
>Assignee: Jason Plurad
>Priority: Minor
> Fix For: 3.1.3, 3.2.1
>
>
> This is similar to TINKERPOP-1317. The differences here are
> * The {{TestHelper.generateTempFileFromResource()}} call to load the resource 
> is happening from the {{public static void init()}} method before a graph 
> instance is available.
> * A reference to {{GremlinGroovyScriptEngineFileSandboxTest.class}} is still 
> required to located the {{sandbox.yaml}} found in the {{gremlin-test.jar}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] tinkerpop pull request #336: TINKERPOP-1320 fix GremlinGroovyScriptEngineFil...

2016-06-15 Thread okram
Github user okram commented on a diff in the pull request:

https://github.com/apache/tinkerpop/pull/336#discussion_r67155745
  
--- Diff: 
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoWriter.java
 ---
@@ -131,7 +131,7 @@ public void writeVertexProperty(final OutputStream 
outputStream, final VertexPro
 public void writeProperty(final OutputStream outputStream, final 
Property p) throws IOException {
 final Output output = new Output(outputStream);
 writeHeader(output);
-kryo.writeObject(output, DetachedFactory.detach(p, true));
--- End diff --

Is there any way that this may lead to a serialization format that is not 
backwards compatible?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Commented] (TINKERPOP-1320) GremlinGroovyScriptEngineFileSandboxTest throws error: URI is not hierarchical

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1320?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331673#comment-15331673
 ] 

ASF GitHub Bot commented on TINKERPOP-1320:
---

GitHub user pluradj opened a pull request:

https://github.com/apache/tinkerpop/pull/336

TINKERPOP-1320 fix GremlinGroovyScriptEngineFileSandboxTest resource loading

https://issues.apache.org/jira/browse/TINKERPOP-1320
Passed `mvn clean install -DincludeNeo4j` and integration tests cleanly.
May be CTR worthy. Let me know.
VOTE: +1


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/tinkerpop TINKERPOP-1320

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/336.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #336


commit 11491010f151d32ce80d7b9fdb88f17f57181fd8
Author: Jason Plurad 
Date:   2016-06-15T12:49:17Z

fix GremlinGroovyScriptEngineFileSandboxTest resource loading




> GremlinGroovyScriptEngineFileSandboxTest throws error: URI is not hierarchical
> --
>
> Key: TINKERPOP-1320
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1320
> Project: TinkerPop
>  Issue Type: Bug
>  Components: test-suite
>Affects Versions: 3.2.0-incubating, 3.1.2-incubating
>Reporter: Jason Plurad
>Assignee: Jason Plurad
>Priority: Minor
> Fix For: 3.1.3, 3.2.1
>
>
> This is similar to TINKERPOP-1317. The differences here are
> * The {{TestHelper.generateTempFileFromResource()}} call to load the resource 
> is happening from the {{public static void init()}} method before a graph 
> instance is available.
> * A reference to {{GremlinGroovyScriptEngineFileSandboxTest.class}} is still 
> required to located the {{sandbox.yaml}} found in the {{gremlin-test.jar}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TINKERPOP-1319) several FeatureRequirement annotations are incorrect in gremlin-test

2016-06-15 Thread ASF GitHub Bot (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1319?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331669#comment-15331669
 ] 

ASF GitHub Bot commented on TINKERPOP-1319:
---

GitHub user pluradj opened a pull request:

https://github.com/apache/tinkerpop/pull/335

TINKERPOP-1319: fix incorrect FeatureRequirement annotations

https://issues.apache.org/jira/browse/TINKERPOP-1319
Passed `mvn clean install -DincludeNeo4j` and integration tests cleanly.
May be CTR worthy. Let me know.
VOTE: +1


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/tinkerpop TINKERPOP-1319

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/335.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #335


commit 6fe943ff67cea8383afc6f046c175d89092601da
Author: Jason Plurad 
Date:   2016-06-15T12:51:43Z

fix incorrect FeatureRequirement annotations




> several FeatureRequirement annotations are incorrect in gremlin-test
> 
>
> Key: TINKERPOP-1319
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1319
> Project: TinkerPop
>  Issue Type: Bug
>  Components: test-suite
>Affects Versions: 3.2.0-incubating, 3.1.2-incubating
>Reporter: Jason Plurad
>Assignee: Jason Plurad
>Priority: Minor
> Fix For: 3.1.3, 3.2.1
>
>
> Several {{@FeatureRequirement}} annotations are incorrect in these 
> {{gremlin-test}} tests
> * EdgeTest.java
> * FeatureSupportTest.java
> * GraphTest.java
> * PropertyTest.java
> * VertexPropertyTest.java
> * VertexTest.java
> I'll submit a patch for this.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] tinkerpop pull request #336: TINKERPOP-1320 fix GremlinGroovyScriptEngineFil...

2016-06-15 Thread pluradj
GitHub user pluradj opened a pull request:

https://github.com/apache/tinkerpop/pull/336

TINKERPOP-1320 fix GremlinGroovyScriptEngineFileSandboxTest resource loading

https://issues.apache.org/jira/browse/TINKERPOP-1320
Passed `mvn clean install -DincludeNeo4j` and integration tests cleanly.
May be CTR worthy. Let me know.
VOTE: +1


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/tinkerpop TINKERPOP-1320

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/336.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #336


commit 11491010f151d32ce80d7b9fdb88f17f57181fd8
Author: Jason Plurad 
Date:   2016-06-15T12:49:17Z

fix GremlinGroovyScriptEngineFileSandboxTest resource loading




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[GitHub] tinkerpop pull request #335: TINKERPOP-1319: fix incorrect FeatureRequiremen...

2016-06-15 Thread pluradj
GitHub user pluradj opened a pull request:

https://github.com/apache/tinkerpop/pull/335

TINKERPOP-1319: fix incorrect FeatureRequirement annotations

https://issues.apache.org/jira/browse/TINKERPOP-1319
Passed `mvn clean install -DincludeNeo4j` and integration tests cleanly.
May be CTR worthy. Let me know.
VOTE: +1


You can merge this pull request into a Git repository by running:

$ git pull https://github.com/apache/tinkerpop TINKERPOP-1319

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/tinkerpop/pull/335.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #335


commit 6fe943ff67cea8383afc6f046c175d89092601da
Author: Jason Plurad 
Date:   2016-06-15T12:51:43Z

fix incorrect FeatureRequirement annotations




---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Assigned] (TINKERPOP-1332) Improve .explain() Dialogue

2016-06-15 Thread Marko A. Rodriguez (JIRA)

 [ 
https://issues.apache.org/jira/browse/TINKERPOP-1332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Marko A. Rodriguez reassigned TINKERPOP-1332:
-

Assignee: Marko A. Rodriguez

> Improve .explain() Dialogue 
> 
>
> Key: TINKERPOP-1332
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1332
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.0-incubating
>Reporter: Russell Alexander Spitzer
>Assignee: Marko A. Rodriguez
>Priority: Minor
>
> Currently the output of explain gives you a long list of strategies but no 
> details about their application
> {code}
> ==>Traversal Explanation
> 
> Original Traversal [GraphStep(vertex,[]), CountGlobalStep]
> HaltedTraverserStrategy  [D]   [GraphStep(vertex,[]), CountGlobalStep]
> ConnectiveStrategy   [D]   [GraphStep(vertex,[]), CountGlobalStep]
> VertexProgramStrategy[D]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> OrderLimitStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> IdentityRemovalStrategy  [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> FilterRankingStrategy[O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> IncidentToAdjacentStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> RangeByIsCountStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> AdjacentToIncidentStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> MatchPredicateStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> GraphFilterStrategy  [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> PathProcessorStrategy[O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> SparkInterceptorStrategy [P]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> SparkSingleIterationStrategy [P]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> ProfileStrategy  [F]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> LambdaRestrictionStrategy[V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> ComputerVerificationStrategy [V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> StandardVerificationStrategy [V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> Final Traversal
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> {code}
> It would be helpful if filter strategies for example would list the filters 
> used.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (TINKERPOP-1332) Improve .explain() Dialogue

2016-06-15 Thread Marko A. Rodriguez (JIRA)

[ 
https://issues.apache.org/jira/browse/TINKERPOP-1332?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15331610#comment-15331610
 ] 

Marko A. Rodriguez commented on TINKERPOP-1332:
---

I have done two things.

1. TraversalExplanation.toString() word wraps at ",\n" break points.
2. Every {{VertexProgramStep}} toString() has the {{GraphFilter.toString()}} 
with it.



> Improve .explain() Dialogue 
> 
>
> Key: TINKERPOP-1332
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1332
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.0-incubating
>Reporter: Russell Alexander Spitzer
>Priority: Minor
>
> Currently the output of explain gives you a long list of strategies but no 
> details about their application
> {code}
> ==>Traversal Explanation
> 
> Original Traversal [GraphStep(vertex,[]), CountGlobalStep]
> HaltedTraverserStrategy  [D]   [GraphStep(vertex,[]), CountGlobalStep]
> ConnectiveStrategy   [D]   [GraphStep(vertex,[]), CountGlobalStep]
> VertexProgramStrategy[D]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> OrderLimitStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> IdentityRemovalStrategy  [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> FilterRankingStrategy[O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> IncidentToAdjacentStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> RangeByIsCountStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> AdjacentToIncidentStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> MatchPredicateStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> GraphFilterStrategy  [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> PathProcessorStrategy[O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> SparkInterceptorStrategy [P]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> SparkSingleIterationStrategy [P]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> ProfileStrategy  [F]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> LambdaRestrictionStrategy[V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> ComputerVerificationStrategy [V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> StandardVerificationStrategy [V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> Final Traversal
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> {code}
> It would be helpful if filter strategies for example would list the filters 
> used.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[GitHub] tinkerpop pull request #333: if there is no edge label in the GraphML file, ...

2016-06-15 Thread asfgit
Github user asfgit closed the pull request at:

https://github.com/apache/tinkerpop/pull/333


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---


[jira] [Updated] (TINKERPOP-1332) Improve .explain() Dialogue

2016-06-15 Thread stephen mallette (JIRA)

 [ 
https://issues.apache.org/jira/browse/TINKERPOP-1332?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

stephen mallette updated TINKERPOP-1332:

Affects Version/s: 3.2.0-incubating
  Component/s: process

> Improve .explain() Dialogue 
> 
>
> Key: TINKERPOP-1332
> URL: https://issues.apache.org/jira/browse/TINKERPOP-1332
> Project: TinkerPop
>  Issue Type: Improvement
>  Components: process
>Affects Versions: 3.2.0-incubating
>Reporter: Russell Alexander Spitzer
>Priority: Minor
>
> Currently the output of explain gives you a long list of strategies but no 
> details about their application
> {code}
> ==>Traversal Explanation
> 
> Original Traversal [GraphStep(vertex,[]), CountGlobalStep]
> HaltedTraverserStrategy  [D]   [GraphStep(vertex,[]), CountGlobalStep]
> ConnectiveStrategy   [D]   [GraphStep(vertex,[]), CountGlobalStep]
> VertexProgramStrategy[D]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> OrderLimitStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> IdentityRemovalStrategy  [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> FilterRankingStrategy[O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> IncidentToAdjacentStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> RangeByIsCountStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> AdjacentToIncidentStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> MatchPredicateStrategy   [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> GraphFilterStrategy  [O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> PathProcessorStrategy[O]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> SparkInterceptorStrategy [P]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> SparkSingleIterationStrategy [P]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> ProfileStrategy  [F]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> LambdaRestrictionStrategy[V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> ComputerVerificationStrategy [V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> StandardVerificationStrategy [V]   
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> Final Traversal
> [TraversalVertexProgramStep([GraphStep(vertex,[]), CountGlobalStep]), 
> ComputerResultStep]
> {code}
> It would be helpful if filter strategies for example would list the filters 
> used.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)