Graphs share the same vertices and edges

Hello TG Team,

I am currently using a global schema and have several graphs all have the same schema. I just found that after loading data for each graph, all loaded vertices and edges from different graphs were mixed together. My use case is about running queries sometimes on all vertices and edges and sometimes on those bound only to a particular graph; however I don’t know how to separate the graphs, since when I was using pytigergraph, the vertex and edge counts retrieved from the connection object of a particular graph always equal to the global counts. Please help.

Thanks

There are a few ways to have separate graphs that have the same schema. You indicated that you sometimes want to run queries on the whole super-graph, and sometimes on individual graphs.
I’d like to suggest that we call each of your individual input graphs a dataset, so as not to confuse that with what you end up with inside TigerGraph.

  1. Using our classic MultiGraph feature, use CREATE GRAPH for each dataset. Give each graph a unique name, but define the same schema for each. In addition, define one more graph that includes all the vertex types and edge types from all the local graphs. You can use CREATE GRAPH supergraph (*), but caution: If you add more schemas or vertex/edge types after running CREATE GRAPH supergraph (*), supergraph will NOT automatically update.
  2. Use the new tag-based graph feature. This is probably a better fit. Define a tag ( a special type of attribute) to distinguish each dataset. However, you can only have up to 64 different tags.
    Defining a Graph Schema :: GSQL Language Reference

.

1 Like