creating a vertex with a LIST property in a single gremlin statement


Peter Musial <pmmu...@...>
 

Hi All,

(first entry, so please be patient)

Following is more of a gremlin question.  I have a JG schema with a property called status, cardinality list.

status = mgmt.makePropertyKey('status').dataType(String.class).cardinality(Cardinality.LIST).make();

In documentation it has been suggested to do this:

myVertex = graph.addVertex(label,'myVertex')
myVertex.property('status', 'HI')
myVertex.property('status', 'BYE')

which of course it works as advertised.  However, I found that the following shorthand will also work in JanusGraph 0.1.1 (but not in 0.1.0)

graph.addVertex(label,'myVertex', 'status', 'HI', 'status', 'BYE')

Can someone help explain if this is a supported syntax, or simply some syntactic sugar.  Also, I cannot find any documentation on the key differences between JanusGraph 0.1.0 and 0.1.1 with respect to gremlin.

$ echo $CASSANDRA_HOME
/path/janusgraph/apache-cassandra-2.1.17
$ which janusgraph.sh
/path/janusgraph/janusgraph-0.1.1-hadoop2/bin/janusgraph.sh
$ which gremlin.sh
/path/janusgraph/janusgraph-0.1.1-hadoop2/bin/gremlin.sh

Thank you,

Peter


Robert Dale <rob...@...>
 

It is supported syntax. It's part of the TinkerPop API.  0.1.0 and 0.1.1 both have the same version of TinkerPop Gremlin.  


Robert Dale

On Tue, Jun 20, 2017 at 2:21 PM, Peter Musial <pmmu...@...> wrote:
Hi All,

(first entry, so please be patient)

Following is more of a gremlin question.  I have a JG schema with a property called status, cardinality list.

status = mgmt.makePropertyKey('status').dataType(String.class).cardinality(Cardinality.LIST).make();

In documentation it has been suggested to do this:

myVertex = graph.addVertex(label,'myVertex')
myVertex.property('status', 'HI')
myVertex.property('status', 'BYE')

which of course it works as advertised.  However, I found that the following shorthand will also work in JanusGraph 0.1.1 (but not in 0.1.0)

graph.addVertex(label,'myVertex', 'status', 'HI', 'status', 'BYE')

Can someone help explain if this is a supported syntax, or simply some syntactic sugar.  Also, I cannot find any documentation on the key differences between JanusGraph 0.1.0 and 0.1.1 with respect to gremlin.

$ echo $CASSANDRA_HOME
/path/janusgraph/apache-cassandra-2.1.17
$ which janusgraph.sh
/path/janusgraph/janusgraph-0.1.1-hadoop2/bin/janusgraph.sh
$ which gremlin.sh
/path/janusgraph/janusgraph-0.1.1-hadoop2/bin/gremlin.sh

Thank you,

Peter

--
You received this message because you are subscribed to the Google Groups "JanusGraph users list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to janusgraph-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.