how to use 3.4 text predicates against Neptune from gremlin console

117 views
Skip to first unread message

James Render

unread,
Sep 9, 2019, 6:29:28 AM9/9/19
to Gremlin-users
Hi, trying to do a simple startingWith search from the gremlin console against AWS Neptune.

It is a supported feature as I've got it working from my Java code.

I've tried the following combinations to no avail:

:remote connect tinkerpop.server conf/neptune-remote.yaml
:remote console
g
.V().hasLabel('user').has('name', startingWith('James')).values('name')
g.V().hasLabel('user').has('name', TextP.startingWith('James')).values('name')
g.V().hasLabel('user').has('name', org.apache.tinkerpop.gremlin.process.traversal.TextP.startingWith('James')).values('name')


I've also tried with an import..

Like I said, it's working from Java ok

Enter code here...
g.V().hasLabel("user").has("name", TextP.startingWith(name)).limit(5)
.valueMap(true, userBuilder.getPropertyKeys())

thank you

James Render

unread,
Sep 9, 2019, 12:04:20 PM9/9/19
to Gremlin-users
Just realised that my statement `it's working from Java` is incorrect.  It's working in my test that's using the gremlin server docker image rather than Neptune.

James Render

unread,
Sep 9, 2019, 12:07:08 PM9/9/19
to Gremlin-users
I get an exception back from Neptune:

java.lang.NullPointerException: null
    at java.base/java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:936)
    at org.apache.tinkerpop.gremlin.driver.Handler$GremlinResponseHandler.channelRead0(Handler.java:221)
    at org.apache.tinkerpop.gremlin.driver.Handler$GremlinResponseHandler.channelRead0(Handler.java:198)
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
    at org.apache.tinkerpop.gremlin.driver.Handler$GremlinSaslAuthenticationHandler.channelRead0(Handler.java:124)
    at org.apache.tinkerpop.gremlin.driver.Handler$GremlinSaslAuthenticationHandler.channelRead0(Handler.java:68)
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
    at org.apache.tinkerpop.gremlin.driver.handler.WebSocketClientHandler.channelRead0(WebSocketClientHandler.java:89)
    at io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:328)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:302)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.handler.ssl.SslHandler.unwrap(SslHandler.java:1475)
    at io.netty.handler.ssl.SslHandler.decodeJdkCompatible(SslHandler.java:1224)
    at io.netty.handler.ssl.SslHandler.decode(SslHandler.java:1271)
    at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:505)
    at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:444)
    at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:283)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1421)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:374)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:360)
    at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:930)
    at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163)
    at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:697)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:632)
    at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:549)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:511)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at java.base/java.lang.Thread.run(Thread.java:834)

James Render

unread,
Sep 9, 2019, 12:08:07 PM9/9/19
to Gremlin-users
g.V().hasLabel("user").or(
has("name", TextP.startingWith(lowerCase)),
has("name", TextP.startingWith(capitalised))
)
.limit(5)
.valueMap(true, userBuilder.getPropertyKeys())
.toStream()
.map(userBuilder::from)
.collect(Collectors.toSet());

James Render

unread,
Sep 9, 2019, 12:10:01 PM9/9/19
to Gremlin-users
Using gremlin client driver 3.4.1 and Java 11. Apologies for the stream of consciousness rather than a succinct question.

Chris Reed

unread,
Sep 9, 2019, 12:53:50 PM9/9/19
to Gremlin-users
Neptune does not yet support text predicates. Please open an issue with support to let them know you need this feature.

It is on their radar. It just needs to be prioritized.

Kelvin Lawrence

unread,
Sep 9, 2019, 4:38:30 PM9/9/19
to Gremlin-users
Neptune has TinkerPop 3.4 support now. Have you updated your Neptune cluster lately?


Cheers
Kelvin

James Render

unread,
Sep 9, 2019, 5:05:07 PM9/9/19
to gremli...@googlegroups.com
Thanks Kelvin, yes I was reading your blog post earlier today.

I think this might be a UX issue on the Neptune side. When I look at the version on my Neptune instance, it's the latest one from the release notes. However there is the option to upgrade. I've left the cluster updating overnight.

Mea culpa, I skim read the release notes and having seen the matching version on the instance UI assumed everything upgraded to 3.4.1 without further intervention.

I'll reread your blog and the release notes. I'll see what the upgrade to the cluster has done when I'm in the office tomorrow.

Cheers

--
You received this message because you are subscribed to a topic in the Google Groups "Gremlin-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gremlin-users/Z7LXAxZ2aoM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/2df72250-7dd9-42f7-acee-c2cba3f5f0f9%40googlegroups.com.

James Render

unread,
Sep 10, 2019, 3:50:33 AM9/10/19
to Gremlin-users
Yes, that was the issue.  When looking at the instance details on neptune, it was showing 1.0.1.0.  When I go to `modify` it shows the latest version in the drop-down as the only option. I made the assumption that this meant the instance was running on the latest version.
Upgrading the cluster resolved the issue.  I feel that the neptune version shown on the Summary should have the full version details especially when the difference between two versions can be a major release of gremlin.  I'll leave that feedback.

thanks

On Monday, September 9, 2019 at 10:05:07 PM UTC+1, James Render wrote:
Thanks Kelvin, yes I was reading your blog post earlier today.

I think this might be a UX issue on the Neptune side. When I look at the version on my Neptune instance, it's the latest one from the release notes. However there is the option to upgrade. I've left the cluster updating overnight.

Mea culpa, I skim read the release notes and having seen the matching version on the instance UI assumed everything upgraded to 3.4.1 without further intervention.

I'll reread your blog and the release notes. I'll see what the upgrade to the cluster has done when I'm in the office tomorrow.

Cheers

On Mon, 9 Sep 2019, 21:38 Kelvin Lawrence, <kelvin.r...@gmail.com> wrote:
Neptune has TinkerPop 3.4 support now. Have you updated your Neptune cluster lately?


Cheers
Kelvin

On Monday, September 9, 2019 at 9:53:50 AM UTC-7, Chris Reed wrote:
Neptune does not yet support text predicates. Please open an issue with support to let them know you need this feature.

It is on their radar. It just needs to be prioritized.

--
You received this message because you are subscribed to a topic in the Google Groups "Gremlin-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gremlin-users/Z7LXAxZ2aoM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gremlin-users+unsubscribe@googlegroups.com.

Kelvin Lawrence

unread,
Sep 10, 2019, 2:09:19 PM9/10/19
to Gremlin-users
Without getting too product specific on this list - the best way to get the exact version is to sent a request to the endpoint in the form of

curl <your-instance-name>:8182/status


Cheers
Kelvin


On Tuesday, September 10, 2019 at 12:50:33 AM UTC-7, James Render wrote:
Yes, that was the issue.  When looking at the instance details on neptune, it was showing 1.0.1.0.  When I go to `modify` it shows the latest version in the drop-down as the only option. I made the assumption that this meant the instance was running on the latest version.
Upgrading the cluster resolved the issue.  I feel that the neptune version shown on the Summary should have the full version details especially when the difference between two versions can be a major release of gremlin.  I'll leave that feedback.

thanks

On Monday, September 9, 2019 at 10:05:07 PM UTC+1, James Render wrote:
Thanks Kelvin, yes I was reading your blog post earlier today.

I think this might be a UX issue on the Neptune side. When I look at the version on my Neptune instance, it's the latest one from the release notes. However there is the option to upgrade. I've left the cluster updating overnight.

Mea culpa, I skim read the release notes and having seen the matching version on the instance UI assumed everything upgraded to 3.4.1 without further intervention.

I'll reread your blog and the release notes. I'll see what the upgrade to the cluster has done when I'm in the office tomorrow.

Cheers

On Mon, 9 Sep 2019, 21:38 Kelvin Lawrence, <kelvin....@gmail.com> wrote:
Neptune has TinkerPop 3.4 support now. Have you updated your Neptune cluster lately?


Cheers
Kelvin

On Monday, September 9, 2019 at 9:53:50 AM UTC-7, Chris Reed wrote:
Neptune does not yet support text predicates. Please open an issue with support to let them know you need this feature.

It is on their radar. It just needs to be prioritized.

--
You received this message because you are subscribed to a topic in the Google Groups "Gremlin-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gremlin-users/Z7LXAxZ2aoM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gremli...@googlegroups.com.

James Render

unread,
Sep 11, 2019, 3:38:27 AM9/11/19
to gremli...@googlegroups.com
that's really helpful and is going into my playbook, thanks Kelvin, much appreciated!

To unsubscribe from this group and all its topics, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/a7270817-887d-4014-bb97-4da173ec1228%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages