option

How to configure a graph using a system option.

Synopsis

option(arg).set( value )

Graphs can be configured per graph using the following options. The Gremlin console must be used to set system commands.

Graph-Specific Options. Graph-specific options are preceded by graph. For example, graph.replication_config.
Option argument Setting Example Description Default
replication_config (replaced by replication in DSE 5.0.3 and later) { 'class' : 'NetworkTopologyStrategy', 'dc1' : 3 } Set replication configuration for a single graph. {'class' : 'SimpleStrategy', 'replication_factor' : 1 }
system_replication_config (replaced by systemReplication in DSE 5.0.3 and later) { 'class' : 'NetworkTopologyStrategy', 'dc1' : 3 } Set replication configuration for a single graph_system data. {'class' : 'SimpleStrategy', 'replication_factor' : 1 }
default_property_key_cardinality Multiple The default cardinality for automatically defined properties Single

Description

Configure a graph. Options can be set.

Examples

Create a new graph and set the graph replication configuration and the graph_system replication configuration to the Cassandra settings shown.
system.graph('food').
  option("graph.replication_config").set("{'class' : 'NetworkTopologyStrategy', 'dc1' : 3 }").
  option("graph.system_replication_config").set("{'class' : 'NetworkTopologyStrategy', 'dc1' : 3 }").
  ifNotExists().create()
The resulting list:
==>null
The replication settings can be verified using the cqlsh tool, running the CQL command DESCRIBE keyspace food;.
Note: The options shown (graph.replication_config and graph.system_replication_config) have been replaced in DSE 5.0.3 and later; see the table above.
Other schema settings can be set at graph creation, but must be changed using schema.config() if modified later.
system.graph('food2').
  option("graph.replication_config").set("{'class' : 'SimpleStrategy', 'replication_factor' : 1 }").
  option("graph.system_replication_config").set("{'class' : 'SimpleStrategy', 'replication_factor' : 1 }").
  option("graph.schema_mode").set("Development").
  option("graph.allow_scan").set("false").
  option("graph.default_property_key_cardinality").set("multiple").
  option("graph.tx_groups.*.write_consistency").set("ALL").
  create()
To check the schema settings:
:remote config alias g food2.g
schema.config().describe()
to get the results:
graph.schema_mode: Development
graph.allow_scan: False
graph.tx_groups.*.write_consistency: ALL
graph.default_property_key_cardinality: Multiple
gremlin> schema.config().option("graph.allow_scan").set("true")
Note the use of a wildcard * to set the write consistency for all transaction groups.