Skip to main content
Loading
Version: Graph 2.4.0

Graph summary

Overview

Aerospike Graph Service (AGS) provides tools for retrieving summary information and metadata about existing graph databases.

Retrieve summary information

You can retrieve summary information about a graph database, including the number of edges and vertices, without scanning the entire graph. Vertex and edge property keys are recorded as a union. They are stored as persistent data, and are not removed if the associated property is removed from all vertices or edges in the graph.

The summary collection task runs asynchronously and is intended to provide approximate statistics very quickly without having to scan the entire graph. The summary metadata may lag behind the actual graph. This summary writes to the AGS log periodically, and you can configure the frequency.

Examples

The following examples are based on a graph with the following schema:

Graph schema

The following example command runs in the Gremlin console:

gremlin> g.call("aerospike.graph.admin.metadata.summary").next()

Example output:

==>Total vertex count=450036
==>Vertex count by label={Account=100008, Consumer=50004, Subscription=100008, Communication=100008, Contact=100008}
==>Vertex properties by label={Account=[Account Number], Consumer=[Consumer Name], Subscription=[Subscription Name], Communication=[Preference Code], Contact=[Contact Value, Contact Type]}
==>Total edge count=500040
==>Edge count by label={HAS_CONTACT=200016, OWNS_ACCOUNT=100008, SUBSCRIBED_TO=100008, HAS_SUBSCRIPTION=100008}
==>Edge properties by label={HAS_CONTACT=[], OWNS_ACCOUNT=[], SUBSCRIBED_TO=[], HAS_SUBSCRIPTION=[]}

The following example command uses pretty() for improved formatting:

g.call("aerospike.graph.admin.metadata.summary").with("pretty").next()

Example output:

==> Total vertex count: 450036.
Vertex count by label: {Account=100008, Consumer=50004, Subscription=100008, Communication=100008, Contact=100008}.
Vertex properties by label: {Account=[Account Number], Consumer=[Consumer Name], Subscription=[Subscription Name], Communication=[Preference Code], Contact=[Contact Value, Contact Type]}.
Total edge count: 500040.
Edge count by label: {HAS_CONTACT=200016, OWNS_ACCOUNT=100008, SUBSCRIBED_TO=100008, HAS_SUBSCRIPTION=100008}.
Edge properties by label: {HAS_CONTACT=[], OWNS_ACCOUNT=[], SUBSCRIBED_TO=[], HAS_SUBSCRIPTION=[]}