Examining graphs
Graphs have characteristics that can be examined with a variety of commands.
Procedure
-
A list of all graphs can be retrieved with the following command:
system.graphs()
In Studio and Gremlin console, a list is retrieved, although the presentation is different. Here is a Gremlin console result:
==> food ==> test
-
A list of all graph and their attributes can be retrieved as well:
system.list()
==>Name: food_cql | Engine: Core | Replication: {replication_factor=1, class=org.apache.cassandra.locator.SimpleStrategy} ==>Name: food_classic | Engine: Classic | Replication: {class=org.apache.cassandra.locator.NetworkTopologyStrategy, SearchGraphAnalytics=1}
This result shows two different graphs, one with a Core engine and one with a Classic engine. The first listed graph was created without replication settings and defaulted to a replication factor of 1 and a
SimpleStrategy
. -
To examine a particular graph, use the describe command:
system.graph('food').describe()
==>system.graph('food').ifNotExists().withReplication("{'class': 'org.apache.cassandra.locator.NetworkTopologyStrategy', 'SearchGraphAnalytics': '1'}").andDurableWrites(true).create()