-
Notifications
You must be signed in to change notification settings - Fork 26
DOC-2415: Updated FROM syntax to v3 #268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Tushar-TG-14
merged 16 commits into
4.2.0-dev
from
DOC-2415-updating-from-syntax-of-the-examples-to-v3
Apr 1, 2025
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
ab98dc3
DOC-2415: Updated FROM syntax to v3
Tushar-TG-14 a49a0c8
DOC-2415-FROM syntax changes (select_statement_accum)
Tushar-TG-14 53ccfc3
DOC-2415-FROM syntax changes (select_statement_accum_1)
Tushar-TG-14 90274fe
DOC-2415-FROM syntax changes (select_statement_accum_2)
Tushar-TG-14 14982f5
DOC-2415-FROM syntax changes (index_three_post_accum_clauses)
Tushar-TG-14 3d39ef8
DOC-2415-FROM syntax changes (index_accum_vertex_accum_edge)
Tushar-TG-14 461953a
DOC-2415-FROM syntax changes (index_order_by_descending)
Tushar-TG-14 1381661
DOC-2415-FROM syntax changes (index_global_accum)
Tushar-TG-14 1186534
DOC-2415-FROM syntax changes (index_having)
Tushar-TG-14 3b85806
DOC-2415-FROM syntax changes (multiple_edge_type_accum_compilable)
Tushar-TG-14 221c3ad
DOC-2415-FROM syntax changes (multiple_edge_type_accum_error)
Tushar-TG-14 878c55b
DOC-2415-FROM syntax changes (index_updating_indirect_reference_vertex)
Tushar-TG-14 c88d797
DOC-2415-FROM syntax changes (indirect_vertex_accum)
Tushar-TG-14 76975c5
DOC-2415-FROM syntax changes (index_where_and_or)
Tushar-TG-14 255be60
DOC-2415-FROM syntax changes (index_vertex_post_accum)
Tushar-TG-14 cc0376b
DOC-2415-FROM syntax changes (index page)
Tushar-TG-14 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
2 changes: 1 addition & 1 deletion
2
modules/appendix/examples/friend_net/select_statement_index_limit_lower_bound_and_size.gsql
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
2 changes: 1 addition & 1 deletion
2
modules/appendix/examples/friend_net/select_statement_index_limit_with_offset.gsql
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
2 changes: 1 addition & 1 deletion
2
modules/appendix/examples/friend_net/select_statement_index_limt_by.gsql
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
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
8 changes: 4 additions & 4 deletions
8
modules/appendix/examples/ldbc_snb/select_statement_accum.gsql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
CREATE QUERY accum_wrong_example() SYNTAX v2 { | ||
CREATE QUERY accum_wrong_example() SYNTAX v3 { | ||
SumAccum<INT> @@count_total; | ||
SumAccum<INT> @active_flag = 0; | ||
|
||
result = SELECT p | ||
FROM Person: p - (KNOWS) - Person: w | ||
FROM (p:Person) -[:KNOWS]- (w:Person) | ||
WHERE w.lastName == "Wang" AND p.firstName == "Peter" | ||
ACCUM p.@active_flag += 1, | ||
@@count_total += p.@active_flag; // <1> | ||
@@count_total += p.@active_flag; // <1> | ||
PRINT @@count_total, result[result.@active_flag]; | ||
} | ||
} |
6 changes: 3 additions & 3 deletions
6
modules/appendix/examples/ldbc_snb/select_statement_accum_2.gsql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
CREATE QUERY accum_example() SYNTAX v2 { | ||
CREATE QUERY accum_example() SYNTAX v3 { | ||
SumAccum<INT> @@count_total; | ||
SumAccum<INT> @active_flag = 0; | ||
|
||
result = SELECT p | ||
FROM Person: p - (KNOWS) - Person: w | ||
FROM (p:Person) -[:KNOWS]- (w:Person) | ||
WHERE w.lastName == "Wang" AND p.firstName == "Peter" | ||
ACCUM p.@active_flag += 1 | ||
POST-ACCUM @@count_total += p.@active_flag; | ||
PRINT @@count_total, result[result.@active_flag]; | ||
} | ||
} |
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
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
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
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
4 changes: 2 additions & 2 deletions
4
modules/appendix/examples/social_net/select_statement_index_having.gsql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
CREATE QUERY active_members (INT activity_threshold) FOR GRAPH Social_Net { | ||
SumAccum<INT> @activity_amount; | ||
start = {Person.*}; | ||
result = SELECT v FROM start:v -(:e)- Post:tgt | ||
result = SELECT v FROM (v:start) -[e]- (tgt:Post) | ||
ACCUM v.@activity_amount +=1 | ||
HAVING v.@activity_amount >= activity_threshold; | ||
PRINT result; | ||
} | ||
} |
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
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
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
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
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
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
2 changes: 1 addition & 1 deletion
2
modules/appendix/examples/social_net/select_statement_index_where.gsql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
CREATE QUERY print_cat_posts() FOR GRAPH Social_Net { | ||
cat_posts = SELECT v FROM Post:v // select only those post vertices | ||
cat_posts = SELECT v FROM (v:Post) // select only those post vertices | ||
WHERE v.subject == "cats"; // which have a subset of 'cats' | ||
PRINT cat_posts; | ||
} |
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
2 changes: 1 addition & 1 deletion
2
modules/appendix/examples/social_net/select_statement_index_where_multiple_edge_type.gsql
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
6 changes: 3 additions & 3 deletions
6
modules/appendix/examples/social_net/select_statement_index_where_using_in.gsql
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
CREATE QUERY find_graph_focused_posts() FOR GRAPH Social_Net { | ||
results = SELECT v FROM Post:v // select only post vertices | ||
WHERE v.subject IN ("Graph", "tigergraph"); // which have a subject of either 'Graph' or 'tigergraph' | ||
PRINT results; | ||
results = SELECT v FROM (v:Post) // select only post vertices | ||
WHERE v.subject IN ("Graph", "tigergraph"); // which have a subject of either 'Graph' or 'tigergraph' | ||
PRINT results; | ||
} |
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
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
2 changes: 1 addition & 1 deletion
2
modules/appendix/examples/work_net/select_statement_index_where_using_edge_attributes.gsql
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Posted and Liked are directed edge types -[ ]->
Friend is an undirected edge type -[ ]-
Please check the documentation for what is the right way to handle a mixed set of edge types.