Skip to content

Commit 5f765f0

Browse files
committed
Integrate dse-graph documentation
1 parent 4d7ae9b commit 5f765f0

File tree

9 files changed

+424
-10
lines changed

9 files changed

+424
-10
lines changed

docs/api/cassandra/cluster.rst

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,13 @@
152152

153153
.. autoattribute:: client_protocol_handler
154154

155-
.. automethod:: execute(statement[, parameters][, timeout][, trace][, custom_payload][, paging_state][, host])
155+
.. automethod:: execute(statement[, parameters][, timeout][, trace][, custom_payload][, paging_state][, host][, execute_as])
156156

157-
.. automethod:: execute_async(statement[, parameters][, trace][, custom_payload][, paging_state][, host])
157+
.. automethod:: execute_async(statement[, parameters][, trace][, custom_payload][, paging_state][, host][, execute_as])
158+
159+
.. automethod:: execute_graph(statement[, parameters][, trace][, execution_profile=EXEC_PROFILE_GRAPH_DEFAULT][, execute_as])
160+
161+
.. automethod:: execute_graph_async(statement[, parameters][, trace][, execution_profile=EXEC_PROFILE_GRAPH_DEFAULT][, execute_as])
158162

159163
.. automethod:: prepare(statement)
160164

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
:mod:`cassandra.datastax.graph.fluent`
2+
======================================
3+
4+
.. module:: cassandra.datastax.graph.fluent
5+
6+
.. autoclass:: DseGraph
7+
8+
.. autoattribute:: DSE_GRAPH_QUERY_LANGUAGE
9+
10+
.. automethod:: create_execution_profile
11+
12+
.. automethod:: query_from_traversal
13+
14+
.. automethod:: traversal_source(session=None, graph_name=None, execution_profile=EXEC_PROFILE_GRAPH_DEFAULT, traversal_class=None)
15+
16+
.. automethod:: batch(session=None, execution_profile=None)
17+
18+
.. autoclass:: DSESessionRemoteGraphConnection(session[, graph_name, execution_profile])
19+
20+
.. autoclass:: BaseGraphRowFactory
21+
22+
.. autoclass:: graph_traversal_row_factory
23+
24+
.. autoclass:: graph_traversal_dse_object_row_factory
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
:mod:`cassandra.datastax.graph.fluent.predicates`
2+
=================================================
3+
4+
.. module:: cassandra.datastax.graph.fluent.predicates
5+
6+
7+
.. autoclass:: Search
8+
:members:
9+
10+
.. autoclass:: Geo
11+
:members:
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
:mod:`cassandra.datastax.graph.fluent.query`
2+
============================================
3+
4+
.. module:: cassandra.datastax.graph.fluent.query
5+
6+
7+
.. autoclass:: TraversalBatch
8+
:members:

docs/api/index.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,12 @@ Object Mapper
4040
cassandra/cqlengine/connection
4141
cassandra/cqlengine/management
4242
cassandra/cqlengine/usertype
43+
44+
DataStax Graph
45+
--------------
46+
.. toctree::
47+
:maxdepth: 1
48+
49+
cassandra/datastax/graph/fluent/index
50+
cassandra/datastax/graph/fluent/query
51+
cassandra/datastax/graph/fluent/predicates

docs/graph.rst

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
DSE Graph Queries
2-
=================
1+
DataStax Graph Queries
2+
======================
33

44
The Cassandra driver executes graph queries over the Cassandra native protocol. Use
55
:meth:`.Session.execute_graph` or :meth:`.Session.execute_graph_async` for
66
executing gremlin queries in DSE Graph.
77

88
Three Execution Profiles are provided suitable for graph execution:
99

10-
* :data:`~.cluster.EXEC_PROFILE_GRAPH_DEFAULT`
11-
* :data:`~.cluster.EXEC_PROFILE_GRAPH_SYSTEM_DEFAULT`
12-
* :data:`~.cluster.EXEC_PROFILE_GRAPH_ANALYTICS_DEFAULT`
10+
* :data:`.cluster.EXEC_PROFILE_GRAPH_DEFAULT`
11+
* :data:`.cluster.EXEC_PROFILE_GRAPH_SYSTEM_DEFAULT`
12+
* :data:`.cluster.EXEC_PROFILE_GRAPH_ANALYTICS_DEFAULT`
1313

1414
See :doc:`getting_started` and :doc:`execution_profiles`
1515
for more detail on working with profiles.
@@ -170,6 +170,8 @@ We are all set. You can now query your graph. Here are some examples::
170170

171171
To see a more graph examples, see `DataStax Graph Examples <https://github.com/datastax/graph-examples/>`_.
172172

173+
.. _graph-types:
174+
173175
Graph Types
174176
~~~~~~~~~~~
175177

@@ -222,11 +224,12 @@ or lists by index::
222224
result.value # [0, 1, 2] (list)
223225
result[1] # 1 (list[1])
224226

225-
You can use a different row factory by setting :attr:`.Session.default_graph_row_factory` or passing it to
226-
:meth:`.Session.execute_graph`. For example, :func:`.datastax.graph.single_object_row_factory` returns the JSON result string`,
227+
You can use a different row factory by setting :attr:`.cluster.ExecutionProfile.row_factory` or passing it to
228+
:meth:`cluster.Session.execute_graph`. For example, :func:`.datastax.graph.single_object_row_factory` returns the JSON result string,
227229
unparsed. :func:`.datastax.graph.graph_result_row_factory` returns parsed, but unmodified results (such that all metadata is retained,
228230
unlike :func:`.datastax.graph.graph_object_row_factory`, which sheds some as attributes and properties are unpacked). These results
229-
also provide convenience methods for converting to known types (:meth:`~.Result.as_vertex`, :meth:`~.Result.as_edge`, :meth:`~.Result.as_path`).
231+
also provide convenience methods for converting to known types (:meth:`.datastax.graph.Result.as_vertex`, :meth:`.datastax.graph.Result.as_edge`,
232+
:meth:`.datastax.graph.Result.as_path`).
230233

231234
Vertex and Edge properties are never unpacked since their types are unknown. If you know your graph schema and want to
232235
deserialize properties, use the :class:`.datastax.graph.GraphSON1Deserializer`. It provides convenient methods to deserialize by types (e.g.

0 commit comments

Comments
 (0)