@@ -318,8 +318,10 @@ See :ref:`Graph` and :ref:`EdgeCollection` for API specification.
318318Graph Traversals
319319================
320320
321- **Graph traversals ** are executed via the :func: `arango.graph.Graph.traverse `
322- method. Each traversal can span across multiple vertex collections, and walk
321+ **Graph traversals ** are executed via AQL. The old
322+ :func: `arango.graph.Graph.traverse ` has been deprecated and can no longer be
323+ used with ArangoDB 3.12 or later.
324+ Each traversal can span across multiple vertex collections, and walk
323325over edges and vertices using various algorithms.
324326
325327**Example: **
@@ -371,13 +373,12 @@ over edges and vertices using various algorithms.
371373 teach.insert({'_from': 'teachers/jon', '_to': 'lectures/STA201'})
372374 teach.insert({'_from': 'teachers/jon', '_to': 'lectures/MAT223'})
373375
374- # Traverse the graph in outbound direction, breath-first.
375- school.traverse(
376- start_vertex='teachers/jon',
377- direction='outbound',
378- strategy='bfs',
379- edge_uniqueness='global',
380- vertex_uniqueness='global',
381- )
376+ # AQL to perform a graph traversal
377+ query = """
378+ FOR v, e, p IN 1..3 OUTBOUND 'teachers/jon' GRAPH 'school'
379+ OPTIONS { bfs: true, uniqueVertices: 'global' }
380+ RETURN {vertex: v, edge: e, path: p}
381+ """
382382
383- See :func: `arango.graph.Graph.traverse ` for API specification.
383+ # Traverse the graph in outbound direction, breath-first.
384+ cursor = db.aql.execute(query)
0 commit comments