Another two things surprising me with GSQL.
A.
I’m taking the hello example
When I start GSQL and enter just the first line from the example, GSQL immediately comes back with an error::
GSQL-Dev > CREATE QUERY hello(VERTEX<person> p) FOR GRAPH social{
Encountered "<EOF>" at line 1, column 54.
Was expecting:
"}" ...
It seems to me that the query analyzer should recognize that I haven’t finished entering my query yet.
It works if I put everything on one line:
GSQL-Dev > CREATE QUERY hello(VERTEX<person> p) FOR GRAPH social{ Start = {p}; Result = SELECT tgt FROM Start:s-(friendship:e) ->person:tgt; PRINT Result; }
The query hello has been added!
but that’s seems ugly.
Does that mean I just have to put my entire query into a file in order to create it?
This doesn’t seem to be documented anywhere that I could find…
B.
The query is declared to take an argument of a Vertex of a type person
. However, in the actual execution, the query is passed a STRING
.
RUN QUERY hello("Tom")
Somehow a step is skipped. Is the string implicitly used as a primary key for the vertex?
(I’ll need to figure out how to manage the query if the argument is not the primary id for a vertex.)