Code taken from the example:
“The basics of TigerGraph’s graph query language, GSQL”
(but some names are a little different as they were imported from another example)
- This compiles and runs:
CREATE QUERY GetPersons(vertex<person> inputPerson) FOR GRAPH social {
Start = {inputPerson};
Friends = SELECT t FROM Start:s-(friendship:e)-person:t;
PRINT Friends;
}
But this one does not:
CREATE QUERY GetPersons(vertex<person> inputPerson) FOR GRAPH social {
Start = {inputPerson};
Friends = SELECT t FROM Start:s-(friendship:e)-:t;
WHERE e.connect_day BETWEEN to_datetime("2015-07-01") AND to_datetime("2016-09-01")
AND t.gender == "male";
PRINT Friends;
}
As far as I can see the syntax from the example is perfect yet there’s a problem with “WHERE” as shown in the screenshot below:
And this is a screenshot from the Youtube video I copied this from:
Can someone kindly point out where I’m going wrong?
- The first example has this line:
Friends = SELECT t FROM Start:s-(friendship:e)-person:t;
And the second example writes the same line like this:
Friends = SELECT t FROM Start:s-(friendship:e)-:t;
Question: why is “person” removed from the second line/example?
Thank you