Scylla Documentation Logo Documentation
  • Server
    • Scylla Open Source
    • Scylla Enterprise
    • Scylla Alternator
  • Cloud
    • Scylla Cloud
    • Scylla Cloud Docs
  • Tools
    • Scylla Manager
    • Scylla Monitoring Stack
    • Scylla Operator
  • Drivers
    • CQL Drivers
    • DynamoDB Drivers
Download
Menu

Caution

You're viewing documentation for a previous version of Scylla Python Driver. Switch to the latest stable version.

Scylla Python Driver API Documentation cassandra.datastax.graph.fluent

cassandra.datastax.graph.fluent¶

class cassandra.datastax.graph.fluent.DseGraph¶

Dse Graph utility class for GraphTraversal construction and execution.

DSE_GRAPH_QUERY_LANGUAGE = 'bytecode-json'¶

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

static create_execution_profile(graph_name, graph_protocol=b'graphson-2.0', **kwargs)¶

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

  • graph_protocol – (Optional) The graph protocol, default is DSE_GRAPH_QUERY_PROTOCOL.

static query_from_traversal(traversal, graph_protocol=b'graphson-2.0', context=None)¶

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

Parameters
  • traversal – The GraphTraversal object

  • graph_protocol – The graph protocol. Default is DseGraph.DSE_GRAPH_QUERY_PROTOCOL.

  • context – The dict of the serialization context, needed for GraphSON3 (tuple, udt). e.g: {‘cluster’: cluster, ‘graph_name’: name}

static traversal_source(session=None, graph_name=None, execution_profile=EXEC_PROFILE_GRAPH_DEFAULT, traversal_class=None)¶

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

Parameters
  • session – (Optional) 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.

  • traversal_class – (Optional) The GraphTraversalSource class to use (DSL).

from cassandra.cluster import Cluster
from cassandra.datastax.graph.fluent import DseGraph

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

g = DseGraph.traversal_source(session, 'my_graph')
print g.V().valueMap().toList()
static batch(session=None, execution_profile=None)¶

Returns the cassandra.datastax.graph.fluent.query.TraversalBatch object allowing to execute multiple traversals in the same transaction.

class cassandra.datastax.graph.fluent.DSESessionRemoteGraphConnection(session[, graph_name, execution_profile])¶

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.

class cassandra.datastax.graph.fluent.BaseGraphRowFactory(cluster)¶

Base row factory for graph traversal. This class basically wraps a graphson reader function to handle additional features of Gremlin/DSE and is callable as a normal row factory.

Currently supported:
  • bulk results

cassandra.datastax.graph.fluent.graph_traversal_row_factory¶

alias of cassandra.datastax.graph.fluent._GremlinGraphSON2RowFactory

cassandra.datastax.graph.fluent.graph_traversal_dse_object_row_factory¶

alias of cassandra.datastax.graph.fluent._DseGraphSON2RowFactory

PREVIOUS
cassandra.datastax.graph - Graph Statements, Options, and Row Factories
NEXT
cassandra.datastax.graph.fluent.query
  • 3.21.0
    • 3.25.4
    • 3.24.8
    • 3.22.3
    • 3.21.0
  • API Documentation
    • cassandra - Exceptions and Enums
    • cassandra.cluster - Clusters and Sessions
    • cassandra.policies - Load balancing and Failure Handling Policies
    • cassandra.auth - Authentication
    • cassandra.graph - Graph Statements, Options, and Row Factories
    • cassandra.metadata - Schema and Ring Topology
    • cassandra.metrics - Performance Metrics
    • cassandra.query - Prepared Statements, Batch Statements, Tracing, and Row Factories
    • cassandra.pool - Hosts and Connection Pools
    • cassandra.protocol - Protocol Features
    • cassandra.encoder - Encoders for non-prepared Statements
    • cassandra.decoder - Data Return Formats
    • cassandra.concurrent - Utilities for Concurrent Statement Execution
    • cassandra.connection - Low Level Connection Info
    • cassandra.util - Utilities
    • cassandra.timestamps - Timestamp Generation
    • cassandra.io.asyncioreactor - asyncio Event Loop
    • cassandra.io.asyncorereactor - asyncore Event Loop
    • cassandra.io.eventletreactor - eventlet-compatible Connection
    • cassandra.io.libevreactor - libev Event Loop
    • cassandra.io.geventreactor - gevent-compatible Event Loop
    • cassandra.io.twistedreactor - Twisted Event Loop
    • cassandra.cqlengine.models - Table models for object mapping
    • cassandra.cqlengine.columns - Column types for object mapping models
    • cassandra.cqlengine.query - Query and filter model objects
    • cassandra.cqlengine.connection - Connection management for cqlengine
    • cassandra.cqlengine.management - Schema management for cqlengine
    • cassandra.cqlengine.usertype - Model classes for User Defined Types
    • cassandra.datastax.graph - Graph Statements, Options, and Row Factories
    • cassandra.datastax.graph.fluent
    • cassandra.datastax.graph.fluent.query
    • cassandra.datastax.graph.fluent.predicates
  • Installation
  • Getting Started
  • Upgrading
  • Execution Profiles
  • Performance Notes
  • Paging Large Queries
  • Lightweight Transactions (Compare-and-set)
  • Security
  • User Defined Types
  • Object Mapper
    • Upgrade Guide
    • Models
    • Making Queries
    • Batch Queries
    • Connections
    • Third party integrations
    • Frequently Asked Questions
  • Working with Dates and Times
  • Frequently Asked Questions
  • Create an issue
  • Edit this page
Logo
Docs Contact Us About Us
Mail List Icon Slack Icon
© ScyllaDB 2021 and © DataStax 2013-2017
Powered by Sphinx 4.3.2 & ScyllaDB Theme 1.2.2