Gsql cannot find schema that it gsql cannot find schema that it created

gsql cannot find schema that it created I am running into some very strange behavior with a stock standard TigerGraph docker container. When I create schema it doesn’t seem to be associated to my graph, but rather lives in some nether space where it can only be interacted with to create/delete, but can’t show or select. Here is a history of commands attempted directly after a clean boot of a new developer container:

tigergraph@ffff8fd6b2ce:~$ gsql

Welcome to TigerGraph Developer Edition, for non-commercial use only.

GSQL-Dev > create graph g_graph(*)

Restarting gse gpe restpp …

Finish restarting services in 16.522 seconds!

The graph g_graph is created.

GSQL-Dev > use graph g_graph

Using graph ‘g_graph’

GSQL-Dev > create vertex v_example(PRIMARY_ID id STRING)

The vertex type v_example is created.

GSQL-Dev > show vertex v_example

Semantic Check Fails: The vertex v_example doesn’t exist!

GSQL-Dev > select * from v_example limit 1

Semantic Check Fails: The vertex type v_example doesn’t exist!

GSQL-Dev > drop vertex v_example

The vertex type v_example is dropped.

GSQL-Dev > create vertex v_example(PRIMARY_ID id STRING)

The vertex type v_example is created.

GSQL-Dev > show vertex v_example

Semantic Check Fails: The vertex v_example doesn’t exist!

GSQL-Dev > (ctrl-c)

tigergraph@ffff8fd6b2ce:~$ gsql

Welcome to TigerGraph Developer Edition, for non-commercial use only.

GSQL-Dev > show vertex v_example

  • VERTEX v_example(PRIMARY_ID id STRING) WITH STATS=“OUTDEGREE_BY_EDGETYPE”

GSQL-Dev > use graph g_graph

Using graph ‘g_graph’

GSQL-Dev > show vertex v_example

Semantic Check Fails: The vertex v_example doesn’t exist!

I don’t understand how it is possible for the schema to exist for the purposes of some commands but not others. What am I doing wrong here?

Okay, this is a peculiarity of the development edition of the product.

What is happening is that the type is being created (as a global type definition), but it is not being incorporated into the graph.

In the enterprise edition, this can be incorporated post graph creation using a schema change job (https://docs.tigergraph.com/dev/gsql-ref/ddl-and-loading/modifying-a-graph-schema). I don’t think this is possible on the development version (https://www.tigergraph.com/comparison-of-tigergraph-editions/)

So, what you need to do is drop the graph, “create” your vertices, and only then “create” your graph with the vertex types you want in the graph. Then you reload your data and you are good to go.

If you need to check out the dynamic version of the product, let me know and I can give you a limited license to the enterprise edition. It is still a relatively heavy-weight operation, however.

My workarounds are: always have recreation scripts and get a coffee while it runs, make use of dynamic collection types in my vertices when I need real flexibility, and factor the stable attributes into properties when I need to, as part of my “rebuild while I check emails” workflow.

I think I’ll also mention this internally as a concern, and see what our thoughts are about bringing dynamic schema changes into the development edition of the product.