QuickStart Configuration

Configure DataStax Graph to run QuickStart.

About this task

To use DSG, a graph must be created. Using DataStax Studio, either a pre-populated notebook, DataStax Graph 6.8 QuickStart, can be used, or a new notebook can be created. Instructions for both are provided. In addition, if Gremlin console is used for this QuickStart, a graph must be created, and an alias to set a graph traversal source must be executed in order for the code examples to work. The set alias identifies the graph in which all schema and queries are executed.

Should Gremlin console be exited, you must set the alias configuration again before proceeding.

DataStax Studio is a visual browser-based tool that provides a better understanding of the interconnectedness of the graph data. The Gremlin console is a command-line interface that is better suited to automation of checking and verifying query results and scripting. For initial exploration and development, Studio is highly recommended, whereas greater familiarity with DSG will make Gremlin console handy for automated verification.

Procedure

  1. Create a Studio notebook and configure a graph for the QuickStart. If you are using Gremlin console, skip to the instructions for set up..

    1. This tutorial exists as a Studio notebook, DataStax Graph 6.8 QuickStart, so that you do not have to create a notebook. However, in Studio, creating a notebook is simple. If running Studio on a Graph node, the default connection of localhost works, otherwise create a connection for the node desired. Each notebook is connected to a particular graph. Multiple notebooks can be connected to the same graph, or multiple notebooks can be created to connect to different graphs.

      Studio can create a graph from a number of different places. You can create the graph as the last step during notebook creation, or open a notebook and add a graph. Either way, several choices must be configured. The graph must be given a name, graph type designated, and replication factor settings selected.

      • Graph type: Core is the default and preferred graph engine for DataStax Graph 6.8. It allows users to access their graph data via CQL as well as Gremlin. The schemas for storing Core and Classic graphs are different, so Classic should be chosen only if a notebook will use graph data created using DataStax Graph 6.7 or earlier.

      • Replication factor: The default is set to 1. Production clusters and multi-datacenter clusters need a higher replication factor.

      • Replication strategy: The default is NetworkTopologyStrategy. In general, this default is the good option.

  2. Create a graph in Gremlin console and configure the graph for the QuickStart.

    1. Create a graph to hold the data. The system commands are used to run commands that affect graphs in DSG.

      system.graph('food_qs').
        ifNotExists().
        create()
      ==>OK
    2. Once a graph exists, a graph traversal g is configured that will allow graph traversals to be executed. Graph traversals are used to query the graph data and return results. The graph traversal can be bound to either the standard OLTP engine or the OLAP engine. In order to execute any schemas or other queries in the Gremlin console, a graph traversal must be executed first. Configure a graph traversal g to use the default graph traversal setting, which is food_qs.g.

      :remote config alias g food_qs.g
      ==>g=food_qs.g

      As with all queries in Graph, if you are using Gremlin console, alias the graph traversal g to a graph with :remote config alias g food_qs.g before running any commands.

    3. When creating a new graph, to check what graphs already exist, use:

      system.graphs()
      ==>food_qs

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com