This is an automated email from the ASF dual-hosted git repository.
spmallette pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tinkerpop.git
The following commit(s) were added to refs/heads/master by this push:
new 6802da451e Fix PageRank Step example to read the configured property
name
6802da451e is described below
commit 6802da451ed684d39451f64db1c28f53ac1291f6
Author: Stephen Mallette <[email protected]>
AuthorDate: Thu Sep 10 18:15:01 2026 +0000
Fix PageRank Step example to read the configured property name
The first example in the PageRank Step section set PageRank.propertyName to
'friendRank' but then read values('pageRank'), a key that does not exist, so
the traversal silently returned nothing. Read values('friendRank') so the
key
matches the configured property, and note that the key passed to values()
must
match the name set via PageRank.propertyName, along with the default
property
used when it is not overridden.
Assisted-by: Kiro:claude-opus-4.8
---
docs/src/reference/the-traversal.asciidoc | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/docs/src/reference/the-traversal.asciidoc
b/docs/src/reference/the-traversal.asciidoc
index 57a32ba02b..fa0e2b7829 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -4314,7 +4314,7 @@ supports `GraphComputer` (OLAP).
[gremlin-groovy,modern]
----
g = traversal().with(graph).withComputer()
-g.V().pageRank().with(PageRank.propertyName, 'friendRank').values('pageRank')
+g.V().pageRank().with(PageRank.propertyName, 'friendRank').values('friendRank')
g.V().hasLabel('person').
pageRank().
with(PageRank.edges, __.outE('knows')).
@@ -4324,7 +4324,10 @@ g.V().hasLabel('person').
----
Note the use of the `with()` modulating step which provides configuration
options to the algorithm. It takes
-configuration keys from the `PageRank` and is automatically imported to the
Gremlin Console.
+configuration keys from the `PageRank` and is automatically imported to the
Gremlin Console. When `PageRank.propertyName`
+is used, the computed scores are stored under that property, so the key passed
to `values()` (or referenced later in the
+traversal) must match the configured name. Reading a different key returns
nothing. If `PageRank.propertyName` is not
+specified, the scores are stored under the default property
`gremlin.pageRankVertexProgram.pageRank`.
The <<explain-step,`explain()`>>-step can be used to understand how the
traversal is compiled into multiple
`GraphComputer` jobs.