Datastax Studio, our new fantastic web based notebook editor for use withDSE Graph 5.0, is a great application for you to execute your graph queries and visualize your results. In this post, we’ll give you a glimpse (you’ll still have to try it to believe it) of the powerful code editor that comes with Studio. The editor is packed with many of the features you’ve come to expect from advanced integrated development environments (IDE), as well as other exciting features that will help you be more productive when working with DSE Graph 5.0 and the Apache TinkerPop query language Gremlin.
So without further ado, let’s take a tour of two areas in the Studio Gremlin editor that will help you write Gremlin queries better and faster: Validations and Content Assist.
Stay Productive with ValidationsStudio comes with a few different types of validations: Groovy Syntax Validations, Type Checking Validations and Domain Specific Validations. Let’s take a look at each of them.
Groovy Support and Syntax ValidationsUltimately your code is executed within DSE Graph as Groovy so we’ve added enough Groovy syntax support for you to be very productive and happy as you craft your Gremlin statements. What better way to demonstrate this than with a screenshot of a syntax error!

Figure 1: Syntax Error Support errors are marked in the gutter and the specific snippet causing the error is underlined. Hovering over the gutter marker gives you details about the error.
The editor does not support full Groovy syntax but fret not Groovy developers. If there is some Groovy syntax you’d like to use that is not currently supported by the editor, there is a handy toggle button to disable Studio validations as shown below in Figure 2 .

Figure 2: Toggle button to disable editor validations.
For more details on what Groovy syntax is and is not supported, please checkout the Studio documentation .
Type Checking ValidationsPure syntax validation is handy, but when learning a new API it’s even more important to get type validation. In Figure 3 & 4 you can see that the Studio editor validates method names, type signatures, as well as other standard type validations you’d expect:

Figure 3: Method name validation.

Figure 4: Argument type validation.
In Figure 4 , it is worth noting that default Groovy behavior would coerce the value to a String. However, we believe it’s more useful to be stricter to help catch programmatic errors earlier.
Domain Specific Validations for TinkerpopDataStax Studio also provides domain specific validations. As an example, let’s take a look at a validation that will help you avoid a common mistake when first learning Tinkerpop not iterating your traversals. This gotcha is explained in-depth in the Datastax Studio Tutorial notebook. But for the purposes of this post, it’s enough to say that creating a traversal and never iterating it, is bad. But don’t worry! As long as you are writing your Gremlin in Studio, we’ll gently remind you to correct the issue.

Figure 5: The `iterate your traversals` warning. Note: The last line does not have a warning because DSE Graph will automatically iterate the final traversal of a notebook cell. Getting Help with Content Assist
Rote memorization of APIs or constantly referring to documentation is no fun. So as you’d expect when you invoke content assist ( ctrl+space ) in Studio you’ll get method, variable, class, and other types of proposals.
Studio prioritizes proposals from the Tinkerpop and DSE Graph APIs so it’s easy for you to find methods specific to the task of writing Gremlin queries. If that wasn’t enough, Studio will also make proposals based on the state of your DSE Graph schema. We call this schema assist and we’ll talk more about that after some quick examples of more traditional content assist proposals: Method and Variable Proposals
Method Proposals
Figure 6: Method proposals the most obvious yet super useful form of content assist.
In Figure 6 , there are a couple of details worth pointing out:
The editor is prioritizing methods that are declared on the most specific type being invoked. In this case, GraphTraversalSource . There is always an implicit variable called g in your notebook cells. g is a pre-defined variable that is of type GraphTraversalSource: http://tinkerpop.apache.org/javadocs/current/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.html Variable ProposalsStudio will propose, where appropriate, predefined variables as well as the variables that you’ve created that are in scope. Variable scope is based purely on cell editor content and is ordered from top to bottom of the notebook.

Figure 7: Proposals of variables, both predefined(g, graph, schema), as well as those defined in Notebook cells (customerName, and orderId). Proposal Filtering
For all types of proposals after invoking content assist, you can type to filter the proposals as shown below:

Figure 8: Example of filtering proposals. Any type of proposal can be filtered by typing. Schema Assist
Many of the Gremlin APIs allow you to filter vertices or edges based on property keys or labels present on those graph elements. Those keys and labels are part of your graph’s schema. With any schema that is not trivially small it can be easy to forget its structure. One of the ways Studio helps is by giving a great visualization of your graph’s schema as seen in Figure 9 .

Figure 9: A visualization of the ‘Graph of the Gods’ schema from the DataStax Studio tutorial.
But as you are writing your queries, you shouldn’t have to refer to the schema visualization repeatedly. So we’ve leveraged content assist as a place to provide you with suggestions for vertex/edge property keys and label values.
Sweet! Now your eyes can stay focused on where you are typing. Let’s take a look at what happens when we invoke content assist on a traversal that takes a property key as an argument; using the same schema that is visualized in