I recently started working on Tiger Graph and looking for the GSQL procedure for retrieving all nodes and relationships. Just like in Cypher, we have the query Match (n) Return n. I couldn't able to find any specific answer for the same query with GSQL.
Asked
Active
Viewed 171 times
2 Answers
1
In Neo4j
Match (n) Return n
will give you only all the nodes without relations.
In Tiger you should write:
CREATE OR REPLACE QUERY generated_query() FOR GRAPH graphName SYNTAX V3 {
VS= SELECT n
FROM (n);
PRINT VS;
}
If you wish to get all nodes and relations, For Neo4j:
Match (n)-[r]-(a) Return n,r,a
and for Tiger:
CREATE OR REPLACE QUERY generated_query() FOR GRAPH openCypher_Movie SYNTAX V3 {
SELECT n,r,a INTO T
FROM (n)-[r]-(a);
PRINT T;
}

Eran.G
- 89
- 1
- 6
0
I admit that doing this is easier in Cypher, but there you go:
CREATE QUERY allOfIt() FOR GRAPH MyGraph {
ListAccum <EDGE> @@allE;
G = {ANY};
G2 = SELECT s FROM G:s-(:e)->:t
ACCUM @@allE += e
HAVING 1==0;
PRINT G, @@allE;
}

Francois Vanderseypen
- 1,432
- 1
- 12
- 22