Hi, can I use multi-value property on meta-properties?I want store the following data in one node :
{time:[1,--->{user:['a','b']} 2,--->{user:['c','d'] ...... }

I try the following command in gremlin console:graph = JanusGraphFactory.open("conf/janusgraph-hbase.properties") conf = new BaseConfiguration() conf.setProperty("gremlin.tinkergraph.defaultVertexPropertyCardinality","list") g=graph.traversal()
g.addV('time','1','time','2') g.V().properties("time").hasValue("2").property('user','a') g.V().properties("time").hasValue("2").property('user','b')
g.V().properties("time")
==>vp[time->1] ==>vp[time->2]
g.V().properties("time").hasValue("2").properties()
==>p[user->b]
I find the property on time property only accept single value.thanks,Jerry
|
|
Jason Plurad <plu...@...>
Hi Jerry,
Yes, you can. You should check out the docs on vertex property cardinality http://docs.janusgraph.org/latest/schema.html#property-cardinality
If you don't use the schema manager to define a LIST or SET cardinality, it will default to SINGLE.
-- Jason
toggle quoted message
Show quoted text
On Monday, April 24, 2017 at 4:48:24 AM UTC-4, Jerry wrote: Hi, can I use multi-value property on meta-properties?I want store the following data in one node :
{time:[1,--->{user:['a','b']} 2,--->{user:['c','d'] ...... }

I try the following command in gremlin console:graph = JanusGraphFactory.open("conf/janusgraph-hbase.properties") conf = new BaseConfiguration() conf.setProperty("gremlin.tinkergraph.defaultVertexPropertyCardinality","list") g=graph.traversal()
g.addV('time','1','time','2') g.V().properties("time").hasValue("2").property('user','a') g.V().properties("time").hasValue("2").property('user','b')
g.V().properties("time")
==>vp[time->1] ==>vp[time->2]
g.V().properties("time").hasValue("2").properties()
==>p[user->b]
I find the property on time property only accept single value.thanks,Jerry
|
|
Hi Jason,
he asked about meta-properties, not vertex properties.
Cheers, Daniel
toggle quoted message
Show quoted text
On Mon, Apr 24, 2017 at 6:18 PM, Jason Plurad <plu...@...> wrote: Hi Jerry,
-- JasonOn Monday, April 24, 2017 at 4:48:24 AM UTC-4, Jerry wrote: Hi, can I use multi-value property on meta-properties?I want store the following data in one node :
{time:[1,--->{user:['a','b']} 2,--->{user:['c','d'] ...... }

I try the following command in gremlin console:graph = JanusGraphFactory.open("conf/janusgraph-hbase.properties") conf = new BaseConfiguration() conf.setProperty("gremlin.tinkergraph.defaultVertexPropertyCardinality","list") g=graph.traversal()
g.addV('time','1','time','2') g.V().properties("time").hasValue("2").property('user','a') g.V().properties("time").hasValue("2").property('user','b')
g.V().properties("time")
==>vp[time->1] ==>vp[time->2]
g.V().properties("time").hasValue("2").properties()
==>p[user->b]
I find the property on time property only accept single value.thanks,Jerry
|
|
Jason Plurad <plu...@...>
Doh, you're right Daniel. Meta-properties do not support cardinality, only vertex properties do.
toggle quoted message
Show quoted text
On Monday, April 24, 2017 at 12:46:23 PM UTC-4, Daniel Kuppitz wrote: Hi Jason,
he asked about meta-properties, not vertex properties.
Cheers, Daniel
On Mon, Apr 24, 2017 at 6:18 PM, Jason Plurad wrote: Hi Jerry,
-- JasonOn Monday, April 24, 2017 at 4:48:24 AM UTC-4, Jerry wrote: Hi, can I use multi-value property on meta-properties?I want store the following data in one node :
{time:[1,--->{user:['a','b']} 2,--->{user:['c','d'] ...... }

I try the following command in gremlin console:graph = JanusGraphFactory.open("conf/janusgraph-hbase.properties") conf = new BaseConfiguration() conf.setProperty("gremlin.tinkergraph.defaultVertexPropertyCardinality","list") g=graph.traversal()
g.addV('time','1','time','2') g.V().properties("time").hasValue("2").property('user','a') g.V().properties("time").hasValue("2").property('user','b')
g.V().properties("time")
==>vp[time->1] ==>vp[time->2]
g.V().properties("time").hasValue("2").properties()
==>p[user->b]
I find the property on time property only accept single value.thanks,Jerry
|
|