0

I have set up a docker container for tinkerpop/gremlin-server on my dev machine.

I have an .NET Core application that uses Gremlin.Net version 3.4.1

I connect to the localhost docker using IGremlinClient and when passing the following query to add a vertex:

g.addV("Root").property(id,"56b7ddc6-7629-42d4-b748-bfbce0992f13")

I then get the error:

ScriptEvaluationError: For input string: "56b7ddc6-7629-42d4-b748-bfbce0992f13"

When I run the query using the gremlin console the vertex is added:

gremlin> g.addV("Root").property(id,"56b7ddc6-7629-42d4-b748-bfbce0992f13")
==>v[56b7ddc6-7629-42d4-b748-bfbce0992f13]

How can I create a new vertex with a string as an Id when running through the IGremlinClient in my application?

Liam Hall
  • 147
  • 9

1 Answers1

2

Since you are using the default Gremlin Server Docker container you are getting this configuration for your hosted TinkerGraph:

gremlin.graph=org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph
gremlin.tinkergraph.vertexIdManager=LONG

The IdManager is set to LONG so it will only accept input values that can be coerced to a long. You should change that setting to UUID perhaps given the string you are sending or perhaps ANY. You can read more about those options here.

As a side note, I'd agree that the error message isn't helpful. Note that it has been improved for next release of 3.4.3/3.3.8.

stephen mallette
  • 45,298
  • 5
  • 67
  • 135
  • What are the steps for doing this for my docker container? – Liam Hall Jul 11 '19 at 13:04
  • 1
    Create a new `Dockerfile`, use TinkerPop's Docker image as a base, add a step that overwrites the configuration file and ultimately start a new container with your customized image. – Daniel Kuppitz Jul 11 '19 at 17:28