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.
What will be the GSQL procedure for retrieving all nodes and relationships in Tiger Graph?
285 Views Asked by Upasana Pandey At
2
There are 2 best solutions below
0
On
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;
}
I admit that doing this is easier in Cypher, but there you go: