neo4j graph addVertex() with properties (rexster)

60 views
Skip to first unread message

Dmill

unread,
May 15, 2013, 5:35:11 PM5/15/13
to gremli...@googlegroups.com
Hello,

I use Rexster 2.3.0 with rexster-console 2.3.0

I'm still working around learning the ropes with gremlin so I apologize before hand if this is a ridiculously stupid question.
I've been trying the following in the console:

g = new Neo4jGraph('/tmp/neo4j-graph')
v1 = g.addVertex([name:'marko'])
v1.map

I'm expecting to get:
{name:'marko'}
but instead I get
{}

Am I missing something here? I can't seem to add any properties. Even using v1.setProperty('name','marko'); doesn't seem to work.

Thanks in advance for your help. Sorry if this is really dumb

Dmill

unread,
May 15, 2013, 5:47:10 PM5/15/13
to gremli...@googlegroups.com
v1.map() will display the properties however. Anyone know why this is?

Marko Rodriguez

unread,
May 15, 2013, 6:01:37 PM5/15/13
to gremli...@googlegroups.com
Hi,

v.map() is getting the property map.
v.map is getting the map property from the vertex. ('map' as key)

HTH,
Marko.
--
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.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Dmill

unread,
May 15, 2013, 6:39:04 PM5/15/13
to gremli...@googlegroups.com
Ok so with a tinkerGraph the map property of the vertex silently links the property map? That would make sense.

This is slightly off topic then but is there a way of displaying a vertex along with it's property map? A single request that would output id and properties.
When I use my client with rexpro on a TinkerGraph when running "g.v(2)" for example I will get something along the lines of:
array(
[_id]=>2,
[_type]=>vertex,
[_properties]=>array( [name]=>'marko' )
)
The same query on a neo4jGraph will return:
array(
[_id]=>2,
[_type]=>vertex
)

Without the _properties even though they are defined and can be found with ".map()". Is there a way of getting the property map along side the other information for neo4j graphs?

Thanks again.
Reply all
Reply to author
Forward
0 new messages