Clarify addE()-step from()/to() semantics in reference docs - #3609
Merged
Conversation
Distinguish the two addE() endpoint patterns that previously shared
identical callout prose: using the incoming traverser as the implicit
from-vertex (g.V(vMarko).addE('knows').to(vPeter)) versus spawning the
edge from g, which has no traverser and so requires both from() and
to() to be stated explicitly.
Add an introductory note documenting the two canonical from()/to()
argument forms (a step-label string and a child traversal), that
passing a Vertex object directly is language-variant convenience
syntax rather than canonical Gremlin, and that the examples run
cumulatively against the same graph so edges accumulate across the
block. Also correct the createdBy example callout, whose stated edge
direction was reversed relative to the actual lop->josh and
ripple->josh edges.
Assisted-by: Kiro:claude-opus-4.8
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3609 +/- ##
============================================
+ Coverage 76.35% 76.48% +0.12%
- Complexity 13424 14299 +875
============================================
Files 1012 1036 +24
Lines 60341 64620 +4279
Branches 7075 7664 +589
============================================
+ Hits 46076 49426 +3350
- Misses 11548 12102 +554
- Partials 2717 3092 +375 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The AddE Step section of the reference documentation had a few gaps that made the
from()/to()behavior hard to learn from the examples alone:g.V(vMarko).addE('knows').to(vPeter)uses the incoming traverser as the implicit from-vertex, whereasg.addE('knows').from(vMarko).to(vPeter)spawns the edge fromg— where there is no traverser to act as a default endpoint, so both endpoints must be stated explicitly. The two callouts are now distinct and explain that distinction.from()/to()argument forms were demonstrated but never stated as a rule. Added a short introductory note documenting the two canonical forms (a step-label string and a child traversal), and clarifying that passing aVertexobject directly is convenience syntax exposed by the language variant (e.g. Gremlin-Java, which resolves theVertexto its id) rather than canonical Gremlin.addE()persists and edge ids accumulate line to line) was never mentioned; added a note.lop->joshandripple->josh, but the prose read "from the josh-vertex to the lop- and ripple-vertices." Corrected.Only the AddE Step section prose/callouts were touched; the live examples are unchanged and still render the same output.