Semantic Check Fails: Please specify the from_id for vertex device

I can’t figure out what the error message “Please specify the from_id for vertex device” below is really trying to tell me. Any idea?

GSQL > select count(*) from device-(device_has_host_event)->host_event
[{
  "count": 884911,
  "e_type": "device_has_host_event"
}]
GSQL > select * from device-(device_has_host_event)->host_event limit 10
Semantic Check Fails: Please specify the from_id for vertex device

Looks like query language in GSQL console is not the same as in .gsql file :sweat_smile: . I will stick to .gsql for now.

The query you were running (with a minor syntax error, hence the error message) is what we call a “Built-in Query”: https://docs.tigergraph.com/start/gsql-examples/common-applications#built-in-queries
Built-in Queries are not GSQL; they are very SQL-like, but also limited in capability. They provide a handy way to select and inspect the vertices and edges that are in the database. They are not for graph traversal or analytics or transactions.

The specific error: You can only select edges if you specific a single source vertex using the clause
WHERE from_id==<source_id>

Note, however, that running built-in queries is unrelated to whether you are in the GSQL interactive console or not. For example, if you in a Linux shell, you can run a built-in query the same way you would run a GSQL command, but enclosing it in quotes (or by naming a file containing your commands).

Linux> gsql -g MyGraph 'SELECT count(*) FROM Person'
Linux> gsql -g MyGraph 'RUN QUERY pageRank(<parameters>)'
1 Like

Victor,

Thanks for your detailed explanation! It all makes sense now.

I was mainly using the help page below for reference. It would be nice if it had a note explaining that distinction between the built-in select statement and gsql select statement.
https://docs.tigergraph.com/dev/gsql-ref/querying/select-statement#gsql-select-statement

1 Like