dse_graph

Module Data

dse_graph.

__version_info__

The version of the driver extension in a tuple format

dse_graph.

__version__

The version of the driver extension in a string format

class DseGraph

Dse Graph utility class for GraphTraversal construction and execution.

Attributes

DSE_GRAPH_QUERY_LANGUAGE

= ‘bytecode-json’

Graph query language, Default is ‘bytecode-json’ (GraphSON).

Static Methods

static

create_execution_profile

(graph_name)

Creates an ExecutionProfile for GraphTraversal execution. You need to register that execution profile to the cluster by using cluster.add_execution_profile.

Parameters

graph_name – The graph name

static

query_from_traversal

(traversal)

From a GraphTraversal, return a query string based on the language specified in DseGraph.DSE_GRAPH_QUERY_LANGUAGE.

Parameters

traversal – The GraphTraversal object

static

traversal_source

(session=None, graph_name=None, execution_profile=EXEC_PROFILE_GRAPH_DEFAULT)

Returns a TinkerPop GraphTraversalSource binded to the session and graph_name if provided.

Parameters
  • session – A DSE session

  • graph_name – (Optional) DSE Graph name

  • execution_profile – (Optional) Execution profile for traversal queries. Default is set to EXEC_PROFILE_GRAPH_DEFAULT.

from dse.cluster import Cluster
from dse_graph import DseGraph

c = Cluster()
session = c.connect()

g = DseGraph.traversal_source(session, 'my_graph')
print g.V().valueMap().toList()

class DSESessionRemoteGraphConnection

A Tinkerpop RemoteConnection to execute traversal queries on DSE.

Parameters
  • session – A DSE session

  • graph_name – (Optional) DSE Graph name.

  • execution_profile – (Optional) Execution profile for traversal queries. Default is set to EXEC_PROFILE_GRAPH_DEFAULT.