Skip to content

TINKERPOP-3023 Expand type syntax in grammar - Remove Vertex - TP4#3138

Merged
Cole-Greer merged 21 commits into
masterfrom
grammar_vertex_master
Jul 22, 2025
Merged

TINKERPOP-3023 Expand type syntax in grammar - Remove Vertex - TP4#3138
Cole-Greer merged 21 commits into
masterfrom
grammar_vertex_master

Conversation

@Cole-Greer

Copy link
Copy Markdown
Contributor

This is a followup to #3133 with changes exclusively for TP4. The primary difference in TP4 is that bytecode has been replaced with GremlinLang, which means that the use of Vertex in V(), from(), and to() is now sugar added by GraphTraversal. These vertices must be converted to their ids when passed into GremlinLang.

@Cole-Greer Cole-Greer marked this pull request as ready for review July 10, 2025 19:18
@Cole-Greer Cole-Greer marked this pull request as draft July 10, 2025 19:23

if isinstance(arg, Vertex):
return f'new ReferenceVertex({self._arg_as_string(arg.id)},\'{arg.label}\')'
return f'{self._arg_as_string(arg.id)}'

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Python implements the Vertex to id sugar at the GremlinLang level instead of special cases for V(), from(), to(), and mergeE(). Would we want to copy this same approach for other GLVs as they adopt GremlinLang or is it best to focus the sugar to specific steps?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Opted to implement on an individual step bases

@Cole-Greer Cole-Greer marked this pull request as ready for review July 11, 2025 00:27
@Cole-Greer

Copy link
Copy Markdown
Contributor Author

VOTE +1

@Cole-Greer Cole-Greer merged commit f8f7076 into master Jul 22, 2025
7 checks passed
@Cole-Greer Cole-Greer deleted the grammar_vertex_master branch July 22, 2025 01:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants