How to create and query vertex data records from Tigergraph CloudQ

Please am New to Vertex. Am working with Tigergraph Cloud… It seems Tigergraph Cloud does not have shell command.

I want to create a Vertex and query the vertex records from Tigergraph Cloud.

In the write queries option, I have tried the following code below but it refuse to run.

// create vertex

CREATE VERTEX Person (PRIMARY_ID user_id UINT, name STRING, age UINT, gender STRING, postalCode STRING) FOR GRAPH mygraph_db{ 
  /* Write query logic here */ 
  PRINT "Person created!"; 
}

// query results


CREATE VERTEX Person (Select * from Person) FOR GRAPH mygraph_db{ 
  /* Write query logic here */ 
  PRINT "Records queried successfully!"; 

PRINT Person;
}

please what is the best way to do it.

Hi!

I would recommend you check out the TigerGraph 101 video (Introduction in TigerGraph: TigerGraph 101 - YouTube) to get familiar with the functionalities of GraphStudio.

You can create vertices with the “Design Schema” tab, upload data, then run a query to retrieve the vertex records. (I would recommend checking out GSQL 101 for how to write queries!)

If you would like to script more of the graph database, you can use some community tools including pyTigerGraph’s GSQL interface and Giraffle.

To Create Vertices

Check out the TigerGraph 101 video for how to create vertices graphically. Otherwise, through some of the aforementioned tools, you can create vertices through GSQL with:

CREATE VERTEX Person (PRIMARY_ID user_id UINT, name STRING, age UINT, gender STRING, postalCode STRING)

To Query Vertices

To query the vertices, you can create a new query in the “Write Queries” tab of GraphStudio with something like the following:

CREATE QUERY getPeople() FOR GRAPH mygraph_db { 
  People = {Person.*};
  
  PRINT People;
}

Let me know if you have any more questions!

1 Like