Thoughts on Neptune graph structure on supporting lists / arrarys.

953 views
Skip to first unread message

-blesstec

unread,
Jun 28, 2018, 6:14:36 PM6/28/18
to gremli...@googlegroups.com
Hello,
It turns out that Neptune currently does not support properties with values having array type (key/values). However, it supports carnality on vertex properties.  

I have need to store such data structure as vertex properties. What will be recommendation on graph structure for supporting array like property values?

One thought comes in mind that I array / list type properties into a child vertex and store individual array key/value as separate property. 

Can I use property cardinality to same effect?

Or any other ideas to support arrays / list structures in case of Neptune?

 Many thanks.
-blesstec

Kelvin Lawrence

unread,
Jun 29, 2018, 10:57:42 AM6/29/18
to Gremlin-users
Hi there,

How big are the arrays that you will be needing to store?

Cheers
Kelvin

-blesstec

unread,
Jun 29, 2018, 12:18:34 PM6/29/18
to gremli...@googlegroups.com
Arrays / Lists can be of arbitrary length. But at times can go to 100 elements or so.

SI

--
You received this message because you are subscribed to the Google Groups "Gremlin-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gremlin-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/gremlin-users/6e80661b-a740-47ab-af62-e8c76a430f84%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

HadoopMarc

unread,
Jun 30, 2018, 10:01:18 AM6/30/18
to Gremlin-users
Bless you,

Start up you gremlin console and give it a try!

gremlin> g = TinkerGraph.open().traversal()
==>graphtraversalsource[tinkergraph[vertices:0 edges:0], standard]
gremlin
> g.addV().property("visited", "Berlin")
==>v[0]
gremlin
> g.V(0L).property(set, "visited", "London").next()
==>v[0]
gremlin
> g.V().valueMap(true)
==>[label:vertex,visited:[Berlin,London],id:0]
gremlin
> g.V().has("visited", "Berlin")
==>v[0]
gremlin
>

Cheers,     Marc


Op vrijdag 29 juni 2018 18:18:34 UTC+2 schreef Blesstech Llc:

Olav Laudy

unread,
Jun 30, 2018, 10:28:57 AM6/30/18
to gremli...@googlegroups.com
One important thing is to realize this: 


Neptune supports set cardinality and single cardinality. Set cardinality is selected if not specified. This means that if you set a property value, it adds a new value to the property, but only if it does not already appear in the set of values. This is the Gremlin enumeration value of Set.

List is not supported. For more information about property cardinality, see the Vertex topic in the Gremlin JavaDoc.


Thus, in order to make a set a list, you would have to prefix an unique id to your element.   


Olav

Emma Yang

unread,
Jul 3, 2019, 12:19:43 PM7/3/19
to Gremlin-users
When do the CSV bulk insert , is there any way we can configure the SET or Single cardinality ?  and also it seems that Edges, it only support Single Single cardinality...
Olav

To unsubscribe from this group and stop receiving emails from it, send an email to gremli...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages