1

I'm running into a blocking issue.

In my DSE studio i started to modify my schema :

schema.propertyKey("longitude").Double().single().ifNotExists().create()
schema.propertyKey("latitude").Double().single().ifNotExists().create()
schema.vertexLabel("Locality").properties('longitude','latitude').add()

Then I check it using schema.vertexLabel("Locality").describe() :

schema.vertexLabel("Locality").properties([...], "longitude", "latitude").create()

So that's OK.

But when I try to add a vertex :

g.addV(label, 'Locality', [...], 'longitude', 47.3510905, 'latitude', 0.6622524)

I get the following error :

org.apache.tinkerpop.gremlin.driver.exception.ResponseException: Undefined column name latitude

I suspect the Cassandra structure not to be synced with the graph schema.

Do you have a solution to solve this issue ?

Precision: I'm using DSE 5.1.

Mathieu R.
  • 15
  • 2

1 Answers1

2

This is probably due to incorrect syntax when using g.addV(). You are using the syntax for graph.addVertex(). In the case of g.addV() your call should look like this:

g.addV('Locality').property([...]).property('longitude', 47.3510905).property('latitude', 0.6622524)

Note the use of multiple property() steps, one for each property set.

For documentation, see the DSE 5.1 docs here: https://docs.datastax.com/en/dse/5.1/dse-dev/datastax_enterprise/graph/using/insertDataGremlin.html?hl=addv

markc
  • 2,129
  • 16
  • 27
bswynn
  • 341
  • 1
  • 3
  • I'd like to check that Cassandra structure is fine. But I can't find any documentation about it... Do you for example how to check that a column "latitude" related to a table "Locality" exists in cassandra using cql command ? – Mathieu R. Sep 24 '18 at 08:30