-
Notifications
You must be signed in to change notification settings - Fork 27
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 1 commit
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
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_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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
CREATE QUERY multiple_edge_type_where_ex(VERTEX<Person> m1) FOR GRAPH Social_Net { | ||
all_user = {m1}; | ||
filtered_user = SELECT s | ||
FROM all_user:s - ((Posted|Liked|Friend):e) - (Post|Person):t | ||
FROM (s:all_user) -[e:Posted|Liked|Friend]-> (t:Post|Person) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Posted and Liked are directed edge types -[ ]-> |
||
// WHERE e.action_time > epoch_to_datetime(1) AND t.gender == "Male"; | ||
WHERE ( e.type == "Liked" AND e.action_time > epoch_to_datetime(1) ) OR | ||
( e.type == "Friend" AND t.gender == "Male" ); | ||
|
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.
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 |
---|---|---|
|
@@ -194,9 +194,9 @@ In the following example, the selection conditions are completely specified in t | |
.`WHERE` used as a filter | ||
[source,gsql] | ||
---- | ||
result_set1 = SELECT v FROM S:v-((E1|E2|E3):e)-(V1|V2):t; | ||
result_set2 = SELECT v FROM S:v-(:e)-:t | ||
WHERE t.type IN ("V1", "V2") AND t IN v.neighbors("E1|E2|E3") | ||
result_set1 = SELECT v FROM (v:S) -[e:(E1|E2|E3)]- (t:V1|V2); | ||
Tushar-TG-14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
result_set2 = SELECT v FROM (v:S) -[e:]- (t) | ||
WHERE t.type IN ("V1", "V2") AND t IN v.neighbors("E1|E2|E3"); | ||
---- | ||
|
||
|
||
|
@@ -437,7 +437,7 @@ For example, consider the following clauses: | |
|
||
[source,gsql] | ||
---- | ||
FROM Person:A -(Knows.Knows)- Person:C | ||
FROM (A:Person) -[Knows.Knows:Knows]- (C:Person) | ||
Tushar-TG-14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
WHERE C.email = "[email protected]" | ||
ACCUM C.@pattern_count += 1 | ||
---- | ||
|
@@ -915,7 +915,7 @@ This query does not compile because the having condition is testing the wrong ve | |
CREATE QUERY print_member_about_cats() FOR GRAPH Social_Net | ||
{ | ||
start = {Person.*}; | ||
result = SELECT v FROM start:v -(:e)- Post:tgt | ||
result = SELECT v FROM (v:start) -[e]- (tgt:Post) | ||
HAVING tgt.subject == "cats"; | ||
PRINT result; | ||
} | ||
|
@@ -1006,9 +1006,9 @@ There are three forms: | |
.`LIMIT` scenarios | ||
[source.wrap,gsql] | ||
---- | ||
result = SELECT v FROM S -(:e)- :v LIMIT k; <1> | ||
result = SELECT v FROM S -(:e)- :v LIMIT j, k; <2> | ||
result = SELECT v FROM S -(:e)- :v LIMIT k OFFSET j; <3> | ||
result = SELECT v FROM (S) -[e]- (v) LIMIT k; <1> | ||
result = SELECT v FROM (S) -[e]- (v) LIMIT j, k; <2> | ||
result = SELECT v FROM (S) -[e]- (v) LIMIT k OFFSET j; <3> | ||
Tushar-TG-14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
---- | ||
<1> Case 1: k = Count | ||
<2> Case 2: j = Offset from the start of the list, k = Count | ||
|
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.
Uh oh!
There was an error while loading. Please reload this page.