Vertex represents a vertex in DSE graph. Vertices have sophisticated properties. A given property can have multiple values, and each value can have a collection of meta-properties. To access a property of a vertex, you’d reference the #properties hash, and then get the n’th value, which is a VertexProperty, and then get the actual value from there.

Examples:
To get the first value of the ‘name’ property:
v.properties['name'][0].value
Use array/hash dereference shortcut
v['name'][0].value
Get all of the values of the ‘name’ property
values = v['name'].map do |vertex_prop|
  vertex_prop.value
end
Use the ‘values’ method on the array to do the heavy-lifting for you.
values = v['name'].values
VertexProperty exposes meta-properties for a value:
meta1 = v['name'][0].properties['meta1']
# Shortcut
meta1 = v['name'][0]['meta1']

Inherits

Object

Includes

  • Cassandra::Util

Methods

id

Returns id of this vertex.

Returns:
Type Details
Hash id of this vertex.

label

Returns label of this vertex.

Returns:
Type Details
String label of this vertex.

properties

Returns properties of this vertex.

Returns:
Type Details
Hash<String, Array<VertexProperty>> properties of this vertex.