Skip to main content
Loading
Version: Graph 2.4.0

Data type support

This page describes the data type support for vertices and edges. The following tables enumerate the data type support levels for vertex properties, properties of vertex properties, and edge properties.

Supported vertex property data typesโ€‹

Data typeNotes
IntegerExact match or range search is supported when property is indexed.
LongExact match or range search is supported when property is indexed.
StringIndex support is only for entire string. For example, the string foobar can only be indexed as foobar and cannot be found using substrings foo or bar.
ListOnly homogenous scalar List types. Nesting is not allowed. Lists cannot be indexed.
DoubleCannot be indexed.
BooleanCannot be indexed.
Byte ArrayCannot be indexed.

Java exampleโ€‹

// Create vertex with string property.
final Vertex v1 = g.addV("person").property("name", "Foobar").next();
// Create vertex with integer property.
final Vertex v2 = g.addV("person").property("age", 29).next();
// Create vertex with long property.
final Vertex v3 = g.addV("person").property("age", 29L).next();
// Create vertex with double property.
final Vertex v4 = g.addV("person").property("age", 29.0).next();
// Create vertex with boolean property.
final Vertex v5 = g.addV("person").property("likesCoffee", true).next();
// Create vertex with byte array property.
final Vertex v6 = g.addV("person").property("foo", new byte[] {1, 2, 3, 4} ).next();
final List<String> places = new ArrayList<>();
places.add("Vancouver");
places.add("San Francisco");
places.add("Port Alberni");
places.add("Seattle");
// Create vertex with homogenous scalar arraylist property.
final Vertex v7 = g.addV("person").property("favoritePlaces", places).next();
note

Depending on the record size configured in Aerospike, the maximum size and number of properties a vertex can store may vary. This can also change depending on how many edges are stored in the vertices edge cache.

Supported vertex metaproperty data typesโ€‹

Data type
Integer
Long
String
List
Double
Boolean
Byte Array
note

Only homogenous scalar List types are allowed. Nesting of lists is not allowed.
Vertex metaproperties cannot be indexed.

Java exampleโ€‹

// Add vertex metaproperty with string value.
final Vertex v1 = g.addV("device").property("type", "android", "lastUpdated", "yesterday").next();
// Add vertex metaproperty with integer value.
final Vertex v3 = g.addV("device").property("type", "ios", "version", 1).next();
// Add vertex metaproperty with long value.
final Vertex v4 = g.addV("device").property("type", "android", "version", 1L).next();
// Add vertex metaproperty with float value.
final Vertex v5 = g.addV("device").property("type", "windows", "version", 1.0).next();
// Add vertex metaproperty with boolean value.
final Vertex v6 = g.addV("device").property("type", "android", "isValid", false).next();
// Add vertex metaproperty with byte array value.
final Vertex v7 = g.addV("device").property("type", "blackberry", "favouriteNumbers", new byte[] {1, 2, 3, 4}).next();
final List<String> places = new ArrayList<>();
places.add("Vancouver");
places.add("San Francisco");
places.add("Port Alberni");
places.add("Seattle");
// Add vertex metaproperty with list value.
final Vertex v8 = g.addV("device").property("type", "android", "placesVisited", places).next();

Supported edge property data typesโ€‹

Data type
Integer
Long
String
List
Double
Boolean
Byte Array
note

Only homogenous scalar List types are allowed. Nesting of lists is not allowed.
Edge properties cannot be indexed.

Java exampleโ€‹

// Create two vertices.
final Vertex v1 = g.addV("device").property("type", "ios").next();
final Vertex v2 = g.addV("device").property("type", "android").next();

// Create edge with string property.
final Edge e1 = g.addE("connected").from(v1).to(v2).property("since", "long time").next();
// Create edge with integer property.
final Edge e2 = g.addE("connected").from(v1).to(v2).property("forYears", 29).next();
// Create edge with long property.
final Edge e3 = g.addE("connected").from(v1).to(v2).property("forYears", 29L).next();
// Create edge with double property.
final Edge e4 = g.addE("connected").from(v1).to(v2).property("forYears", 29.0).next();
// Create edge with boolean property.
final Edge e5 = g.addE("connected").from(v1).to(v2).property("areFriends", true).next();
// Create edge with byte array property.
final Edge e6 = g.addE("connected").from(v1).to(v2).property("foo", new byte[] {1, 2, 3, 4} ).next();
final List<String> places = new ArrayList<>();
places.add("Vancouver");
places.add("San Francisco");
places.add("Port Alberni");
places.add("Seattle");
// Create edge with homogenous scalar value list property.
final Edge e7 = g.addE("knows").from(v1).to(v2).property("connectedInPlaces", places).next();