This page introduces statements for managing node and edge schemas in a graph.
Showing Schemas
The SHOW NODE SCHEMA
and SHOW EDGE SCHEMA
statements retrieve information about node and edge schemas of the current graph.
SHOW NODE SCHEMA
SHOW EDGE SCHEMA
The information about schemas is organized into different tables:
- Node schemas: Stored in
_nodeSchema
(all schemas) and_nodeSchema_shard_N
(schemas with data in shardN
) tables. - Edge schemas: Stored in
_edgeSchema
(all schemas) and_edgeSchema_shard_N
(schemas with data in shardN
) tables.
Each table includes fields that provide essential details about each schema:
Field |
Description |
---|---|
id |
The id of the schema. |
name |
The name assigned to the schema. |
description |
The description given to the schema. |
status |
The current state of the schema, which can only be CREATED . |
properties |
The properties of the schema, with each property contains fields: name , id , type , description , index , fulltext , nullable , lte , read , write , encrypt , and is_deleted . |
There is another table _graphCount
which gives an overview of node and edge counts across schemas. For example:
type | schema | from_schema | to_schema | count |
---|---|---|---|---|
total_nodes | 304 | |||
node | account | 120 | ||
node | movie | 184 | ||
total_edges | 956 | |||
edge | rate | account | movie | 568 |
edge | follow | account | account | 388 |
- The
count
oftotal_nodes
is the sum of nodes across all the listed node schemas. - The
count
of each individualnode
schema is the total number of nodes belonging to that specific schema. - The
count
oftotal_edges
is the sum of edges across all the listed edge schemas. - The
count
of each individualedge
schema is the number of edges belonging to that specific schema while connecting afrom_schema
node to ato_schema
node.